SAGA API  v9.7
api_string.cpp
Go to the documentation of this file.
1 
3 // //
4 // SAGA //
5 // //
6 // System for Automated Geoscientific Analyses //
7 // //
8 // Application Programming Interface //
9 // //
10 // Library: SAGA_API //
11 // //
12 //-------------------------------------------------------//
13 // //
14 // api_string.cpp //
15 // //
16 // Copyright (C) 2005 by Olaf Conrad //
17 // //
18 //-------------------------------------------------------//
19 // //
20 // This file is part of 'SAGA - System for Automated //
21 // Geoscientific Analyses'. //
22 // //
23 // This library is free software; you can redistribute //
24 // it and/or modify it under the terms of the GNU Lesser //
25 // General Public License as published by the Free //
26 // Software Foundation, either version 2.1 of the //
27 // License, or (at your option) any later version. //
28 // //
29 // This library is distributed in the hope that it will //
30 // be useful, but WITHOUT ANY WARRANTY; without even the //
31 // implied warranty of MERCHANTABILITY or FITNESS FOR A //
32 // PARTICULAR PURPOSE. See the GNU Lesser General Public //
33 // License for more details. //
34 // //
35 // You should have received a copy of the GNU Lesser //
36 // General Public License along with this program; if //
37 // not, see <http://www.gnu.org/licenses/>. //
38 // //
39 //-------------------------------------------------------//
40 // //
41 // contact: Olaf Conrad //
42 // Institute of Geography //
43 // University of Goettingen //
44 // Goldschmidtstr. 5 //
45 // 37077 Goettingen //
46 // Germany //
47 // //
48 // e-mail: oconrad@saga-gis.org //
49 // //
51 
52 //---------------------------------------------------------
53 #include <math.h>
54 
55 #include <wx/string.h>
56 #include <wx/datetime.h>
57 #include <wx/tokenzr.h>
58 #include <wx/wxcrt.h>
59 #include <wx/wxcrtvararg.h>
60 #include <wx/convauto.h>
61 
62 #include "api_core.h"
63 #include "mat_tools.h"
64 
65 
67 // //
68 // //
69 // //
71 
72 //---------------------------------------------------------
74 {
75  m_pString = new wxString;
76 }
77 
79 {
80  m_pString = new wxString(*String.m_pString);
81 }
82 
83 CSG_String::CSG_String(const char *String)
84 {
85  m_pString = String ? new wxString(String) : new wxString;
86 }
87 
88 CSG_String::CSG_String(const wchar_t *String)
89 {
90  m_pString = String ? new wxString(String) : new wxString;
91 }
92 
93 CSG_String::CSG_String(char Character, size_t nRepeat)
94 {
95  m_pString = new wxString(Character, nRepeat);
96 }
97 
98 CSG_String::CSG_String(wchar_t Character, size_t nRepeat)
99 {
100  m_pString = new wxString(Character, nRepeat);
101 }
102 
103 //---------------------------------------------------------
104 CSG_String::CSG_String(const class wxString *String)
105 {
106  m_pString = String ? new wxString(*String) : new wxString;
107 }
108 
109 bool CSG_String::Create(const class wxString *pString)
110 {
111  if( pString )
112  *m_pString = *pString;
113  else
114  m_pString->Clear();
115 
116  return( true );
117 }
118 
119 //---------------------------------------------------------
121 {
122  delete(m_pString);
123 }
124 
125 
127 // //
129 
130 //---------------------------------------------------------
132 {
133  *m_pString = *String.m_pString;
134 
135  return( *this );
136 }
137 
138 CSG_String & CSG_String::operator = (const char *String)
139 {
140  *m_pString = String;
141 
142  return( *this );
143 }
144 
145 CSG_String & CSG_String::operator = (const wchar_t *String)
146 {
147  *m_pString = String;
148 
149  return( *this );
150 }
151 
153 {
154  *m_pString = Character;
155 
156  return( *this );
157 }
158 
160 {
161  *m_pString = Character;
162 
163  return( *this );
164 }
165 
166 
168 // //
170 
171 //---------------------------------------------------------
172 size_t CSG_String::Length(void) const
173 {
174  return( m_pString->Length() );
175 }
176 
177 //---------------------------------------------------------
178 bool CSG_String::is_Empty(void) const
179 {
180  return( m_pString->IsEmpty() );
181 }
182 
183 
185 // //
187 
188 //---------------------------------------------------------
190 {
191  if( i >= 0 && i < (int)Length() )
192  {
193  return( m_pString->GetChar(i) );
194  }
195 
196  return( SG_T('\0') );
197 }
198 
200 {
201  if( i < Length() )
202  {
203  return( m_pString->GetChar(i) );
204  }
205 
206  return( SG_T('\0') );
207 }
208 
210 {
211  if( i < Length() )
212  {
213  return( m_pString->GetChar(i) );
214  }
215 
216  return( SG_T('\0') );
217 }
218 
219 //---------------------------------------------------------
220 void CSG_String::Set_Char(size_t i, char Character)
221 {
222  m_pString->SetChar(i, Character);
223 }
224 
225 void CSG_String::Set_Char(size_t i, wchar_t Character)
226 {
227  m_pString->SetChar(i, Character);
228 }
229 
230 
232 // //
234 
235 //---------------------------------------------------------
236 const SG_Char * CSG_String::c_str(void) const
237 {
238  return( m_pString->c_str() );
239 }
240 
241 //---------------------------------------------------------
242 const char * CSG_String::b_str(void) const
243 {
244  return( *m_pString );
245 }
246 
247 //---------------------------------------------------------
248 const wchar_t * CSG_String::w_str(void) const
249 {
250  return( m_pString->wc_str() );
251 }
252 
253 
255 // //
257 
258 //---------------------------------------------------------
260 {
261  m_pString->Clear();
262 }
263 
264 
266 // //
268 
269 //---------------------------------------------------------
270 CSG_String CSG_String::Format(const char *Format, ...)
271 {
272  CSG_String s;
273 
274 #ifdef _SAGA_LINUX
275  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
276  va_list argptr; va_start(argptr, _Format);
277  s.m_pString->PrintfV(_Format, argptr);
278 #else
279  va_list argptr; va_start(argptr, Format);
280  s.m_pString->PrintfV(Format, argptr);
281 #endif
282 
283  va_end(argptr);
284 
285  return( s );
286 }
287 
288 //---------------------------------------------------------
289 CSG_String CSG_String::Format(const wchar_t *Format, ...)
290 {
291  CSG_String s;
292 
293 #ifdef _SAGA_LINUX
294  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
295  va_list argptr; va_start(argptr, _Format);
296  s.m_pString->PrintfV(_Format, argptr);
297 #else
298  va_list argptr; va_start(argptr, Format);
299  s.m_pString->PrintfV(Format, argptr);
300 #endif
301 
302  va_end(argptr);
303 
304  return( s );
305 }
306 
307 //---------------------------------------------------------
308 int CSG_String::Printf(const char *Format, ...)
309 {
310 #ifdef _SAGA_LINUX
311  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
312  va_list argptr; va_start(argptr, _Format);
313  int Result = m_pString->PrintfV(_Format, argptr);
314 #else
315  va_list argptr; va_start(argptr, Format);
316  int Result = m_pString->PrintfV(Format, argptr);
317 #endif
318 
319  va_end(argptr);
320 
321  return( Result );
322 }
323 
324 //---------------------------------------------------------
325 int CSG_String::Printf(const wchar_t *Format, ...)
326 {
327 #ifdef _SAGA_LINUX
328  wxString _Format(Format); _Format.Replace("%s", "%ls"); // workaround as we only use wide characters since wx 2.9.4 so interpret strings as multibyte
329  va_list argptr; va_start(argptr, _Format);
330  int Result = m_pString->PrintfV(_Format, argptr);
331 #else
332  va_list argptr; va_start(argptr, Format);
333  int Result = m_pString->PrintfV(Format, argptr);
334 #endif
335 
336  va_end(argptr);
337 
338  return( Result );
339 }
340 
341 
343 // //
345 
346 //---------------------------------------------------------
348 {
349  m_pString->Prepend(*String.m_pString);
350 
351  return( *this );
352 }
353 
354 //---------------------------------------------------------
356 {
357  m_pString->Append(*String.m_pString);
358 
359  return( *this );
360 }
361 
362 //---------------------------------------------------------
363 CSG_String & CSG_String::Append(const char *String)
364 {
365  m_pString->Append(String);
366 
367  return( *this );
368 }
369 
370 //---------------------------------------------------------
371 CSG_String & CSG_String::Append(const wchar_t *String)
372 {
373  m_pString->Append(String);
374 
375  return( *this );
376 }
377 
378 //---------------------------------------------------------
379 CSG_String & CSG_String::Append(char Character, size_t nRepeat)
380 {
381  m_pString->Append(Character, nRepeat);
382 
383  return( *this );
384 }
385 
386 //---------------------------------------------------------
387 CSG_String & CSG_String::Append(wchar_t Character, size_t nRepeat)
388 {
389  m_pString->Append(Character, nRepeat);
390 
391  return( *this );
392 }
393 
394 //---------------------------------------------------------
396 {
397  *m_pString += *String.m_pString;
398 }
399 
400 void CSG_String::operator += (const char *String)
401 {
402  *m_pString += String;
403 }
404 
405 void CSG_String::operator += (const wchar_t *String)
406 {
407  *m_pString += String;
408 }
409 
410 void CSG_String::operator += (char Character)
411 {
412  *m_pString += Character;
413 }
414 
415 void CSG_String::operator += (wchar_t Character)
416 {
417  *m_pString += Character;
418 }
419 
420 
422 // //
424 
425 //---------------------------------------------------------
427 {
428  CSG_String s(*this);
429 
430  s += String;
431 
432  return( s );
433 }
434 
435 CSG_String CSG_String::operator + (const char *String) const
436 {
437  CSG_String s(*this);
438 
439  s += String;
440 
441  return( s );
442 }
443 
444 CSG_String CSG_String::operator + (const wchar_t *String) const
445 {
446  CSG_String s(*this);
447 
448  s += String;
449 
450  return( s );
451 }
452 
453 //---------------------------------------------------------
454 CSG_String CSG_String::operator + (char Character) const
455 {
456  CSG_String s(*this);
457 
458  s += Character;
459 
460  return( s );
461 }
462 
463 CSG_String CSG_String::operator + (wchar_t Character) const
464 {
465  CSG_String s(*this);
466 
467  s += Character;
468 
469  return( s );
470 }
471 
472 //---------------------------------------------------------
473 CSG_String operator + (const char *A, const CSG_String &B)
474 {
475  CSG_String s(A);
476 
477  s += B;
478 
479  return( s );
480 }
481 
482 CSG_String operator + (const wchar_t *A, const CSG_String &B)
483 {
484  CSG_String s(A);
485 
486  s += B;
487 
488  return( s );
489 }
490 
492 {
493  CSG_String s(A);
494 
495  s += B;
496 
497  return( s );
498 }
499 
501 {
502  CSG_String s(A);
503 
504  s += B;
505 
506  return( s );
507 }
508 
509 
511 // //
513 
514 //---------------------------------------------------------
515 int CSG_String::Cmp(const CSG_String &String) const
516 {
517  return( m_pString->Cmp(String.c_str()) );
518 }
519 
520 //---------------------------------------------------------
521 int CSG_String::CmpNoCase(const CSG_String &String) const
522 {
523  return( m_pString->CmpNoCase(String.c_str()) );
524 }
525 
526 //---------------------------------------------------------
527 bool CSG_String::is_Same_As(const CSG_String &String, bool bCase) const
528 {
529  return( m_pString->IsSameAs(*String.m_pString, bCase) );
530 }
531 
532 bool CSG_String::is_Same_As(char Character, bool bCase) const
533 {
534  return( m_pString->IsSameAs(Character, bCase) );
535 }
536 
537 bool CSG_String::is_Same_As(wchar_t Character, bool bCase) const
538 {
539  return( m_pString->IsSameAs(Character, bCase) );
540 }
541 
542 //---------------------------------------------------------
544 {
545  m_pString->MakeLower();
546 
547  return( *this );
548 }
549 
550 //---------------------------------------------------------
552 {
553  m_pString->MakeUpper();
554 
555  return( *this );
556 }
557 
559 // //
561 
562 //---------------------------------------------------------
563 size_t CSG_String::Replace(const CSG_String &sOld, const CSG_String &sNew, bool bReplaceAll)
564 {
565  return( m_pString->Replace(*sOld.m_pString, *sNew.m_pString, bReplaceAll) );
566 }
567 
568 //---------------------------------------------------------
569 size_t CSG_String::Replace_Single_Char(SG_Char Old, SG_Char New, bool bReplaceAll)
570 {
571  size_t n = 0;
572 
573  for(size_t i=0; i<Length(); i++)
574  {
575  if( Get_Char(i) == Old )
576  {
577  if( (i < 1 || !isalnum(Get_Char(i - 1))) && (i >= Length() - 1 || !isalnum(Get_Char(i + 1))) )
578  {
579  Set_Char(i, New); n++;
580 
581  if( !bReplaceAll )
582  {
583  return( n );
584  }
585  }
586  }
587  }
588 
589  return( n );
590 }
591 
592 //---------------------------------------------------------
594 {
595  m_pString->Remove(pos);
596 
597  return( *this );
598 }
599 
600 //---------------------------------------------------------
601 CSG_String & CSG_String::Remove(size_t pos, size_t len)
602 {
603  m_pString->Remove(pos, len);
604 
605  return( *this );
606 }
607 
608 
610 // //
612 
613 //---------------------------------------------------------
614 int CSG_String::Trim(bool fromRight)
615 {
616  size_t n = m_pString->Length();
617 
618  m_pString->Trim(fromRight);
619 
620  return( (int)(n - m_pString->Length()) );
621 }
622 
623 //---------------------------------------------------------
625 {
626  size_t n = m_pString->Length();
627 
628  m_pString->Trim( true);
629  m_pString->Trim(false);
630 
631  return( (int)(n - m_pString->Length()) );
632 }
633 
634 
636 // //
638 
639 //---------------------------------------------------------
640 int CSG_String::Find(char Character, bool fromEnd) const
641 {
642  return( m_pString->Find(Character, fromEnd) );
643 }
644 
645 int CSG_String::Find(wchar_t Character, bool fromEnd) const
646 {
647  return( m_pString->Find(Character, fromEnd) );
648 }
649 
650 //---------------------------------------------------------
651 int CSG_String::Find(const CSG_String &String) const
652 {
653  return( m_pString->Find(*String.m_pString) );
654 }
655 
656 //---------------------------------------------------------
657 bool CSG_String::Contains(const CSG_String &String) const
658 {
659  return( m_pString->Contains(*String.m_pString) );
660 }
661 
662 
664 // //
666 
667 //---------------------------------------------------------
668 CSG_String CSG_String::AfterFirst(char Character) const
669 {
670  return( CSG_String(m_pString->AfterFirst(Character).c_str().AsWChar()) );
671 }
672 
673 CSG_String CSG_String::AfterFirst(wchar_t Character) const
674 {
675  return( CSG_String(m_pString->AfterFirst(Character).c_str().AsWChar()) );
676 }
677 
678 //---------------------------------------------------------
679 CSG_String CSG_String::AfterLast(char Character) const
680 {
681  return( CSG_String(m_pString->AfterLast(Character).c_str().AsWChar()) );
682 }
683 
684 CSG_String CSG_String::AfterLast(wchar_t Character) const
685 {
686  return( CSG_String(m_pString->AfterLast(Character).c_str().AsWChar()) );
687 }
688 
689 //---------------------------------------------------------
690 CSG_String CSG_String::BeforeFirst(char Character) const
691 {
692  return( CSG_String(m_pString->BeforeFirst(Character).c_str().AsWChar()) );
693 }
694 
695 CSG_String CSG_String::BeforeFirst(wchar_t Character) const
696 {
697  return( CSG_String(m_pString->BeforeFirst(Character).c_str().AsWChar()) );
698 }
699 
700 //---------------------------------------------------------
701 CSG_String CSG_String::BeforeLast(char Character) const
702 {
703  return( CSG_String(m_pString->BeforeLast(Character).c_str().AsWChar()) );
704 }
705 
706 CSG_String CSG_String::BeforeLast(wchar_t Character) const
707 {
708  return( CSG_String(m_pString->BeforeLast(Character).c_str().AsWChar()) );
709 }
710 
711 
713 // //
715 
716 //---------------------------------------------------------
717 CSG_String CSG_String::Right(size_t count) const
718 {
719  return( CSG_String(m_pString->Right(count).c_str().AsWChar()) );
720 }
721 
722 //---------------------------------------------------------
723 CSG_String CSG_String::Mid(size_t first, size_t count) const
724 {
725  return( CSG_String(m_pString->Mid(first, count <= 0 ? Length() : count).c_str().AsWChar()) );
726 }
727 
728 //---------------------------------------------------------
729 CSG_String CSG_String::Left(size_t count) const
730 {
731  return( CSG_String(m_pString->Left(count).c_str().AsWChar()) );
732 }
733 
734 
736 // //
738 
739 //---------------------------------------------------------
740 bool CSG_String::is_Number(void) const
741 {
742  return( m_pString->IsNumber() );
743 }
744 
745 //---------------------------------------------------------
746 int CSG_String::asInt(void) const
747 {
748  int Value; return( asInt(Value) ? Value : 0 );
749 }
750 
751 bool CSG_String::asInt(int &Value) const
752 {
753  const wxChar *start = m_pString->c_str(); wxChar *end;
754 
755  int value = wxStrtol(start, &end, 10);
756 
757  if( end > start )
758  {
759  Value = value;
760 
761  return( true );
762  }
763 
764  return( false );
765 }
766 
767 //---------------------------------------------------------
769 {
770  sLong Value; return( asLongLong(Value) ? Value : 0 );
771 }
772 
773 bool CSG_String::asLongLong(sLong &Value) const
774 {
775  if( m_pString->ToLongLong(&Value) )
776  {
777  return( true );
778  }
779 
780  return( false );
781 }
782 
783 //---------------------------------------------------------
784 double CSG_String::asDouble(void) const
785 {
786  double Value; return( asDouble(Value) ? Value : 0. );
787 }
788 
789 bool CSG_String::asDouble(double &Value) const
790 {
791  const wxChar *start = m_pString->c_str(); wxChar *end;
792 
793  double value = wxStrtod(start, &end);
794 
795  if( end > start )
796  {
797  Value = value;
798 
799  return( true );
800  }
801 
802  return( false );
803 }
804 
805 
807 // //
809 
810 //---------------------------------------------------------
811 CSG_String CSG_String::from_UTF8(const char *String, size_t Length)
812 {
813  CSG_String s;
814 
815  if( String )
816  {
817  if( !Length )
818  {
819  Length = strlen(String);
820  }
821 
822  *s.m_pString = wxString::FromUTF8(String, Length);
823  }
824 
825  return( s );
826 }
827 
828 //---------------------------------------------------------
836 //---------------------------------------------------------
837 size_t CSG_String::to_UTF8(char **pString) const
838 {
839  CSG_Buffer String(to_UTF8());
840 
841  if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
842  {
843  memcpy(*pString, String.Get_Data(), String.Get_Size());
844 
845  return( String.Get_Size() - 1 );
846  }
847 
848  *pString = NULL;
849 
850  return( 0 );
851 }
852 
853 //---------------------------------------------------------
855 {
856  CSG_Buffer String;
857 
858  const wxScopedCharBuffer Buffer = m_pString->utf8_str();
859 
860  String.Set_Data(Buffer.data(), Buffer.length() + 1);
861 
862  return( String );
863 }
864 
865 
867 // //
869 
870 //---------------------------------------------------------
878 //---------------------------------------------------------
879 size_t CSG_String::to_MBChar(char **pString, int Encoding) const
880 {
881  CSG_Buffer String(to_MBChar(Encoding));
882 
883  if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
884  {
885  memcpy(*pString, String.Get_Data(), String.Get_Size());
886 
887  return( String.Get_Size() - 1 );
888  }
889 
890  *pString = NULL;
891 
892  return( 0 );
893 }
894 
895 //---------------------------------------------------------
897 {
898  CSG_Buffer String;
899 
900  wxScopedCharBuffer Buffer;
901 
902  switch( Encoding ) // selecting the appropriate wxMBConv class
903  {
904  case SG_FILE_ENCODING_ANSI : Buffer = m_pString->mb_str(wxConvLibc ); break;
905  case SG_FILE_ENCODING_UTF7 : Buffer = m_pString->mb_str(wxConvUTF7 ); break;
906  case SG_FILE_ENCODING_UTF8 : Buffer = m_pString->mb_str(wxConvUTF8 ); break;
907  case SG_FILE_ENCODING_UTF16LE: Buffer = m_pString->mb_str(wxMBConvUTF16LE()); break;
908  case SG_FILE_ENCODING_UTF16BE: Buffer = m_pString->mb_str(wxMBConvUTF16BE()); break;
909  case SG_FILE_ENCODING_UTF32LE: Buffer = m_pString->mb_str(wxMBConvUTF32LE()); break;
910  case SG_FILE_ENCODING_UTF32BE: Buffer = m_pString->mb_str(wxMBConvUTF32BE()); break;
911  default : Buffer = m_pString->mb_str(wxConvAuto ()); break;
912  }
913 
914  String.Set_Data(Buffer.data(), Buffer.length() + 1);
915 
916  return( String );
917 }
918 
919 
921 // //
923 
924 //---------------------------------------------------------
932 //---------------------------------------------------------
933 bool CSG_String::to_ASCII(char **pString, char Replace) const
934 {
935  CSG_Buffer String(to_ASCII());
936 
937  if( String.Get_Size() > 1 && (*pString = (char *)SG_Malloc(String.Get_Size())) != NULL )
938  {
939  memcpy(*pString, String.Get_Data(), String.Get_Size());
940 
941  return( true );
942  }
943 
944  *pString = NULL;
945 
946  return( false );
947 }
948 
949 //---------------------------------------------------------
950 CSG_Buffer CSG_String::to_ASCII(char Replace) const
951 {
952  CSG_Buffer String;
953 
954  #if wxCHECK_VERSION(3, 1, 0)
955  const wxScopedCharBuffer Buffer = m_pString->ToAscii(Replace);
956  #else
957  const wxScopedCharBuffer Buffer = m_pString->ToAscii();
958  #endif
959 
960  String.Set_Data(Buffer.data(), Buffer.length() + 1);
961 
962  return( String );
963 }
964 
965 
967 // //
969 
970 //---------------------------------------------------------
977 //---------------------------------------------------------
978 std::string CSG_String::to_StdString(void) const
979 {
980  return( m_pString->ToStdString() );
981 }
982 
983 //---------------------------------------------------------
987 //---------------------------------------------------------
988 std::wstring CSG_String::to_StdWstring(void) const
989 {
990  return( m_pString->ToStdWstring() );
991 }
992 
993 
995 // //
996 // //
997 // //
999 
1000 //---------------------------------------------------------
1002 {}
1003 
1004 //---------------------------------------------------------
1006 {
1007  Create(Strings);
1008 }
1009 
1010 bool CSG_Strings::Create(const CSG_Strings &Strings)
1011 {
1012  Destroy();
1013 
1014  return( Add(Strings) );
1015 }
1016 
1017 //---------------------------------------------------------
1018 CSG_Strings::CSG_Strings(int nStrings, const SG_Char **Strings)
1019 {
1020  for(int i=0; i<nStrings; i++)
1021  {
1022  Add(Strings[i]);
1023  }
1024 }
1025 
1026 //---------------------------------------------------------
1028 {
1029  Clear();
1030 }
1031 
1032 //---------------------------------------------------------
1034 {
1035  for(size_t i=0; i<Get_Size(); i++)
1036  {
1037  delete((CSG_String *)m_Strings[i]);
1038  }
1039 
1040  m_Strings.Destroy();
1041 
1042  return( true );
1043 }
1044 
1045 //---------------------------------------------------------
1046 bool CSG_Strings::Add(const CSG_Strings &Strings)
1047 {
1048  for(size_t i=0; i<Strings.Get_Size(); i++)
1049  {
1050  Add(Strings[i]);
1051  }
1052 
1053  return( true );
1054 }
1055 
1056 //---------------------------------------------------------
1057 bool CSG_Strings::Add(const CSG_String &String)
1058 {
1059  size_t i = Get_Size();
1060 
1061  if( m_Strings.Inc_Array() )
1062  {
1063  m_Strings[i] = new CSG_String(String);
1064 
1065  return( true );
1066  }
1067 
1068  return( false );
1069 }
1070 
1071 //---------------------------------------------------------
1072 bool CSG_Strings::Ins(const CSG_String &String, size_t Index)
1073 {
1074  if( Index >= Get_Size() )
1075  {
1076  return( Add(String) );
1077  }
1078 
1079  if( m_Strings.Inc_Array() )
1080  {
1081  for(size_t i=Get_Size()-1; i>Index; i--)
1082  {
1083  m_Strings[i] = m_Strings[i - 1];
1084  }
1085 
1086  m_Strings[Index] = new CSG_String(String);
1087 
1088  return( true );
1089  }
1090 
1091  return( false );
1092 }
1093 
1094 //---------------------------------------------------------
1095 bool CSG_Strings::Del(size_t Index)
1096 {
1097  if( Index >= Get_Size() )
1098  {
1099  return( false );
1100  }
1101 
1102  delete((CSG_String *)m_Strings[Index]);
1103 
1104  for(size_t i=Index+1; i<Get_Size(); i++)
1105  {
1106  m_Strings[i - 1] = m_Strings[i];
1107  }
1108 
1109  m_Strings.Dec_Array();
1110 
1111  return( true );
1112 }
1113 
1114 //---------------------------------------------------------
1115 bool CSG_Strings::Set_Count(size_t Count)
1116 {
1117  while( Del(Count) ) {}
1118 
1119  for(size_t i=Get_Size(); i<Count; i++)
1120  {
1121  Add("");
1122  }
1123 
1124  return( true );
1125 }
1126 
1127 //---------------------------------------------------------
1128 class CSG_Index_Compare_Strings : public CSG_Index::CSG_Index_Compare
1129 {
1130 public:
1131  CSG_String **m_Values; bool m_Ascending;
1132 
1133  CSG_Index_Compare_Strings(CSG_String **Values, bool Ascending) : m_Values(Values), m_Ascending(Ascending) {}
1134 
1135  virtual int Compare (const sLong _a, const sLong _b)
1136  {
1137  sLong a = m_Ascending ? _a : _b;
1138  sLong b = m_Ascending ? _b : _a;
1139 
1140  return( m_Values[a]->Cmp(*m_Values[b]) );
1141  }
1142 };
1143 
1144 //---------------------------------------------------------
1145 bool CSG_Strings::Sort(bool Ascending)
1146 {
1147  if( Get_Size() < 2 )
1148  {
1149  return( true );
1150  }
1151 
1152  CSG_Index_Compare_Strings Compare((CSG_String **)m_Strings.Get_Array(), Ascending);
1153 
1154  CSG_Index Index(Get_Count(), Compare);
1155 
1156  CSG_Array_Pointer Strings(m_Strings);
1157 
1158  for(size_t i=0; i<Get_Size(); i++)
1159  {
1160  m_Strings[i] = Strings[Index[i]];
1161  }
1162 
1163  return( true );
1164 }
1165 
1166 
1168 // //
1169 // //
1170 // //
1172 
1173 //---------------------------------------------------------
1174 bool SG_is_Character_Numeric(int Character)
1175 {
1176  switch( Character )
1177  {
1178  case '0':
1179  case '1':
1180  case '2':
1181  case '3':
1182  case '4':
1183  case '5':
1184  case '6':
1185  case '7':
1186  case '8':
1187  case '9':
1188  case '-':
1189  case '+':
1190  case '.':
1191  case ',':
1192  case 'e':
1193  case 'E':
1194  return( true );
1195  }
1196 
1197  return( false );
1198 }
1199 
1200 
1202 // //
1203 // //
1204 // //
1206 
1207 //---------------------------------------------------------
1209 {
1210  CSG_String s; wxDateTime t; t.SetToCurrent();
1211 
1212  if( bWithDate )
1213  {
1214  s += t.FormatISODate().wc_str(); s += "/";
1215  }
1216 
1217  s += t.FormatISOTime().wc_str();
1218 
1219  return( s );
1220 }
1221 
1222 
1224 // //
1225 // //
1226 // //
1228 
1229 //---------------------------------------------------------
1231 {
1232  int deg, min; double sec; char sig = Value < 0. ? '-' : '+';
1233 
1234  if( Value < 0. )
1235  {
1236  Value = -Value;
1237  }
1238 
1239  Value = fmod(Value, 360.);
1240  deg = (int)Value;
1241  Value = 60. * (Value - deg);
1242  min = (int)Value;
1243  Value = 60. * (Value - min);
1244  sec = Value;
1245 
1246  return( CSG_String::Format(SG_T("%c%03d\xb0%02d'%02.*f''"), sig, deg, min, SG_Get_Significant_Decimals(sec), sec) );
1247 }
1248 
1249 //---------------------------------------------------------
1250 double SG_Degree_To_Double(const CSG_String &String)
1251 {
1252  double sig = 1., deg = 0., min = 0., sec = 0.;
1253 
1254  if( String.BeforeFirst(SG_T('\xb0')).asDouble(deg) )
1255  {
1256  if( deg < 0. )
1257  {
1258  sig = -1.; deg = -deg;
1259  }
1260 
1261  String.AfterFirst(SG_T('\xb0')).asDouble(min);
1262  String.AfterFirst(SG_T('\'' )).asDouble(sec);
1263  }
1264  else
1265  {
1266  String.asDouble(deg);
1267  }
1268 
1269  return( sig * (deg + min / 60. + sec / 3600.) );
1270 }
1271 
1272 
1274 // //
1275 // //
1276 // //
1278 
1279 //---------------------------------------------------------
1280 int SG_Get_Significant_Decimals(double Value, int maxDecimals)
1281 {
1282  int decimals;
1283 
1284  Value = fabs(Value);
1285 
1286  for(decimals=0; decimals<maxDecimals; decimals++)
1287  {
1288  double Remainder = Value - floor(Value);
1289 
1290  if( Remainder == 0. )
1291  {
1292  return( decimals );
1293  }
1294 
1295  Value *= 10.;
1296  }
1297 
1298  return( maxDecimals );
1299 }
1300 
1301 
1303 // //
1304 // //
1305 // //
1307 
1308 //---------------------------------------------------------
1310 {
1311  for(size_t i=0; i<String.Length(); i++)
1312  {
1313  switch( String[i] )
1314  {
1315  case SG_T('.'): String.Set_Char(i, ','); break;
1316  case SG_T(','): String.Set_Char(i, '.'); break;
1317  }
1318  }
1319 }
1320 
1321 
1323 // //
1324 // //
1325 // //
1327 
1328 //---------------------------------------------------------
1341 //---------------------------------------------------------
1342 CSG_String SG_Get_String(double Value, int Precision)
1343 {
1344  CSG_String s;
1345 
1346  if ( Precision == -99 )
1347  {
1348  s.Printf("%f", Value);
1349  }
1350  else if( Precision == -98 )
1351  {
1352  s.Printf("%e", Value);
1353  }
1354  else if( Precision == 0 )
1355  {
1356  s.Printf("%d", (int)Value);
1357  }
1358  else if( Precision > 0 )
1359  {
1360  s.Printf("%.*f", Precision, Value);
1361  }
1362  else // if( Precision < 0 )
1363  {
1364  Precision = SG_Get_Significant_Decimals(Value, abs(Precision));
1365 
1366  if( Precision == 0 )
1367  {
1368  s.Printf("%.0f", Value);
1369  }
1370  else // if( Precision > 0 )
1371  {
1372  s.Printf("%.*f", Precision, Value);
1373 
1374  while( s.Length() > 1 && s[s.Length() - 1] == '0' )
1375  {
1376  s = s.Left(s.Length() - 1);
1377  }
1378 
1379  if( s.Length() > 1 && (s[s.Length() - 1] == '.' || s[s.Length() - 1] == ',') )
1380  {
1381  s = s.Left(s.Length() - 1);
1382  }
1383  }
1384  }
1385 
1386  s.Replace(",", ".");
1387 
1388  return( s );
1389 }
1390 
1391 //---------------------------------------------------------
1392 CSG_String SG_Get_String(int Value, int Precision)
1393 {
1394  if( Precision > 0 )
1395  {
1396  return( SG_Get_String((double)Value, Precision) );
1397  }
1398 
1399  if( Precision < 0 )
1400  {
1401  return( CSG_String::Format("%0*d", Precision, Value) );
1402  }
1403 
1404  return( CSG_String::Format("%d", Value) );
1405 }
1406 
1407 
1409 // //
1411 
1412 //---------------------------------------------------------
1414 {
1415  const CSG_String Tags[][3] =
1416  {
1417  { "table", "\n============\n", "============\n" },
1418  { "tr" , "" , "\n" },
1419  { "th" , "" , "\t" },
1420  { "td" , "" , "\t" },
1421  { "a" , "" , "" },
1422  { "b" , "[" , "]" },
1423  { "i" , "'" , "'" },
1424  { "br" , "\n" , "" },
1425  { "p" , "" , "\n" },
1426  { "hr" , "\n____________\n", "\n" },
1427  { "h1" , "\n############\n", "\n" },
1428  { "h2" , "\n============\n", "\n" },
1429  { "h3" , "\n------------\n", "\n" },
1430  { "h4" , "\n" , "\n" },
1431  { "ol" , "\n" , "\n" },
1432  { "ul" , "\n" , "\n" },
1433  { "li" , "(-) " , "\n" },
1434  { "", "", "" }
1435  };
1436 
1437  CSG_String _Text(Text);
1438 
1439  for(int i=0, n; !Tags[i][0].is_Empty(); i++)
1440  {
1441  _Text.Replace("<" + Tags[i][0] + ">", Tags[i][1]);
1442 
1443  while( (n = _Text.Find("<" + Tags[i][0])) >= 0 )
1444  {
1445  CSG_String Left(_Text.Left(n)), Right(_Text.Right(_Text.Length() - (n + 1 + Tags[i][0].Length())));
1446 
1447  if( Tags[i][0].Cmp("a") == 0 && (n = Right.BeforeFirst('>').Find("href=\"")) >= 0 )
1448  {
1449  CSG_String href(Right.Right(Right.Length() - n).BeforeFirst('>').AfterFirst('\"').BeforeFirst('\"'));
1450 
1451  if( !href.is_Empty() && (n = Right.Find("</a>")) >= 0 )
1452  {
1453  CSG_String text(Right.Left(n).AfterFirst('>'));
1454 
1455  if( !text.is_Empty() )
1456  {
1457  _Text = Left + "[" + text + "](" + href + ")" + Right.Right(Right.Length() - n);
1458 
1459  continue;
1460  }
1461  }
1462  }
1463 
1464  _Text = Left + Tags[i][1] + Right.AfterFirst('>');
1465  }
1466 
1467  _Text.Replace("</" + Tags[i][0] + ">", Tags[i][2]);
1468  }
1469 
1470  return( _Text );
1471 }
1472 
1473 
1475 // //
1476 // //
1477 // //
1479 
1480 //---------------------------------------------------------
1482 {
1483  m_pTokenizer = new wxStringTokenizer();
1484 }
1485 
1486 //---------------------------------------------------------
1488 {
1489  m_pTokenizer = new wxStringTokenizer();
1490 
1491  Set_String(String, Delimiters, Mode);
1492 }
1493 
1494 //---------------------------------------------------------
1496 {
1497  delete(m_pTokenizer);
1498 }
1499 
1500 //---------------------------------------------------------
1502 {
1503  return( m_pTokenizer->CountTokens() );
1504 }
1505 
1506 //---------------------------------------------------------
1508 {
1509  return( m_pTokenizer->GetLastDelimiter() );
1510 }
1511 
1512 //---------------------------------------------------------
1514 {
1515  wxString s(m_pTokenizer->GetNextToken());
1516 
1517  return( &s );
1518 }
1519 
1520 //---------------------------------------------------------
1522 {
1523  return( m_pTokenizer->GetPosition() );
1524 }
1525 
1526 //---------------------------------------------------------
1528 {
1529  wxString s(m_pTokenizer->GetString());
1530 
1531  return( &s );
1532 }
1533 
1534 //---------------------------------------------------------
1536 {
1537  return( m_pTokenizer->HasMoreTokens() );
1538 }
1539 
1540 //---------------------------------------------------------
1542 {
1543  wxStringTokenizerMode _Mode;
1544 
1545  switch( Mode )
1546  {
1547  default: _Mode = wxTOKEN_DEFAULT ; break;
1548  case SG_TOKEN_INVALID: _Mode = wxTOKEN_INVALID ; break;
1549  case SG_TOKEN_RET_EMPTY: _Mode = wxTOKEN_RET_EMPTY ; break;
1550  case SG_TOKEN_RET_EMPTY_ALL: _Mode = wxTOKEN_RET_EMPTY_ALL; break;
1551  case SG_TOKEN_RET_DELIMS: _Mode = wxTOKEN_RET_DELIMS ; break;
1552  case SG_TOKEN_STRTOK: _Mode = wxTOKEN_STRTOK ; break;
1553  }
1554 
1555  m_pTokenizer->SetString(String.c_str(), Delimiters.c_str(), _Mode);
1556 }
1557 
1558 
1560 // //
1562 
1563 //---------------------------------------------------------
1565 {
1566  CSG_Strings Strings;
1567 
1568  CSG_String_Tokenizer Tokenizer(String, Delimiters, Mode);
1569 
1570  while( Tokenizer.Has_More_Tokens() )
1571  {
1572  Strings += Tokenizer.Get_Next_Token();
1573  }
1574 
1575  return( Strings );
1576 }
1577 
1578 
1580 // //
1581 // //
1582 // //
1584 
1585 //---------------------------------------------------------
CSG_Index
Definition: mat_tools.h:200
CSG_String::BeforeFirst
CSG_String BeforeFirst(char Character) const
Definition: api_string.cpp:690
SG_TOKEN_INVALID
@ SG_TOKEN_INVALID
Definition: api_core.h:750
CSG_String_Tokenizer::Get_Tokens_Count
size_t Get_Tokens_Count(void) const
Definition: api_string.cpp:1501
SG_T
#define SG_T(s)
Definition: api_core.h:537
CSG_String::Printf
int Printf(const char *Format,...)
Definition: api_string.cpp:308
CSG_String_Tokenizer::Has_More_Tokens
bool Has_More_Tokens(void) const
Definition: api_string.cpp:1535
CSG_String_Tokenizer::Get_String
CSG_String Get_String(void) const
Definition: api_string.cpp:1527
CSG_String::Append
CSG_String & Append(const CSG_String &String)
Definition: api_string.cpp:355
CSG_String::Make_Lower
CSG_String & Make_Lower(void)
Definition: api_string.cpp:543
CSG_String::to_ASCII
bool to_ASCII(char **pString, char Replace='_') const
Definition: api_string.cpp:933
SG_Flip_Decimal_Separators
void SG_Flip_Decimal_Separators(CSG_String &String)
Definition: api_string.cpp:1309
CSG_String::w_str
const wchar_t * w_str(void) const
Definition: api_string.cpp:248
CSG_String::is_Number
bool is_Number(void) const
Definition: api_string.cpp:740
CSG_String::Length
size_t Length(void) const
Definition: api_string.cpp:172
SG_Get_CurrentTimeStr
CSG_String SG_Get_CurrentTimeStr(bool bWithDate)
Definition: api_string.cpp:1208
CSG_String::b_str
const char * b_str(void) const
Definition: api_string.cpp:242
CSG_Strings::Del
bool Del(int Index)
Definition: api_core.h:720
SG_Double_To_Degree
CSG_String SG_Double_To_Degree(double Value)
Definition: api_string.cpp:1230
CSG_String::~CSG_String
virtual ~CSG_String(void)
Definition: api_string.cpp:120
CSG_String::Remove
CSG_String & Remove(size_t pos)
Definition: api_string.cpp:593
SG_TOKEN_RET_EMPTY_ALL
@ SG_TOKEN_RET_EMPTY_ALL
Definition: api_core.h:753
A
#define A
CSG_String::Mid
CSG_String Mid(size_t first, size_t count=0) const
Definition: api_string.cpp:723
CSG_Index::CSG_Index_Compare
Definition: mat_tools.h:203
CSG_String::asInt
int asInt(void) const
Definition: api_string.cpp:746
CSG_String::operator+
CSG_String operator+(const CSG_String &String) const
Definition: api_string.cpp:426
SG_Malloc
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
Definition: api_memory.cpp:65
CSG_Strings::Ins
bool Ins(const CSG_String &String, int Index)
Definition: api_core.h:718
CSG_String::from_UTF8
static CSG_String from_UTF8(const char *String, size_t Length=0)
Definition: api_string.cpp:811
CSG_String::is_Same_As
bool is_Same_As(const CSG_String &String, bool bCase=true) const
Definition: api_string.cpp:527
CSG_Index::CSG_Index_Compare::Compare
virtual int Compare(const sLong a, const sLong b)=0
CSG_String::Make_Upper
CSG_String & Make_Upper(void)
Definition: api_string.cpp:551
SG_FILE_ENCODING_UTF32BE
@ SG_FILE_ENCODING_UTF32BE
Definition: api_core.h:556
CSG_String::Get_Char
SG_Char Get_Char(size_t i) const
Definition: api_string.cpp:209
api_core.h
CSG_String::CSG_String
CSG_String(void)
Definition: api_string.cpp:73
CSG_String::Prepend
CSG_String & Prepend(const CSG_String &String)
Definition: api_string.cpp:347
SG_String_Tokenize
CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters, TSG_String_Tokenizer_Mode Mode)
Definition: api_string.cpp:1564
CSG_Strings::Create
bool Create(const CSG_Strings &Strings)
Definition: api_string.cpp:1010
CSG_String::Create
bool Create(const class wxString *pString)
Definition: api_string.cpp:109
CSG_Array_Pointer::Inc_Array
bool Inc_Array(sLong nValues=1)
Definition: api_core.h:388
CSG_String::Cmp
int Cmp(const CSG_String &String) const
Definition: api_string.cpp:515
SG_FILE_ENCODING_UTF7
@ SG_FILE_ENCODING_UTF7
Definition: api_core.h:551
CSG_String::to_UTF8
CSG_Buffer to_UTF8(void) const
Definition: api_string.cpp:854
CSG_String::BeforeLast
CSG_String BeforeLast(char Character) const
Definition: api_string.cpp:701
mat_tools.h
CSG_Strings::Clear
void Clear(void)
Definition: api_core.h:735
CSG_Buffer
Definition: api_core.h:224
CSG_String::operator[]
SG_Char operator[](int i) const
Definition: api_string.cpp:189
CSG_String::Trim
int Trim(bool fromRight=false)
Definition: api_string.cpp:614
CSG_String::to_StdString
std::string to_StdString(void) const
Definition: api_string.cpp:978
CSG_Strings::Add
bool Add(const CSG_Strings &Strings)
Definition: api_string.cpp:1046
CSG_Strings::m_Strings
CSG_Array_Pointer m_Strings
Definition: api_core.h:741
CSG_Strings::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:714
SG_TOKEN_RET_EMPTY
@ SG_TOKEN_RET_EMPTY
Definition: api_core.h:752
operator+
CSG_String operator+(const char *A, const CSG_String &B)
Definition: api_string.cpp:473
sLong
signed long long sLong
Definition: api_core.h:158
CSG_Array_Pointer::Dec_Array
bool Dec_Array(bool bShrink=true)
Definition: api_core.h:389
SG_FILE_ENCODING_UTF32LE
@ SG_FILE_ENCODING_UTF32LE
Definition: api_core.h:555
SG_HTML_Tag_Replacer
CSG_String SG_HTML_Tag_Replacer(const CSG_String &Text)
Definition: api_string.cpp:1413
CSG_Buffer::Get_Size
size_t Get_Size(void) const
Definition: api_core.h:241
CSG_String::Trim_Both
int Trim_Both(void)
Definition: api_string.cpp:624
CSG_Strings::Destroy
bool Destroy(void)
Definition: api_string.cpp:1033
CSG_String::to_StdWstring
std::wstring to_StdWstring(void) const
Definition: api_string.cpp:988
CSG_Strings::~CSG_Strings
virtual ~CSG_Strings(void)
Definition: api_string.cpp:1027
CSG_Strings
Definition: api_core.h:700
CSG_String::Replace
size_t Replace(const CSG_String &Old, const CSG_String &New, bool bReplaceAll=true)
Definition: api_string.cpp:563
CSG_Strings::Set_Count
bool Set_Count(int Count)
Definition: api_core.h:711
CSG_Buffer::Get_Data
char * Get_Data(int Offset=0) const
Definition: api_core.h:244
CSG_String::operator=
CSG_String & operator=(const CSG_String &String)
Definition: api_string.cpp:131
CSG_String::Format
static CSG_String Format(const char *Format,...)
Definition: api_string.cpp:270
CSG_String::to_MBChar
size_t to_MBChar(char **pString, int Encoding) const
Definition: api_string.cpp:879
CSG_String::Find
int Find(char Character, bool fromEnd=false) const
Definition: api_string.cpp:640
SG_FILE_ENCODING_UTF16LE
@ SG_FILE_ENCODING_UTF16LE
Definition: api_core.h:553
CSG_String_Tokenizer::CSG_String_Tokenizer
CSG_String_Tokenizer(void)
Definition: api_string.cpp:1481
CSG_Buffer::Set_Data
bool Set_Data(const char *Data, size_t Size, bool bShrink=true)
Definition: api_memory.cpp:755
SG_is_Character_Numeric
bool SG_is_Character_Numeric(int Character)
Definition: api_string.cpp:1174
CSG_String::Left
CSG_String Left(size_t count) const
Definition: api_string.cpp:729
CSG_String::CmpNoCase
int CmpNoCase(const CSG_String &String) const
Definition: api_string.cpp:521
CSG_String::AfterFirst
CSG_String AfterFirst(char Character) const
Definition: api_string.cpp:668
CSG_String::Clear
void Clear(void)
Definition: api_string.cpp:259
CSG_String::operator+=
void operator+=(const CSG_String &String)
Definition: api_string.cpp:395
SG_TOKEN_STRTOK
@ SG_TOKEN_STRTOK
Definition: api_core.h:755
CSG_Array_Pointer::Destroy
void Destroy(void)
Definition: api_core.h:376
SG_Char
#define SG_Char
Definition: api_core.h:536
CSG_String_Tokenizer::~CSG_String_Tokenizer
~CSG_String_Tokenizer(void)
Definition: api_string.cpp:1495
CSG_String::Contains
bool Contains(const CSG_String &String) const
Definition: api_string.cpp:657
B
#define B
CSG_String
Definition: api_core.h:563
CSG_Array_Pointer
Definition: api_core.h:368
CSG_String::Set_Char
void Set_Char(size_t i, char Character)
Definition: api_string.cpp:220
CSG_String_Tokenizer::Get_Last_Delimiter
SG_Char Get_Last_Delimiter(void) const
Definition: api_string.cpp:1507
SG_Get_Significant_Decimals
int SG_Get_Significant_Decimals(double Value, int maxDecimals)
Definition: api_string.cpp:1280
CSG_String_Tokenizer::Set_String
void Set_String(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
Definition: api_string.cpp:1541
CSG_Strings::Sort
bool Sort(bool Ascending=true)
Definition: api_string.cpp:1145
SG_Degree_To_Double
double SG_Degree_To_Double(const CSG_String &String)
Definition: api_string.cpp:1250
CSG_String::Replace_Single_Char
size_t Replace_Single_Char(SG_Char Old, SG_Char New, bool bReplaceAll=true)
Definition: api_string.cpp:569
CSG_String::is_Empty
bool is_Empty(void) const
Definition: api_string.cpp:178
SG_FILE_ENCODING_UTF16BE
@ SG_FILE_ENCODING_UTF16BE
Definition: api_core.h:554
CSG_String::asLongLong
sLong asLongLong(void) const
Definition: api_string.cpp:768
SG_TOKEN_RET_DELIMS
@ SG_TOKEN_RET_DELIMS
Definition: api_core.h:754
TSG_String_Tokenizer_Mode
TSG_String_Tokenizer_Mode
Definition: api_core.h:749
CSG_Array_Pointer::Get_Array
void ** Get_Array(void) const
Definition: api_core.h:384
CSG_String::AfterLast
CSG_String AfterLast(char Character) const
Definition: api_string.cpp:679
CSG_String::m_pString
class wxString * m_pString
Definition: api_core.h:688
CSG_String::asDouble
double asDouble(void) const
Definition: api_string.cpp:784
CSG_String::c_str
const SG_Char * c_str(void) const
Definition: api_string.cpp:236
CSG_Strings::Get_Count
int Get_Count(void) const
Definition: api_core.h:713
CSG_String_Tokenizer::Get_Position
size_t Get_Position(void) const
Definition: api_string.cpp:1521
SG_Get_String
CSG_String SG_Get_String(double Value, int Precision)
Definition: api_string.cpp:1342
CSG_String_Tokenizer
Definition: api_core.h:761
SG_FILE_ENCODING_ANSI
@ SG_FILE_ENCODING_ANSI
Definition: api_core.h:550
SG_FILE_ENCODING_UTF8
@ SG_FILE_ENCODING_UTF8
Definition: api_core.h:552
CSG_String_Tokenizer::Get_Next_Token
CSG_String Get_Next_Token(void)
Definition: api_string.cpp:1513
CSG_String::Right
CSG_String Right(size_t count) const
Definition: api_string.cpp:717
CSG_Strings::CSG_Strings
CSG_Strings(void)
Definition: api_string.cpp:1001