Changeset 1860 for trunk/gsdl/lib


Ignore:
Timestamp:
2001-01-26T07:26:45+13:00 (23 years ago)
Author:
cs025
Message:

Included CORBA branch for first time

Location:
trunk/gsdl/lib
Files:
11 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/Makefile.in

    r1283 r1860  
    2828AR = ar
    2929CC = @CC@
     30CPP = @CXX@
    3031#CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
    3132CCFLAGS = @CFLAGS@
     33MCFLAGS = @CFLAGS@ -Wall -Wunused
    3234DEFS = @DEFS@
    33 INCLUDES = -I../packages/mg/lib
     35INCLUDES = -I../packages/mg/lib -I..
     36MICO_DIR = @MICO_DIR@
     37ifeq ($(MICO_DIR), default)
     38MICO_INC = -I../packages/mico/include
     39else
     40ifeq ($(MICO_DIR), yes)
     41MICO_INC =
     42else
     43MICO_INC = -I$(MICO_DIR)
     44endif
     45endif
     46MINCLUDES = -I. -I../packages/mg/lib $(MICO_INC) -I..
    3447RANLIB = @RANLIB@
     48USE_CORBA = @USE_CORBA@
    3549
    3650COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
     51CPPCOMPILE = $(CPP) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
     52
     53ifneq ($(USE_CORBA), 0)
     54MCOMPILE = mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c
     55else
     56MCOMPILE = $(COMPILE)
     57endif
    3758
    3859.SUFFIXES:
     
    4364.SUFFIXES: .cpp .o
    4465.cpp.o:
    45     $(COMPILE) $<
     66    $(CPPCOMPILE) $<
     67
     68.SUFFIXES: .mpp .o
     69.mpp.o:
     70    $(MCOMPILE) $<
    4671
    4772
     73ifneq ($(USE_CORBA), 0)
     74CORBAHEADERS = \
     75  corbaconv_text_t.h corbatext_t.h
     76CORBASOURCES = \
     77  corbaiface.mpp    corbatext_t.mpp  corbaconv_text_t.mpp
     78CORBAOBJECTS = \
     79  corbaiface.o      corbatext_t.o    corbaconv_text_t.o
     80else
     81CORBAHEADERS =
     82CORBASOURCE =
     83CORBAOBJECTS =
     84endif
     85
    4886HEADERS = \
    49   cfgread.h      fileutil.h     gsdlunicode.h  text_t.h \
    50   display.h      gsdlconf.h     gsdltimes.h    gsdltools.h
     87  cfgread.h      fileutil.h     gsdlunicode.h  gsdltools.h text_t.h \
     88  display.h      gsdlconf.h     gsdltimes.h    cnfgable.h  cnfgator.h \
     89  $(CORBAHEADERS)
     90
    5191
    5292SOURCES = \
    53   cfgread.cpp      fileutil.cpp     text_t.cpp \
    54   display.cpp      gsdlunicode.cpp  gsdltimes.cpp  gsdltools.cpp
     93  cfgread.cpp      fileutil.cpp     text_t.cpp     cnfgable.cpp \
     94  display.cpp      gsdlunicode.cpp  gsdltimes.cpp  gsdltools.cpp \
     95  cnfgator.cpp     $(CORBASOURCES)
    5596
    5697OBJECTS = \
    57   cfgread.o        fileutil.o       text_t.o   \
    58   display.o        gsdlunicode.o    gsdltimes.o  gsdltools.o
     98  cfgread.o        fileutil.o       text_t.o     cnfgable.o \
     99  display.o        gsdlunicode.o    gsdltimes.o  gsdltools.o \
     100  cnfgator.o       $(CORBAOBJECTS)
    59101
    60102
    61103all: gsdllib.a
    62104
     105corbaiface.mpp: corbaiface.idl
     106    idl --c++-suffix=mpp $?
    63107
    64108GSDLLIBOBJECTS = $(OBJECTS)
     
    69113    $(RANLIB) gsdllib.a
    70114
    71 distclean:
    72     rm -f $(OBJECTS) gsdllib.a Makefile
    73 
    74115clean:
    75116    rm -f $(OBJECTS) gsdllib.a
     
    79120depend:
    80121    makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
     122
     123
     124
     125
  • trunk/gsdl/lib/display.cpp

    r1495 r1860  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
     24 * $Id$
     25 *
    2426 *********************************************************************/
    2527
     28/*
     29   $Log$
     30   Revision 1.24  2001/01/25 18:26:44  cs025
     31   Included CORBA branch for first time
     32
     33   Revision 1.17.2.1  2000/04/04 15:02:28  cs025
     34   Corba first commit
     35
     36   Revision 1.17  2000/02/29 21:00:38  sjboddie
     37   fixed some compiler warnings
     38
     39   Revision 1.16  1999/11/25 21:53:08  sjboddie
     40   fixed bug in logout
     41
     42   Revision 1.15  1999/09/24 02:25:35  rjmcnab
     43   removed limitation on the number of arguments that a macro can have
     44
     45   Revision 1.14  1999/09/07 04:57:41  sjboddie
     46   added gpl notice
     47
     48   Revision 1.13  1999/08/31 07:59:11  rjmcnab
     49   Generalised spaces to unicode spaces, added ability to automatically detect
     50   whether the input file is Unicode or UTF-8 and read the file in the
     51   appropriate way, and improved the error messages slightly.
     52
     53   Revision 1.12  1999/07/21 20:46:12  rjmcnab
     54   fixed small bug
     55
     56   Revision 1.11  1999/07/21 07:26:30  rjmcnab
     57   Added more operators to _If_, changed quoting of parameters so that
     58   ' can be used to quote but it is removed, and made slight optimisation
     59   so that macros that don't contain other macros aren't expanded.
     60
     61   Revision 1.10  1999/03/01 20:39:54  sjboddie
     62
     63   Added eq and ne functionality to _If_
     64
     65   Revision 1.9  1999/03/01 01:18:09  sjboddie
     66
     67   Fixed bug in _If_ when value being tested was only one character
     68   long (e.g. "0" or "1")
     69
     70   Revision 1.8  1999/02/28 23:15:29  rjmcnab
     71
     72   Made _If_ recognise 'false' and '0' as being false.
     73
     74   Revision 1.7  1999/02/08 01:26:11  rjmcnab
     75
     76   Improved the error reporting.
     77
     78   Revision 1.6  1999/01/19 08:30:23  rjmcnab
     79
     80   Added a method to determine whether a macro has been defined.
     81
     82   Revision 1.5  1999/01/19 01:38:12  rjmcnab
     83
     84   Made the source more portable.
     85
     86   Revision 1.4  1999/01/12 01:50:57  rjmcnab
     87
     88   Standard header.
     89
     90   Revision 1.3  1999/01/08 02:33:13  rjmcnab
     91
     92   Added standard header to source files.
     93
     94 */
    2695#include "display.h"
    2796#include "gsdlunicode.h"
     
    15651634    }
    15661635
     1636  // GRB: deal with remaining code properly as it faults
     1637  return false;
     1638
    15671639  if (logout != NULL) {
    15681640    (*logout) << text_t2ascii << "Warning: _" <<
  • trunk/gsdl/lib/text_t.cpp

    r1310 r1860  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
     24 * $Id$
     25 *
    2426 *********************************************************************/
     27
     28/*
     29   $Log$
     30   Revision 1.20  2001/01/25 18:26:44  cs025
     31   Included CORBA branch for first time
     32
     33   Revision 1.15.2.2  2000/04/05 10:19:38  syeates
     34   added automatic conversion to allow text_t's to be <<'ed to ostreams
     35
     36   Revision 1.15.2.1  2000/04/04 15:02:29  cs025
     37   Corba first commit
     38
     39   Revision 1.15  1999/10/14 22:52:39  sjboddie
     40   joinchar can join using text_t string now too
     41
     42   Revision 1.14  1999/09/24 02:30:03  rjmcnab
     43   added function has_unicode_letdig
     44
     45   Revision 1.13  1999/09/07 04:57:43  sjboddie
     46   added gpl notice
     47
     48   Revision 1.12  1999/08/31 08:04:41  rjmcnab
     49   Fixed a small but hard to find bug in getcarr
     50
     51   Revision 1.11  1999/07/01 04:05:09  rjmcnab
     52   Optimised append functions slightly and added a reserve function.
     53
     54   Revision 1.10  1999/04/26 03:58:03  sjboddie
     55   added is_number function
     56
     57   Revision 1.9  1999/04/06 22:17:24  rjmcnab
     58   Added splits and joins using text_tset.
     59
     60   Revision 1.8  1999/02/28 23:14:41  rjmcnab
     61
     62   Added uc and lc to convert to uppercase and lowercase.
     63
     64   Revision 1.7  1999/02/21 22:26:39  rjmcnab
     65
     66   Made getint() a constant function.
     67
     68   Revision 1.6  1999/02/03 01:13:26  sjboddie
     69
     70   Got interface to handle subcollections and language subcollections -
     71   committed changes made to some of the collections
     72
     73   Revision 1.5  1999/01/19 01:38:14  rjmcnab
     74
     75   Made the source more portable.
     76
     77   Revision 1.4  1999/01/12 01:51:00  rjmcnab
     78
     79   Standard header.
     80
     81   Revision 1.3  1999/01/08 02:33:16  rjmcnab
     82
     83   Added standard header to source files.
     84
     85 */
    2586
    2687#include "text_t.h"
     
    3899#endif
    39100
     101#ifdef HAVE_CONFIG_H
     102# ifdef __WIN32__
     103#  include "WIN32cfg.h"
     104# else
     105#  include "config.h"
     106# endif
     107#endif
     108
    40109
    41110#include "unitool.h"
     
    44113// text_t methods
    45114////////////////////////////////////
     115
     116// new stream converter ...
     117ostream& operator<< (ostream &o, const text_t text)
     118{
     119  text_t::const_iterator ithere = text.begin();
     120  text_t::const_iterator itend = text.end();
     121
     122  while (ithere != itend)
     123    {
     124      if (*ithere < 256)
     125    {
     126      o << (unsigned char)(*ithere);
     127    }
     128      else
     129    {
     130    // put a space or a question mark depending on what
     131    // the character is. Question marks tell the user that
     132    // they are missing some information.
     133    if (is_unicode_space (*ithere))
     134      o << ' ';
     135    else
     136      o << '?';
     137      }
     138      ithere++;
     139    }
     140
     141  return o;
     142}
    46143
    47144text_t::text_t ()
     
    64161  appendcstr (s);
    65162}
     163
    66164
    67165void text_t::append (const text_t &t)
     
    265363    }
    266364  return first;
     365}
     366
     367text_t::iterator findword (text_t::iterator first, text_t::iterator last,
     368               const text_t& word)
     369{
     370  text_t::const_iterator word_begin = word.begin();
     371  text_t::const_iterator word_end = word.end();
     372
     373  while (first != last)
     374    {
     375      text_t::iterator char_match = first;
     376      text_t::const_iterator word_here = word_begin;
     377      while (word_here!=word_end)
     378    {
     379      if (*char_match != *word_here)
     380        {
     381          break;
     382        }
     383      char_match++;
     384      word_here++;
     385    }
     386      if (word_here==word_end)
     387    {
     388      return first;
     389    }
     390      first++;
     391    }
     392  return last; // get to here only if there is no match
    267393}
    268394
  • trunk/gsdl/lib/text_t.h

    r1596 r1860  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     23 *
     24 * $Id$
    2325 *
    2426 *********************************************************************/
     
    9799  unsigned short getencoding () {return encoding;};
    98100
     101  usvector& text_as_usvector() { return text ; };
     102  const usvector& text_as_usvector() const { return text ; };
     103
    99104  // basic container support
    100105  iterator begin () {return text.begin();}
     
    162167  char *getcarr(size_type &len) const;
    163168  char *getcstr() const;
    164 };
    165 
     169
     170};
     171
     172// new stream converter ...
     173ostream& operator<< (ostream &o, const text_t text);
    166174
    167175inline text_t operator+(const text_t &t1, const text_t &t2)
     
    216224text_t::iterator findchar (text_t::iterator first, text_t::iterator last,
    217225               unsigned short c);
     226
     227text_t::iterator findword (text_t::iterator first, text_t::iterator last,
     228               const text_t &word);
    218229
    219230// get a string up to the next delimiter (which is skipped)
Note: See TracChangeset for help on using the changeset viewer.