Changeset 1860 for trunk/gsdl/lib
- Timestamp:
- 2001-01-26T07:26:45+13:00 (23 years ago)
- Location:
- trunk/gsdl/lib
- Files:
-
- 11 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/Makefile.in
r1283 r1860 28 28 AR = ar 29 29 CC = @CC@ 30 CPP = @CXX@ 30 31 #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual 31 32 CCFLAGS = @CFLAGS@ 33 MCFLAGS = @CFLAGS@ -Wall -Wunused 32 34 DEFS = @DEFS@ 33 INCLUDES = -I../packages/mg/lib 35 INCLUDES = -I../packages/mg/lib -I.. 36 MICO_DIR = @MICO_DIR@ 37 ifeq ($(MICO_DIR), default) 38 MICO_INC = -I../packages/mico/include 39 else 40 ifeq ($(MICO_DIR), yes) 41 MICO_INC = 42 else 43 MICO_INC = -I$(MICO_DIR) 44 endif 45 endif 46 MINCLUDES = -I. -I../packages/mg/lib $(MICO_INC) -I.. 34 47 RANLIB = @RANLIB@ 48 USE_CORBA = @USE_CORBA@ 35 49 36 50 COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES) 51 CPPCOMPILE = $(CPP) -c $(CCFLAGS) $(DEFS) $(INCLUDES) 52 53 ifneq ($(USE_CORBA), 0) 54 MCOMPILE = mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c 55 else 56 MCOMPILE = $(COMPILE) 57 endif 37 58 38 59 .SUFFIXES: … … 43 64 .SUFFIXES: .cpp .o 44 65 .cpp.o: 45 $(COMPILE) $< 66 $(CPPCOMPILE) $< 67 68 .SUFFIXES: .mpp .o 69 .mpp.o: 70 $(MCOMPILE) $< 46 71 47 72 73 ifneq ($(USE_CORBA), 0) 74 CORBAHEADERS = \ 75 corbaconv_text_t.h corbatext_t.h 76 CORBASOURCES = \ 77 corbaiface.mpp corbatext_t.mpp corbaconv_text_t.mpp 78 CORBAOBJECTS = \ 79 corbaiface.o corbatext_t.o corbaconv_text_t.o 80 else 81 CORBAHEADERS = 82 CORBASOURCE = 83 CORBAOBJECTS = 84 endif 85 48 86 HEADERS = \ 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 51 91 52 92 SOURCES = \ 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) 55 96 56 97 OBJECTS = \ 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) 59 101 60 102 61 103 all: gsdllib.a 62 104 105 corbaiface.mpp: corbaiface.idl 106 idl --c++-suffix=mpp $? 63 107 64 108 GSDLLIBOBJECTS = $(OBJECTS) … … 69 113 $(RANLIB) gsdllib.a 70 114 71 distclean:72 rm -f $(OBJECTS) gsdllib.a Makefile73 74 115 clean: 75 116 rm -f $(OBJECTS) gsdllib.a … … 79 120 depend: 80 121 makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES) 122 123 124 125 -
trunk/gsdl/lib/display.cpp
r1495 r1860 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$ 25 * 24 26 *********************************************************************/ 25 27 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 */ 26 95 #include "display.h" 27 96 #include "gsdlunicode.h" … … 1565 1634 } 1566 1635 1636 // GRB: deal with remaining code properly as it faults 1637 return false; 1638 1567 1639 if (logout != NULL) { 1568 1640 (*logout) << text_t2ascii << "Warning: _" << -
trunk/gsdl/lib/text_t.cpp
r1310 r1860 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$ 25 * 24 26 *********************************************************************/ 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 */ 25 86 26 87 #include "text_t.h" … … 38 99 #endif 39 100 101 #ifdef HAVE_CONFIG_H 102 # ifdef __WIN32__ 103 # include "WIN32cfg.h" 104 # else 105 # include "config.h" 106 # endif 107 #endif 108 40 109 41 110 #include "unitool.h" … … 44 113 // text_t methods 45 114 //////////////////////////////////// 115 116 // new stream converter ... 117 ostream& 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 } 46 143 47 144 text_t::text_t () … … 64 161 appendcstr (s); 65 162 } 163 66 164 67 165 void text_t::append (const text_t &t) … … 265 363 } 266 364 return first; 365 } 366 367 text_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 267 393 } 268 394 -
trunk/gsdl/lib/text_t.h
r1596 r1860 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 24 * $Id$ 23 25 * 24 26 *********************************************************************/ … … 97 99 unsigned short getencoding () {return encoding;}; 98 100 101 usvector& text_as_usvector() { return text ; }; 102 const usvector& text_as_usvector() const { return text ; }; 103 99 104 // basic container support 100 105 iterator begin () {return text.begin();} … … 162 167 char *getcarr(size_type &len) const; 163 168 char *getcstr() const; 164 }; 165 169 170 }; 171 172 // new stream converter ... 173 ostream& operator<< (ostream &o, const text_t text); 166 174 167 175 inline text_t operator+(const text_t &t1, const text_t &t2) … … 216 224 text_t::iterator findchar (text_t::iterator first, text_t::iterator last, 217 225 unsigned short c); 226 227 text_t::iterator findword (text_t::iterator first, text_t::iterator last, 228 const text_t &word); 218 229 219 230 // get a string up to the next delimiter (which is skipped)
Note:
See TracChangeset
for help on using the changeset viewer.