00001 #ifndef SYSTEM_STRING_IMPLEMENTATION_FILE
00002 #define SYSTEM_STRING_IMPLEMENTATION_FILE
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "system_string.h"
00021 #include "wp_implementation.h"
00022
00023 system_string::system_string(const char *str)
00024 { contents = XmStringCreate((char *)str, XmSTRING_DEFAULT_CHARSET); }
00025
00026 system_string::system_string(const istring &str)
00027 { contents = XmStringCreate((char *)str.s(), XmSTRING_DEFAULT_CHARSET); }
00028
00029 system_string::system_string(int n, const char *lines[], concatenation_method how)
00030 {
00031 contents = XmStringCreate((char *)"", XmSTRING_DEFAULT_CHARSET);
00032 if (n <= 0) return;
00033 else {
00034 for (int i = 0; i < n; i++) {
00035
00036 if (!lines[i]) break;
00037
00038 if ( (how == SPACE_SEPARATE) && (i > 0) )
00039 contents = XmStringConcat
00040 (contents, XmStringCreate((char *)" ", XmSTRING_DEFAULT_CHARSET));
00041 else if ( (how == INDEX_SEPARATE) && (i > 0) )
00042
00043 contents = XmStringConcat
00044 (contents, XmStringCreate((char *)" ", XmSTRING_DEFAULT_CHARSET));
00045
00046
00047
00048 if (how == EOL_SEPARATE) contents = XmStringConcat
00049 (contents, XmStringLtoRCreate((char *)lines[i], XmSTRING_DEFAULT_CHARSET));
00050 else contents = XmStringConcat
00051 (contents, XmStringCreate((char *)lines[i], XmSTRING_DEFAULT_CHARSET));
00052 }
00053 }
00054 }
00055
00056 system_string::~system_string() { XmStringFree(contents); }
00057
00058 system_string::operator window_string () const { return contents; }
00059
00060 int compound_length(const char *str[])
00061 { int i; for (i = 0; *str[i]; i++) {}; return i; }
00062
00063
00064 #endif //SYSTEM_STRING_IMPLEMENTATION_FILE
00065