SAGA API Version 9.13
Loading...
Searching...
No Matches
api_core.h
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_core.h //
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#ifndef HEADER_INCLUDED__SAGA_API__api_core_H
54#define HEADER_INCLUDED__SAGA_API__api_core_H
55
56
58// //
59// //
60// //
62
63//---------------------------------------------------------
73
74
76// //
77// //
78// //
80
81//---------------------------------------------------------
82#ifdef _SAGA_MSW
83 #define _SAGA_DLL_EXPORT __declspec( dllexport )
84 #define _SAGA_DLL_IMPORT __declspec( dllimport )
85#else
86 #define _SAGA_DLL_EXPORT
87 #define _SAGA_DLL_IMPORT
88#endif
89
90//---------------------------------------------------------
91#ifdef _SAGA_API_EXPORTS
92 #define SAGA_API_DLL_EXPORT _SAGA_DLL_EXPORT
93#else
94 #define SAGA_API_DLL_EXPORT _SAGA_DLL_IMPORT
95#endif
96
97
99// //
100// //
101// //
103
104//---------------------------------------------------------
105#ifndef SWIG
106
107#include <math.h>
108#include <memory.h>
109#include <stdlib.h>
110#include <stdio.h>
111#include <string.h>
112#include <wchar.h>
113#include <string>
114
115#endif // #ifdef SWIG
116
117
119// //
120// //
121// //
123
124//---------------------------------------------------------
125// this is defined by configure, but will not be on a normal application build
126
127#ifndef SIZEOF_LONG
128 #if defined(__alpha) || defined(__sparcv9) || defined(__LP64__) || (defined(__HOS_AIX__) && defined(_LP64))
129 #define SIZEOF_LONG 8
130 #else
131 #define SIZEOF_LONG 4
132 #endif
133#endif
134
135//---------------------------------------------------------
136#ifdef _TYPEDEF_BOOL
137 typedef unsigned int bool;
138 #define true ((bool)1)
139 #define false ((bool)0)
140#endif // _TYPEDEF_BOOL
141
142//---------------------------------------------------------
143#ifdef _TYPEDEF_BYTE
144 typedef unsigned char BYTE;
145#endif // _TYPEDEF_BYTE
146
147//---------------------------------------------------------
148#ifdef _TYPEDEF_WORD
149 typedef unsigned short WORD;
150 #if SIZEOF_LONG == 4
151 typedef unsigned long DWORD;
152 #else
153 typedef unsigned int DWORD;
154 #endif
155#endif // _TYPEDEF_WORD
156
157//---------------------------------------------------------
158typedef signed long long sLong;
159typedef unsigned long long uLong;
160
161//---------------------------------------------------------
162#if defined(_SAGA_MSW)
163 #include <float.h>
164 #define SG_is_NaN _isnan
165#elif defined(isnan)
166 #define SG_is_NaN isnan
167#else
168 #define SG_is_NaN(x) (x != x)
169#endif
170
171
173// //
174// Parallelization //
175// //
177
178//---------------------------------------------------------
183
184
186// //
187// Memory //
188// //
190
191//---------------------------------------------------------
192#define SG_GET_LONG(b0, b1, b2, b3) ((long) (((BYTE)(b0) | ((WORD)(b1) << 8)) | (((DWORD)(BYTE)(b2)) << 16) | (((DWORD)(BYTE)(b3)) << 24)))
193
194#define SG_GET_BYTE_0(vLong) ((BYTE) ((vLong) ))
195#define SG_GET_BYTE_1(vLong) ((BYTE) ((vLong) >> 8))
196#define SG_GET_BYTE_2(vLong) ((BYTE) ((vLong) >> 16))
197#define SG_GET_BYTE_3(vLong) ((BYTE) ((vLong) >> 24))
198
199//---------------------------------------------------------
200SAGA_API_DLL_EXPORT void * SG_Malloc (size_t size);
201SAGA_API_DLL_EXPORT void * SG_Calloc (size_t num, size_t size);
202SAGA_API_DLL_EXPORT void * SG_Realloc (void *memblock, size_t size);
203SAGA_API_DLL_EXPORT void SG_Free (void *memblock);
204
205#define SG_FREE_SAFE(PTR) { if( PTR ) { SG_Free (PTR); PTR = NULL; } }
206#define SG_DELETE_SAFE(PTR) { if( PTR ) { delete (PTR); PTR = NULL; } }
207#define SG_DELETE_ARRAY(PTR) { if( PTR ) { delete[](PTR); PTR = NULL; } }
208
209//---------------------------------------------------------
210SAGA_API_DLL_EXPORT void SG_Swap_Bytes (void *Buffer, int nBytes);
211
212SAGA_API_DLL_EXPORT int SG_Mem_Get_Int (const char *Buffer , bool bSwapBytes);
213SAGA_API_DLL_EXPORT void SG_Mem_Set_Int (char *Buffer, int Value , bool bSwapBytes);
214SAGA_API_DLL_EXPORT double SG_Mem_Get_Double (const char *Buffer , bool bSwapBytes);
215SAGA_API_DLL_EXPORT void SG_Mem_Set_Double (char *Buffer, double Value, bool bSwapBytes);
216
217
219// //
221
222//---------------------------------------------------------
224{
225public:
226
227 CSG_Buffer (void);
228 bool Create (void);
229
230 CSG_Buffer (const CSG_Buffer &Buffer);
231 bool Create (const CSG_Buffer &Buffer);
232
233 CSG_Buffer (size_t Size);
234 bool Create (size_t Size);
235
236 virtual ~CSG_Buffer (void);
237 void Destroy (void);
238
239 bool Set_Size (size_t Size, bool bShrink = true);
240 bool Inc_Size (size_t Size) { return( Set_Size(m_Size + Size) ); }
241 size_t Get_Size (void) const { return( m_Size ); }
242
243 bool Set_Data (const char *Data, size_t Size, bool bShrink = true);
244 char * Get_Data (int Offset = 0) const { return( m_Data + Offset ); }
245
246 CSG_Buffer & operator = (const CSG_Buffer &Buffer) { Create(Buffer); return( *this ); }
247 char & operator [] (int Position) { return( m_Data[Position] ); }
248 char operator [] (int Position) const { return( m_Data[Position] ); }
249
250 void Add_Value (char Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
251 void Add_Value (short Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
252 void Add_Value (int Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
253 void Add_Value (float Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
254 void Add_Value (double Value, bool bBigEndian = false) { if( Inc_Size(sizeof(Value)) ) Set_Value((int)m_Size - sizeof(Value), Value, bBigEndian); }
255
256 CSG_Buffer & operator += (char Value) { Add_Value(Value); return( *this ); }
257 CSG_Buffer & operator += (short Value) { Add_Value(Value); return( *this ); }
258 CSG_Buffer & operator += (int Value) { Add_Value(Value); return( *this ); }
259 CSG_Buffer & operator += (float Value) { Add_Value(Value); return( *this ); }
260 CSG_Buffer & operator += (double Value) { Add_Value(Value); return( *this ); }
261
262 void Set_Value (int Offset, char Value, bool bBigEndian = false) { m_Data[Offset] = Value; }
263 void Set_Value (int Offset, short Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(short *)(m_Data + Offset) = Value; }
264 void Set_Value (int Offset, int Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(int *)(m_Data + Offset) = Value; }
265 void Set_Value (int Offset, float Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(float *)(m_Data + Offset) = Value; }
266 void Set_Value (int Offset, double Value, bool bBigEndian = false) { if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); *(double *)(m_Data + Offset) = Value; }
267
268 short asShort (int Offset, bool bBigEndian = false) const { short Value = *(short *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
269 int asInt (int Offset, bool bBigEndian = false) const { int Value = *(int *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
270 float asFloat (int Offset, bool bBigEndian = false) const { float Value = *(float *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
271 double asDouble (int Offset, bool bBigEndian = false) const { double Value = *(double *)(m_Data + Offset); if( bBigEndian ) SG_Swap_Bytes(&Value, sizeof(Value)); return( Value ); }
272
273
274private:
275
276 char *m_Data;
277
278 size_t m_Size;
279
280};
281
282
284// //
285// //
286// //
288
289//---------------------------------------------------------
305
306//---------------------------------------------------------
308{
309public:
310 CSG_Array(void);
311 ~CSG_Array(void);
312
313 CSG_Array (const CSG_Array &Array);
314 void * Create (const CSG_Array &Array);
315
316 CSG_Array (size_t Value_Size, sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
317 void * Create (size_t Value_Size, sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
318
319 bool Destroy (void);
320
321 CSG_Array & operator = (const CSG_Array &Array) { Create(Array); return( *this ); }
322
323 bool Set_Growth (TSG_Array_Growth Growth);
324 TSG_Array_Growth Get_Growth (void) const { return( m_Growth ); }
325
326 size_t Get_Value_Size (void) const { return( m_Value_Size ); }
327 sLong Get_Size (void) const { return( m_nValues ); }
328 size_t Get_uSize (void) const { return( (size_t)m_nValues ); }
329
331 void * Get_Entry (sLong Index) const { return( Index >= 0 && Index < m_nValues ? (char *)m_Values + Index * m_Value_Size : NULL ); }
332 void * operator [] (sLong Index) const { return( Get_Entry(Index) ); }
333
334 bool Del_Entry (sLong Index, bool bShrink = true);
335
336 void * Get_Array (void) const { return( m_Values ); }
337 void * Get_Array (sLong nValues) { Set_Array(nValues); return( m_Values ); }
338
339 bool Set_Array (sLong nValues, bool bShrink = true);
340 bool Set_Array (sLong nValues, void **pArray, bool bShrink = true);
341
342 bool Inc_Array (sLong nValues = 1);
343 bool Inc_Array (void **pArray);
344
345 bool Dec_Array (bool bShrink = true);
346 bool Dec_Array (void **pArray, bool bShrink = true);
347
348
349private:
350
351 TSG_Array_Growth m_Growth;
352
353 size_t m_Value_Size;
354
355 sLong m_nValues, m_nBuffer;
356
357 void *m_Values;
358
359};
360
361
363// //
365
366//---------------------------------------------------------
368{
369public:
370 CSG_Array_Pointer (const CSG_Array_Pointer &Array) { Create(Array); }
371 void ** Create (const CSG_Array_Pointer &Array);
372
374 void ** Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
375
376 void Destroy (void) { m_Array.Destroy(); }
377
378 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
379 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
380
381 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
382 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
383
384 void ** Get_Array (void) const { return( (void **)m_Array.Get_Array() ); }
385 void ** Get_Array (sLong nValues) { return( (void **)m_Array.Get_Array(nValues) ); }
386
387 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
388 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
389 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
390
391 bool Add (void *Value);
392 bool Add (const CSG_Array_Pointer &Array);
393 bool Set (sLong Index, void *Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((void **)m_Array.Get_Entry(Index)) = Value; return( true ); }
394#ifndef SWIG
395 void *& Get (sLong Index) { return( *((void **)m_Array.Get_Entry(Index)) ); }
396#endif
397 void * Get (sLong Index) const { return( *((void **)m_Array.Get_Entry(Index)) ); }
398 bool Del (sLong Index);
399 sLong Del (void *Value);
400
401 CSG_Array_Pointer & operator = (const CSG_Array_Pointer &Array) { Create(Array); return( *this ); }
402
403 void *& operator [] (sLong Index) { return( Get(Index) ); }
404 void * operator [] (sLong Index) const { return( Get(Index) ); }
405
406 CSG_Array_Pointer & operator += (void *Value) { Add(Value); return( *this ); }
407 CSG_Array_Pointer & operator += (const CSG_Array_Pointer &Array) { Add(Array); return( *this ); }
408
409
410private:
411
412 CSG_Array m_Array;
413
414};
415
416
418// //
420
421//---------------------------------------------------------
423{
424public:
425 CSG_Array_Int (const CSG_Array_Int &Array) { Create(Array); }
426 int * Create (const CSG_Array_Int &Array);
427
429 int * Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
430
431 void Destroy (void) { m_Array.Destroy(); }
432
433 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
434 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
435
436 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
437 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
438
439 int * Get_Array (void) const { return( (int *)m_Array.Get_Array() ); }
440 int * Get_Array (sLong nValues) { return( (int *)m_Array.Get_Array(nValues) ); }
441
442 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
443 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
444 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
445
446 bool Add (int Value);
447 bool Add (const CSG_Array_Int &Array);
448 bool Set (sLong Index, int Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((int *)m_Array.Get_Entry(Index)) = Value; return( true ); }
449#ifndef SWIG
450 int & Get (sLong Index) { return( *((int *)m_Array.Get_Entry(Index)) ); }
451#endif
452 int Get (sLong Index) const { return( *((int *)m_Array.Get_Entry(Index)) ); }
453
454 bool Assign (int Value);
455
456 CSG_Array_Int & operator = (const CSG_Array_Int &Array) { Create(Array); return( *this ); }
457 CSG_Array_Int & operator = (int Value) { Assign(Value); return( *this ); }
458
459 int & operator [] (sLong Index) { return( Get(Index) ); }
460 int operator [] (sLong Index) const { return( Get(Index) ); }
461
462 CSG_Array_Int & operator += (int Value) { Add(Value); return( *this ); }
463 CSG_Array_Int & operator += (const CSG_Array_Int &Array) { Add(Array); return( *this ); }
464
465
466private:
467
468 CSG_Array m_Array;
469
470};
471
472
474// //
476
477//---------------------------------------------------------
479{
480public:
481 CSG_Array_sLong (const CSG_Array_sLong &Array) { Create(Array); }
482 sLong * Create (const CSG_Array_sLong &Array);
483
485 sLong * Create (sLong nValues = 0, TSG_Array_Growth Growth = TSG_Array_Growth::SG_ARRAY_GROWTH_0);
486
487 void Destroy (void) { m_Array.Destroy(); }
488
489 bool Set_Growth (TSG_Array_Growth Growth) { return( m_Array.Set_Growth(Growth) ); }
490 TSG_Array_Growth Get_Growth (void) const { return( m_Array.Get_Growth() ); }
491
492 sLong Get_Size (void) const { return( m_Array.Get_Size() ); }
493 size_t Get_uSize (void) const { return( m_Array.Get_uSize() ); }
494
495 sLong * Get_Array (void) const { return( (sLong *)m_Array.Get_Array() ); }
496 sLong * Get_Array (sLong nValues) { return( (sLong *)m_Array.Get_Array(nValues) ); }
497
498 bool Set_Array (sLong nValues, bool bShrink = true) { return( m_Array.Set_Array(nValues, bShrink) ); }
499 bool Inc_Array (sLong nValues = 1) { return( m_Array.Inc_Array(nValues) ); }
500 bool Dec_Array ( bool bShrink = true) { return( m_Array.Dec_Array(bShrink) ); }
501
502 bool Add (sLong Value);
503 bool Add (const CSG_Array_sLong &Array);
504 bool Set (sLong Index, sLong Value) { if( !m_Array.Get_Entry(Index) ) return( false ); *((sLong *)m_Array.Get_Entry(Index)) = Value; return( true ); }
505#ifndef SWIG
506 sLong & Get (sLong Index) { return( *((sLong *)m_Array.Get_Entry(Index)) ); }
507#endif
508 sLong Get (sLong Index) const { return( *((sLong *)m_Array.Get_Entry(Index)) ); }
509
510 bool Assign (sLong Value);
511
512 CSG_Array_sLong & operator = (const CSG_Array_sLong &Array) { Create(Array); return( *this ); }
513 CSG_Array_sLong & operator = (sLong Value) { Assign(Value); return( *this ); }
514
515 sLong & operator [] (sLong Index) { return( Get(Index) ); }
516 sLong operator [] (sLong Index) const { return( Get(Index) ); }
517
518 CSG_Array_sLong & operator += (sLong Value) { Add(Value); return( *this ); }
519 CSG_Array_sLong & operator += (const CSG_Array_sLong &Array) { Add(Array); return( *this ); }
520
521
522private:
523
524 CSG_Array m_Array;
525
526};
527
528
530// //
531// String //
532// //
534
535//---------------------------------------------------------
536#define SG_Char wchar_t
537#define SG_T(s) L ## s
538#define SG_PRINTF wprintf
539#define SG_FPRINTF fwprintf
540#define SG_SSCANF swscanf
541#define SG_STR_CPY wcscpy
542#define SG_STR_LEN wcslen
543#define SG_STR_TOD wcstod
544#define SG_STR_CMP(s1, s2) CSG_String(s1).Cmp(s2)
545#define SG_STR_MBTOSG(s) CSG_String(s).w_str()
546
547//---------------------------------------------------------
560
561//---------------------------------------------------------
563{
564public:
565 CSG_String(void);
566 CSG_String(const CSG_String &String);
567 CSG_String(const char *String);
568 CSG_String(const wchar_t *String);
569 CSG_String(char Character, size_t nRepeat = 1);
570 CSG_String(wchar_t Character, size_t nRepeat = 1);
571
572 CSG_String (const class wxString *pString);
573 bool Create (const class wxString *pString);
574
575 virtual ~CSG_String(void);
576
577 CSG_String & operator = (const CSG_String &String);
578 CSG_String & operator = (const char *String);
579 CSG_String & operator = (const wchar_t *String);
580 CSG_String & operator = (char Character);
581 CSG_String & operator = (wchar_t Character);
582
583 size_t Length (void) const;
584
585 bool is_Empty (void) const;
586
587 SG_Char operator [] (int i) const;
588 SG_Char operator [] (size_t i) const;
589 SG_Char Get_Char (size_t i) const;
590
591 void Set_Char (size_t i, char Character);
592 void Set_Char (size_t i, wchar_t Character);
593
594#ifndef SWIG
595 const class wxString & wx_str (void) const { return( *m_pString ); }
596 class wxString & wx_str (void) { return( *m_pString ); }
597#endif
598
599 const char * b_str (void) const;
600 const wchar_t * w_str (void) const;
601 const SG_Char * c_str (void) const;
602
603 operator const char * (void) const { return( b_str() ); }
604 operator const wchar_t * (void) const { return( w_str() ); }
605
606 CSG_String & Prepend (const CSG_String &String);
607
608 CSG_String & Append (const CSG_String &String);
609 CSG_String & Append (const char *String);
610 CSG_String & Append (const wchar_t *String);
611 CSG_String & Append (char Character, size_t nRepeat = 1);
612 CSG_String & Append (wchar_t Character, size_t nRepeat = 1);
613
614 void operator += (const CSG_String &String);
615 void operator += (const char *String);
616 void operator += (const wchar_t *String);
617 void operator += (char Character);
618 void operator += (wchar_t Character);
619
620 CSG_String operator + (const CSG_String &String) const;
621 CSG_String operator + (const char *String) const;
622 CSG_String operator + (const wchar_t *String) const;
623 CSG_String operator + (char Character) const;
624 CSG_String operator + (wchar_t Character) const;
625
626 int Cmp (const CSG_String &String) const;
627 int CmpNoCase (const CSG_String &String) const;
628
629 bool is_Same_As (const CSG_String &String, bool bCase = true) const;
630 bool is_Same_As (const char Character, bool bCase = true) const;
631 bool is_Same_As (const wchar_t Character, bool bCase = true) const;
632
633 CSG_String & Make_Lower (void);
634 CSG_String & Make_Upper (void);
635
636 void Clear (void);
637
638 static CSG_String Format (const char *Format, ...);
639 static CSG_String Format (const wchar_t *Format, ...);
640 int Printf (const char *Format, ...);
641 int Printf (const wchar_t *Format, ...);
642
643 size_t Replace (const CSG_String &Old, const CSG_String &New, bool bReplaceAll = true);
644 size_t Replace_Single_Char (const SG_Char Old, const CSG_String &New, bool bReplaceAll = true);
645 size_t Replace_Single_Char (const SG_Char Old, const SG_Char New, bool bReplaceAll = true);
646
647 CSG_String & Remove (size_t pos);
648 CSG_String & Remove (size_t pos, size_t len);
649
650 int Trim (bool fromRight = false);
651 int Trim_Both (void);
652
653 int Find (char Character, bool fromEnd = false) const;
654 int Find (wchar_t Character, bool fromEnd = false) const;
655 int Find (const CSG_String &String) const;
656 bool Contains (const CSG_String &String) const;
657
658 CSG_String AfterFirst (char Character) const;
659 CSG_String AfterFirst (wchar_t Character) const;
660 CSG_String AfterLast (char Character) const;
661 CSG_String AfterLast (wchar_t Character) const;
662 CSG_String BeforeFirst (char Character) const;
663 CSG_String BeforeFirst (wchar_t Character) const;
664 CSG_String BeforeLast (char Character) const;
665 CSG_String BeforeLast (wchar_t Character) const;
666
667 CSG_String Right (size_t count) const;
668 CSG_String Mid (size_t first, size_t count = 0) const;
669 CSG_String Left (size_t count) const;
670
671 bool is_Number (void) const;
672
673 bool asInt (int &Value) const;
674 int asInt (void) const { int Value; return( asInt (Value) ? Value : 0 ); }
675 bool asDWord (DWORD &Value) const;
676 DWORD asDWord (void) const { DWORD Value; return( asDWord (Value) ? Value : 0 ); }
677 bool asLong (sLong &Value) const;
678 sLong asLong (void) const { sLong Value; return( asLong (Value) ? Value : 0 ); }
679 bool asULong (uLong &Value) const;
680 uLong asULong (void) const { uLong Value; return( asULong (Value) ? Value : 0 ); }
681 bool asDouble (double &Value) const;
682 double asDouble (void) const { double Value; return( asDouble(Value) ? Value : 0. ); }
683
684 sLong asLongLong (void) const { return( asLong( ) ); }
685 bool asLongLong (sLong &Value) const { return( asLong(Value) ); }
686
687 static CSG_String from_UTF8 (const char *String, size_t Length = 0);
688
689 size_t to_UTF8 (char **pString) const;
690 CSG_Buffer to_UTF8 (void) const;
691 size_t to_MBChar (char **pString, int Encoding) const;
692 CSG_Buffer to_MBChar ( int Encoding) const;
693 bool to_ASCII (char **pString, char Replace = '_') const;
694 CSG_Buffer to_ASCII ( char Replace = '_') const;
695 std::string to_StdString (void) const;
696 std::wstring to_StdWstring (void) const;
697
698protected:
699
700 class wxString *m_pString;
701
702};
703
704//---------------------------------------------------------
709
710//---------------------------------------------------------
712{
713public:
714 CSG_Strings(void);
715 CSG_Strings(const CSG_Strings &Strings);
716 CSG_Strings(int nStrings, const SG_Char **Strings);
717
718 virtual ~CSG_Strings(void);
719
720 bool Create (const CSG_Strings &Strings);
721 bool Destroy (void);
722
723 bool Set_Count (int Count) { return( Set_Count((size_t)Count) ); }
724 bool Set_Count (size_t Count);
725 int Get_Count (void) const { return( (int)m_Strings.Get_Size() ); }
726 size_t Get_Size (void) const { return( m_Strings.Get_Size() ); }
727
728 bool Add (const CSG_Strings &Strings);
729 bool Add (const CSG_String &String );
730 bool Ins (const CSG_String &String , int Index) { return( Ins(String, (size_t)Index) ); }
731 bool Ins (const CSG_String &String , size_t Index);
732 bool Del (int Index) { return( Del((size_t)Index) ); }
733 bool Del (size_t Index);
734
735 CSG_String & Get_String (int Index) const { return( *((CSG_String *)m_Strings[Index]) ); }
736 CSG_String & Get_String (size_t Index) const { return( *((CSG_String *)m_Strings[Index]) ); }
737
738 CSG_String & operator [] (int Index) const { return( Get_String(Index) ); }
739 CSG_String & operator [] (size_t Index) const { return( Get_String(Index) ); }
740
741 CSG_Strings & operator = (const CSG_Strings &Strings) { Create(Strings); return( *this ); }
742 CSG_Strings & operator += (const CSG_Strings &Strings) { Add (Strings); return( *this ); }
743 CSG_Strings & operator += (const CSG_String &String ) { Add (String ); return( *this ); }
744
745 bool Sort (bool Ascending = true);
746
747 void Clear (void) { Destroy(); }
748 bool Assign (const CSG_Strings &Strings) { return( Create(Strings) ); }
749
750
751protected:
752
754
755};
756
757//---------------------------------------------------------
758#define SG_DEFAULT_DELIMITERS " \t\r\n"
759
770
771//---------------------------------------------------------
773{
774public:
777
779
780
781 size_t Get_Tokens_Count (void) const;
782 SG_Char Get_Last_Delimiter (void) const;
784 size_t Get_Position (void) const;
785 CSG_String Get_String (void) const;
786 bool Has_More_Tokens (void) const;
788
789
790private:
791
792 class wxStringTokenizer *m_pTokenizer;
793
794};
795
796//---------------------------------------------------------
798
799//---------------------------------------------------------
801
803
806
807SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals (double Value, int maxDecimals = 6);
808
810
811SAGA_API_DLL_EXPORT CSG_String SG_Get_String (double Value, int Precision = -99);
812SAGA_API_DLL_EXPORT CSG_String SG_Get_String (int Value, int Precision = 0);
813SAGA_API_DLL_EXPORT CSG_String SG_Get_String (sLong Value, int Precision = 0);
814
816
817
819// //
820// //
821// //
823
824//---------------------------------------------------------
826{
827public:
828
829 static CSG_String Html_to_SimpleText (const CSG_String &Text);
830
831 static CSG_String Html_to_Markdown (const CSG_String &Text);
832
833 static CSG_String Html_Absolute_Image_Paths (const CSG_String &Text, const CSG_String &Path, bool bAltAsText = false);
834
835 static CSG_String Markdown_to_Html (const CSG_String &Text, bool bSimple = true);
836
837
838private:
839
840 static CSG_String _Html_to_Markdown (const CSG_String &Text);
841 static bool _Html_Tag_Find (CSG_String &Head, CSG_String &Tail, CSG_String &Tag, CSG_String &Attributes, CSG_String &Content);
842 static bool _Html_Tag_to_Markdown (const CSG_String &Tag, const CSG_String &Attributes, CSG_String &Content);
843
844 static bool _Markdown_to_Html (CSG_String &Line, int Mode = 0);
845 static bool _Markdown_to_Html (CSG_String &Line, const CSG_String &MD, const CSG_String &Tag);
846 static bool _Markdown_to_Html_Links (CSG_String &Line);
847 static bool _Markdown_Split_Link (const CSG_String &MD, CSG_String &Head, CSG_String &Text, CSG_String &Link, CSG_String &Tail);
848
849};
850
851
853// //
854// //
855// //
857
858//---------------------------------------------------------
860{
861public:
862 CSG_Bytes (void);
863 bool Create (void);
864
865 CSG_Bytes (const CSG_Bytes &Bytes);
866 bool Create (const CSG_Bytes &Bytes);
867
868 CSG_Bytes (const BYTE *Bytes, int nBytes);
869 bool Create (const BYTE *Bytes, int nBytes);
870
871 virtual ~CSG_Bytes(void);
872
873 bool Destroy (void);
874 bool Clear (void);
875
876 void Rewind (void) { m_Cursor = 0; }
877 bool is_EOF (void) { return( m_Cursor >= m_nBytes ); }
878
879 int Get_Count (void) const { return( m_nBytes ); }
880 BYTE * Get_Bytes (void) const { return( m_Bytes ); }
881
882 CSG_Bytes Get_Bytes (int i) const { if( i < 0 || i >= m_nBytes ) i = 0; return( CSG_Bytes(m_Bytes + i, m_nBytes - i) ); }
883 CSG_Bytes operator + (int i) const { return( Get_Bytes(i) ); }
884
885 BYTE Get_Byte (int i) const { return( i >= 0 && i < m_nBytes ? m_Bytes[i] : 0 ); }
886 BYTE operator [] (int i) const { return( Get_Byte(i) ); }
887
888 bool Assign (const CSG_Bytes &Bytes);
889 CSG_Bytes & operator = (const CSG_Bytes &Bytes) { Assign(Bytes); return( *this ); }
890
891 bool Add (const CSG_Bytes &Bytes);
892 CSG_Bytes & operator += (const CSG_Bytes &Bytes) { Add(Bytes); return( *this ); }
893
894 bool Add (void *Bytes, int nBytes, bool bSwapBytes);
895
896 bool Add (BYTE Value) { return( Add(&Value, sizeof(Value), false) ); }
897 CSG_Bytes & operator += (BYTE Value) { Add(Value); return( *this ); }
898 bool Add (char Value) { return( Add(&Value, sizeof(Value), false) ); }
899 CSG_Bytes & operator += (char Value) { Add(Value); return( *this ); }
900 bool Add (short Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
901 CSG_Bytes & operator += (short Value) { Add(Value); return( *this ); }
902 bool Add (WORD Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
903 CSG_Bytes & operator += (WORD Value) { Add(Value); return( *this ); }
904 bool Add (int Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
905 CSG_Bytes & operator += (int Value) { Add(Value); return( *this ); }
906 bool Add (DWORD Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
907 CSG_Bytes & operator += (DWORD Value) { Add(Value); return( *this ); }
908 bool Add (float Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
909 CSG_Bytes & operator += (float Value) { Add(Value); return( *this ); }
910 bool Add (double Value, bool bSwapBytes = false) { return( Add(&Value, sizeof(Value), bSwapBytes) ); }
911 CSG_Bytes & operator += (double Value) { Add(Value); return( *this ); }
912
913 BYTE asByte (int i) const { return( Get_Byte (i) ); }
914 char asChar (int i) const { return( (char)Get_Byte (i) ); }
915 short asShort (int i, bool bSwapBytes = false) const { short v = *((short *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
916 WORD asWord (int i, bool bSwapBytes = false) const { WORD v = *((WORD *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
917 int asInt (int i, bool bSwapBytes = false) const { int v = *((int *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
918 DWORD asDWord (int i, bool bSwapBytes = false) const { DWORD v = *((DWORD *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
919 float asFloat (int i, bool bSwapBytes = false) const { float v = *((float *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
920 double asDouble (int i, bool bSwapBytes = false) const { double v = *((double *)(m_Bytes + i)); if( bSwapBytes ) SG_Swap_Bytes(&v, sizeof(v)); return( v ); }
921
922 BYTE Read_Byte (void) { BYTE v = asByte (m_Cursor); m_Cursor += sizeof(v); return( v ); }
923 char Read_Char (void) { char v = asByte (m_Cursor); m_Cursor += sizeof(v); return( v ); }
924 short Read_Short (bool bSwapBytes = false) { short v = asShort (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
925 WORD Read_Word (bool bSwapBytes = false) { WORD v = asWord (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
926 int Read_Int (bool bSwapBytes = false) { int v = asInt (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
927 DWORD Read_DWord (bool bSwapBytes = false) { DWORD v = asDWord (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
928 float Read_Float (bool bSwapBytes = false) { float v = asFloat (m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
929 double Read_Double (bool bSwapBytes = false) { double v = asDouble(m_Cursor, bSwapBytes); m_Cursor += sizeof(v); return( v ); }
930
931 CSG_String toHexString (void) const;
932 bool fromHexString (const CSG_String &HexString);
933
934
935private:
936
937 int m_nBytes, m_nBuffer, m_Cursor;
938
939 BYTE *m_Bytes;
940
941
942 bool _Inc_Array (int nBytes);
943
944};
945
946//---------------------------------------------------------
948{
949public:
950 CSG_Bytes_Array(void);
951 virtual ~CSG_Bytes_Array(void);
952
953 bool Destroy (void);
954
955 int Get_Count (void) const { return( m_nBytes ); }
956 CSG_Bytes * Get_Bytes (int i) { return( i >= 0 && i < m_nBytes ? m_pBytes[i] : NULL ); }
957 CSG_Bytes & operator [] (int i) { return( *Get_Bytes(i) ); }
958
959 CSG_Bytes * Add (void);
960
961
962private:
963
964 int m_nBytes, m_nBuffer;
965
966 CSG_Bytes **m_pBytes;
967
968};
969
970
972// //
973// //
974// //
976
977//---------------------------------------------------------
979{
980public:
981 CSG_Stack(size_t RecordSize)
982 {
983 m_Stack.Create(RecordSize, 1, TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_256);
984 }
985
986 virtual ~CSG_Stack(void) {}
987
988 bool Destroy (void) { return( m_Stack.Set_Array(1) ); }
989
990 size_t Get_RecordSize (void) const { return( m_Stack.Get_Value_Size() ); }
991 size_t Get_Size (void) const { return( m_Stack.Get_uSize() - 1 ); }
992
993 bool Clear (bool bFreeMemory = false)
994 {
995 return( m_Stack.Set_Array(1, bFreeMemory) );
996 }
997
998
999protected:
1000
1001 void * Get_Record (size_t i) const
1002 {
1003 return( m_Stack.Get_Entry((sLong)(i + 1)) );
1004 }
1005
1006 void * Get_Record_Push (void)
1007 {
1008 return( m_Stack.Inc_Array() ? m_Stack.Get_Entry(m_Stack.Get_Size() - 1) : NULL );
1009 }
1010
1011 void * Get_Record_Pop (void)
1012 {
1013 if( m_Stack.Get_Size() > 1 )
1014 {
1015 memcpy(m_Stack.Get_Array(), m_Stack.Get_Entry(m_Stack.Get_Size() - 1), m_Stack.Get_Value_Size());
1016
1017 m_Stack.Dec_Array(true);
1018
1019 return( m_Stack.Get_Array() );
1020 }
1021
1022 return( NULL );
1023 }
1024
1025 void * Get_Array (void) const { return( m_Stack.Get_Entry(1) ); }
1026
1027
1028private:
1029
1030 CSG_Array m_Stack;
1031
1032};
1033
1034
1036// //
1037// Data Types //
1038// //
1040
1041//---------------------------------------------------------
1062
1063//---------------------------------------------------------
1064#define SG_DATATYPES_Undefined 0x0000
1065#define SG_DATATYPES_Bit 0x0001
1066#define SG_DATATYPES_Byte 0x0002
1067#define SG_DATATYPES_Char 0x0004
1068#define SG_DATATYPES_Word 0x0008
1069#define SG_DATATYPES_Short 0x0010
1070#define SG_DATATYPES_DWord 0x0020
1071#define SG_DATATYPES_Int 0x0040
1072#define SG_DATATYPES_ULong 0x0080
1073#define SG_DATATYPES_Long 0x0100
1074#define SG_DATATYPES_Float 0x0200
1075#define SG_DATATYPES_Double 0x0400
1076#define SG_DATATYPES_String 0x0800
1077#define SG_DATATYPES_Date 0x1000
1078#define SG_DATATYPES_Color 0x2000
1079#define SG_DATATYPES_Binary 0x4000
1080#define SG_DATATYPES_Standard 0xFFFF // all flags set
1081#define SG_DATATYPES_SInteger (SG_DATATYPES_Char|SG_DATATYPES_Short|SG_DATATYPES_Int |SG_DATATYPES_Long)
1082#define SG_DATATYPES_UInteger (SG_DATATYPES_Byte|SG_DATATYPES_Word |SG_DATATYPES_DWord|SG_DATATYPES_ULong)
1083#define SG_DATATYPES_Integer (SG_DATATYPES_SInteger|SG_DATATYPES_UInteger)
1084#define SG_DATATYPES_Real (SG_DATATYPES_Float|SG_DATATYPES_Double)
1085#define SG_DATATYPES_Numeric (SG_DATATYPES_Integer|SG_DATATYPES_Real)
1086#define SG_DATATYPES_Table (SG_DATATYPES_String|SG_DATATYPES_Date|SG_DATATYPES_Color|SG_DATATYPES_Numeric|SG_DATATYPES_Binary)
1087
1088//---------------------------------------------------------
1090{
1091 "BIT",
1092 "BYTE_UNSIGNED",
1093 "BYTE",
1094 "SHORTINT_UNSIGNED",
1095 "SHORTINT",
1096 "INTEGER_UNSIGNED",
1097 "INTEGER",
1098 "LONGINT_UNSIGNED",
1099 "LONGINT",
1100 "FLOAT",
1101 "DOUBLE",
1102 "STRING",
1103 "DATE",
1104 "COLOR",
1105 "BINARY",
1106 "UNDEFINED"
1107};
1108
1109//---------------------------------------------------------
1111{
1112 switch( Type )
1113 {
1114 case SG_DATATYPE_Bit : return( 0 );
1115 case SG_DATATYPE_Byte : return( sizeof(BYTE ) );
1116 case SG_DATATYPE_Char : return( sizeof(char ) );
1117 case SG_DATATYPE_Word : return( sizeof(WORD ) );
1118 case SG_DATATYPE_Short : return( sizeof(short ) );
1119 case SG_DATATYPE_DWord : return( sizeof(DWORD ) );
1120 case SG_DATATYPE_Int : return( sizeof(int ) );
1121 case SG_DATATYPE_ULong : return( sizeof(uLong ) );
1122 case SG_DATATYPE_Long : return( sizeof(sLong ) );
1123 case SG_DATATYPE_Float : return( sizeof(float ) );
1124 case SG_DATATYPE_Double: return( sizeof(double) );
1125 case SG_DATATYPE_String: return( 0 );
1126 case SG_DATATYPE_Date : return( 0 );
1127 case SG_DATATYPE_Color : return( sizeof(DWORD ) );
1128 case SG_DATATYPE_Binary: return( 0 );
1129 default : return( 0 );
1130 }
1131}
1132
1133//---------------------------------------------------------
1140
1141
1143// //
1144// File //
1145// //
1147
1148//---------------------------------------------------------
1156
1157//---------------------------------------------------------
1164
1165//---------------------------------------------------------
1172
1173//---------------------------------------------------------
1175{
1176public:
1177
1178 CSG_File(void);
1179 virtual ~CSG_File(void);
1180
1181 CSG_File (const SG_Char *FileName, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_ANSI);
1182 virtual bool Open (const SG_Char *FileName, int Mode = SG_FILE_R, bool bBinary = true, int Encoding = SG_FILE_ENCODING_ANSI);
1183
1184 virtual bool Close (void);
1185
1186 virtual const CSG_String & Get_File_Name (void) const { return( m_FileName ); }
1187 virtual CSG_String Get_File_Name (size_t Index) { return( m_FileName ); }
1188 virtual TSG_File_Type Get_File_Type (void) const { return( SG_FILE_TYPE_NORMAL ); }
1189
1190 class wxStreamBase * Get_Stream (void) const { return( (class wxStreamBase *)m_pStream ); }
1191
1192 bool Set_Encoding (int Encoding);
1193 int Get_Encoding (void) const { return( m_Encoding ); }
1194
1195 bool is_Open (void) const { return( m_pStream != NULL ); }
1196 bool is_Reading (void) const { return( m_pStream != NULL && m_Mode != SG_FILE_W ); }
1197 bool is_Writing (void) const { return( m_pStream != NULL && m_Mode != SG_FILE_R ); }
1198 bool is_EOF (void) const;
1199
1200 sLong Length (void) const;
1201
1202 bool Seek (sLong Offset, int Origin = SG_FILE_START) const;
1203 bool Seek_Start (void) const;
1204 bool Seek_End (void) const;
1205
1206 sLong Tell (void) const;
1207
1208 bool Flush (void);
1209
1210 int Printf (const char *Format, ...);
1211 int Printf (const wchar_t *Format, ...);
1212
1213 size_t Read (void *Buffer, size_t Size, size_t Count = 1) const;
1214 size_t Write (void *Buffer, size_t Size, size_t Count = 1) const;
1215 size_t Read ( CSG_String &Buffer, size_t Size) const;
1216 size_t Read ( CSG_String &Buffer) const;
1217 size_t Write (const CSG_String &Buffer) const;
1218
1219 bool Read_Line (CSG_String &Line) const;
1220
1221 int Read_Char (void) const;
1222 int Read_Int ( bool bBigEndian = false) const;
1223 bool Write_Int (int Value, bool bBigEndian = false);
1224 double Read_Double ( bool bBigEndian = false) const;
1225 bool Write_Double (double Value, bool bBigEndian = false);
1226
1227 bool Scan (int &Value) const;
1228 bool Scan (double &Value) const;
1229 bool Scan (CSG_String &Value, SG_Char Separator) const;
1230
1231 int Scan_Int (void) const;
1232 double Scan_Double (void) const;
1233 CSG_String Scan_String (SG_Char Separator) const;
1234
1235
1236protected:
1237
1239
1241
1243
1244
1245 void On_Construction (void);
1246
1247};
1248
1249//---------------------------------------------------------
1251{
1252public:
1253
1254 CSG_Archive(void);
1255 virtual ~CSG_Archive(void);
1256
1257 CSG_Archive (const SG_Char *FileName, int Mode = SG_FILE_R, int Encoding = SG_FILE_ENCODING_ANSI);
1258 virtual bool Open (const SG_Char *FileName, int Mode = SG_FILE_R, int Encoding = SG_FILE_ENCODING_ANSI);
1259 virtual bool Open (const SG_Char *FileName, int Mode, bool bBinary, int Encoding) { return( Open(FileName, Mode, Encoding) ); }
1260
1261 virtual bool Close (void);
1262
1263 virtual const CSG_String & Get_Archive (void) const { return( m_Archive ); }
1264 virtual TSG_File_Type Get_File_Type (void) const { return( m_Type ); }
1265 bool is_Zip (void) const { return( m_Type == SG_FILE_TYPE_ZIP ); }
1266 bool is_Tar (void) const { return( m_Type == SG_FILE_TYPE_TAR ); }
1267
1268 bool Add_Directory (const SG_Char *Name);
1269 bool Add_File (const SG_Char *Name, bool bBinary = true);
1270
1271 size_t Get_File_Count (void) { return( m_Files.Get_Size() ); }
1272 bool Get_File (const SG_Char *Name);
1273 bool Get_File (size_t Index);
1274 virtual CSG_String Get_File_Name (size_t Index);
1275 bool is_Directory (size_t Index);
1276
1277 bool Extract_All (const SG_Char *toDirectory = NULL);
1278 bool Extract (const SG_Char *File, const SG_Char *toFile = NULL);
1279
1280
1281protected:
1282
1284
1286
1288
1289};
1290
1291//---------------------------------------------------------
1293{
1294public:
1295
1296 CSG_ZLib(void);
1297
1298 static bool is_GZip_Supported (void);
1299
1300 static CSG_String Compress (const CSG_String &File, const CSG_String &Target = "");
1301 static CSG_String Uncompress (const CSG_String &File, const CSG_String &Target = "");
1302
1303};
1304
1305//---------------------------------------------------------
1306#define CSG_File_Zip CSG_Archive // for backward compatibility
1307
1308//---------------------------------------------------------
1309SAGA_API_DLL_EXPORT bool SG_Dir_Exists (const CSG_String &Directory);
1310SAGA_API_DLL_EXPORT bool SG_Dir_Create (const CSG_String &Directory, bool bFullPath = false);
1311SAGA_API_DLL_EXPORT bool SG_Dir_Delete (const CSG_String &Directory, bool bRecursive = false);
1313SAGA_API_DLL_EXPORT bool SG_Dir_Set_Temp (const CSG_String &Directory, bool bCreate = false);
1316SAGA_API_DLL_EXPORT bool SG_Dir_List_Subdirectories (CSG_Strings &List, const CSG_String &Directory , bool bRecursive = false);
1317SAGA_API_DLL_EXPORT bool SG_Dir_List_Files (CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension = "", bool bRecursive = false);
1318
1319SAGA_API_DLL_EXPORT bool SG_File_Exists (const CSG_String &FileName);
1320SAGA_API_DLL_EXPORT bool SG_File_Delete (const CSG_String &FileName);
1321SAGA_API_DLL_EXPORT bool SG_File_Copy (const CSG_String &Source, const CSG_String &Target, bool bOverwrite = true);
1324SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name (const CSG_String &full_Path, bool bExtension);
1329SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path (const CSG_String &Directory, const CSG_String &Name, const CSG_String &Extension);
1330SAGA_API_DLL_EXPORT bool SG_File_Cmp_Path (const CSG_String &Path1, const CSG_String &Path2);
1331SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension (const CSG_String &File, const CSG_String &Extension);
1333SAGA_API_DLL_EXPORT bool SG_File_Set_Extension ( CSG_String &File, const CSG_String &Extension);
1334
1335//---------------------------------------------------------
1336SAGA_API_DLL_EXPORT bool SG_Get_Environment (const CSG_String &Variable, CSG_String *Value = NULL);
1337SAGA_API_DLL_EXPORT bool SG_Set_Environment (const CSG_String &Variable, const CSG_String &Value);
1338
1339
1341// //
1342// Colors //
1343// //
1345
1346//---------------------------------------------------------
1347#define SG_GET_RGB( r, g, b ) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16)))
1348#define SG_GET_RGBA(r, g, b, a) ((DWORD) (((BYTE)(r) | ((WORD)(g) << 8)) | (((DWORD)(BYTE)(b)) << 16) | (((DWORD)(BYTE)(a)) << 24)))
1349
1350#define SG_GET_R(rgb) ((BYTE) ((rgb) ))
1351#define SG_GET_G(rgb) ((BYTE) ((rgb) >> 8))
1352#define SG_GET_B(rgb) ((BYTE) ((rgb) >> 16))
1353#define SG_GET_A(rgb) ((BYTE) ((rgb) >> 24))
1354
1355//---------------------------------------------------------
1356#define SG_COLOR_BLACK SG_GET_RGB( 0, 0, 0)
1357#define SG_COLOR_GREY SG_GET_RGB(128, 128, 128)
1358#define SG_COLOR_GREY_LIGHT SG_GET_RGB(192, 192, 192)
1359#define SG_COLOR_WHITE SG_GET_RGB(255, 255, 255)
1360#define SG_COLOR_RED SG_GET_RGB(255, 0, 0)
1361#define SG_COLOR_RED_DARK SG_GET_RGB(128, 0, 0)
1362#define SG_COLOR_YELLOW SG_GET_RGB(255, 255, 0)
1363#define SG_COLOR_YELLOW_DARK SG_GET_RGB(128, 128, 0)
1364#define SG_COLOR_GREEN SG_GET_RGB( 0, 255, 0)
1365#define SG_COLOR_GREEN_DARK SG_GET_RGB( 0, 128, 0)
1366#define SG_COLOR_GREEN_LIGHT SG_GET_RGB( 0, 255, 0)
1367#define SG_COLOR_BLUE SG_GET_RGB( 0, 0, 255)
1368#define SG_COLOR_BLUE_DARK SG_GET_RGB( 0, 0, 128)
1369#define SG_COLOR_BLUE_LIGHT SG_GET_RGB( 0, 255, 255)
1370#define SG_COLOR_BLUE_GREEN SG_GET_RGB( 0, 128, 128)
1371#define SG_COLOR_PURPLE SG_GET_RGB(128, 0, 128)
1372#define SG_COLOR_PINK SG_GET_RGB(255, 0, 255)
1373#define SG_COLOR_NONE -1
1374#define SG_COLOR_RANDOM -2
1375
1376//---------------------------------------------------------
1378{
1383
1388
1392
1396
1400
1404
1408
1414
1419
1424
1429
1433
1436
1442
1444
1448
1450};
1451
1452//---------------------------------------------------------
1454
1456SAGA_API_DLL_EXPORT long SG_Color_From_RGB (int Red, int Green, int Blue, int Alpha = 0);
1457SAGA_API_DLL_EXPORT bool SG_Color_From_Text (const CSG_String &Text, long &Color);
1458SAGA_API_DLL_EXPORT CSG_String SG_Color_To_Text (long Color, bool bHexadecimal = true);
1459
1460//---------------------------------------------------------
1462{
1463public:
1464 CSG_Colors (void);
1465 bool Create (void);
1466
1467 CSG_Colors (const CSG_Colors &Colors);
1468 bool Create (const CSG_Colors &Colors);
1469
1470 CSG_Colors (int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
1471 bool Create (int nColors, int Palette = SG_COLORS_DEFAULT, bool bRevert = false);
1472
1473 CSG_Colors (const CSG_String &Palette, int nColors = 0, bool bRevert = false);
1474 bool Create (const CSG_String &Palette, int nColors = 0, bool bRevert = false);
1475
1476 virtual ~CSG_Colors(void);
1477
1478 void Destroy (void);
1479
1480 bool Set_Count (int nColors);
1481 int Get_Count (void) const { return( m_nColors ); }
1482
1483 CSG_Colors & operator = (const CSG_Colors &Colors);
1484 long & operator [] (int Index) { return( m_Colors[Index < 0 ? 0 : Index >= m_nColors ? m_nColors - 1 : Index] ); }
1485
1486 bool Set_Color (int Index, long Color);
1487 bool Set_Color (int Index, int Red, int Green, int Blue);
1488 bool Set_Red (int Index, int Value);
1489 bool Set_Green (int Index, int Value);
1490 bool Set_Blue (int Index, int Value);
1491 bool Set_Brightness (int Index, int Value);
1492
1493 long Get_Color (int Index) const { return( m_nColors > 0 ? m_Colors[Index < 0 ? 0 : Index >= m_nColors ? m_nColors - 1 : Index] : 0 ); }
1494 long Get_Red (int Index) const { return( SG_GET_R(Get_Color(Index)) ); }
1495 long Get_Green (int Index) const { return( SG_GET_G(Get_Color(Index)) ); }
1496 long Get_Blue (int Index) const { return( SG_GET_B(Get_Color(Index)) ); }
1497 long Get_Brightness (int Index) const { return( (Get_Red(Index) + Get_Green(Index) + Get_Blue(Index)) / 3 ); }
1498
1499 long Get_Interpolated (double Index) const
1500 {
1501 if( m_nColors <= 0 ) return( 0 );
1502 if( Index <= 0. ) return( m_Colors[0] );
1503 if( Index >= m_nColors - 1. ) return( m_Colors[m_nColors - 1] );
1504
1505 int i = (int)Index; Index -= i;
1506 int r = (int)(Get_Red (i) + Index * ((double)Get_Red (i + 1) - Get_Red (i)));
1507 int g = (int)(Get_Green(i) + Index * ((double)Get_Green(i + 1) - Get_Green(i)));
1508 int b = (int)(Get_Blue (i) + Index * ((double)Get_Blue (i + 1) - Get_Blue (i)));
1509
1510 return( SG_GET_RGB(r, g, b) );
1511 }
1512
1513 static int Get_Predefined_Count(void);
1514 static CSG_String Get_Predefined_Name (int Index, bool bWithIndex = true);
1515 bool Set_Predefined (int Index , bool bRevert = false, int nColors = 0);
1516 bool Set_Predefined (const CSG_String &Name, bool bRevert = false, int nColors = 0);
1517 bool Set_Palette (int Index , bool bRevert = false, int nColors = 0) { return( Set_Predefined(Index, bRevert, nColors) ); }
1518 bool Set_Palette (const CSG_String &Name, bool bRevert = false, int nColors = 0) { return( Set_Predefined(Name, bRevert, nColors) ); }
1519 bool Set_Default (int nColors = 11);
1520 bool Set_Ramp (long Color_A, long Color_B);
1521 bool Set_Ramp (long Color_A, long Color_B, int iColor_A, int iColor_B);
1522 bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B);
1523 bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B, int iColor_A, int iColor_B);
1524
1525 bool Random (void);
1526 bool Invert (void);
1527 bool Revert (void);
1528 bool Greyscale (void);
1529
1530 bool Assign (const CSG_Colors &Colors);
1531 bool Assign (CSG_Colors *pSource);
1532
1533 bool Load (const CSG_String &File_Name);
1534 bool Save (const CSG_String &File_Name, bool bBinary);
1535
1536 bool Serialize (CSG_File &Stream, bool bSave, bool bBinary);
1537
1538 bool to_Text ( CSG_String &String);
1539 bool from_Text (const CSG_String &String);
1540
1541
1542private:
1543
1544 int m_nColors;
1545
1546 long *m_Colors;
1547
1548
1549 void _Set_Brightness (double &a, double &b, double &c, int Pass = 0);
1550
1551};
1552
1553
1555// //
1556// Translator //
1557// //
1559
1560//---------------------------------------------------------
1562{
1563public:
1564 CSG_Translator(void);
1565 virtual ~CSG_Translator(void);
1566
1567 CSG_Translator (const CSG_String &File_Name, bool bSetExtension = true, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1568 bool Create (const CSG_String &File_Name, bool bSetExtension = true, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1569
1570 CSG_Translator (class CSG_Table *pTranslations, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1571 bool Create (class CSG_Table *pTranslations, int iText = 0, int iTranslation = 1, bool bCmpNoCase = false);
1572
1573 void Destroy (void);
1574
1575 bool is_CaseSensitive (void) const { return( !m_bCmpNoCase ); }
1576
1577 int Get_Count (void) const { return( m_nTranslations ); }
1578 const SG_Char * Get_Text (int i) const { return( i >= 0 && i < m_nTranslations ? m_Translations[i]->m_Text : SG_T("") ); }
1579 const SG_Char * Get_Translation (int i) const { return( i >= 0 && i < m_nTranslations ? m_Translations[i]->m_Translation : SG_T("") ); }
1580
1581 const SG_Char * Get_Translation (const SG_Char *Text, bool bReturnNullOnNotFound = false) const;
1582 bool Get_Translation (const SG_Char *Text, CSG_String &Translation) const;
1583
1584
1585private:
1586
1587 class CSG_Translation
1588 {
1589 public:
1590 CSG_Translation(const CSG_String &Text, const CSG_String &Translation)
1591 {
1592 m_Text = Text;
1593 m_Translation = Translation;
1594 }
1595
1596 CSG_String m_Text, m_Translation;
1597 };
1598
1599
1600private:
1601
1602 bool m_bCmpNoCase;
1603
1604 int m_nTranslations;
1605
1606 CSG_Translation **m_Translations;
1607
1608
1609 int _Get_Index (const CSG_String &Text) const;
1610
1611};
1612
1613//---------------------------------------------------------
1615
1617
1618#define _TL(s) SG_Translate(L ## s)
1619#define _TW(s) SG_Translate(CSG_String(s))
1620
1621
1623// //
1624// UI Callback //
1625// //
1627
1628//---------------------------------------------------------
1643
1644//---------------------------------------------------------
1654
1655//---------------------------------------------------------
1663
1664//---------------------------------------------------------
1678
1679//---------------------------------------------------------
1731
1732//---------------------------------------------------------
1734{
1735public:
1736 CSG_UI_Parameter(void) : Boolean(false), Number( 0. ), Pointer(NULL) {}
1737 CSG_UI_Parameter(bool Value) : Boolean(Value), Number( 0. ), Pointer(NULL) {}
1738 CSG_UI_Parameter(int Value) : Boolean(false), Number(Value), Pointer(NULL) {}
1739 CSG_UI_Parameter(double Value) : Boolean(false), Number(Value), Pointer(NULL) {}
1740 CSG_UI_Parameter(const CSG_String &Value) : Boolean(false), Number( 0. ), Pointer(NULL), String(Value) {}
1741 CSG_UI_Parameter(void *Value) : Boolean(false), Number( 0. ), Pointer(Value) {}
1743
1745
1746 double Number;
1747
1748 void *Pointer;
1749
1751
1752};
1753
1754//---------------------------------------------------------
1756
1757//---------------------------------------------------------
1760
1761//---------------------------------------------------------
1764
1765SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const char *Text, SG_Char End = '\n', bool bFlush = true);
1766SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const wchar_t *Text, SG_Char End = '\n', bool bFlush = true);
1767SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut (const CSG_String &Text, SG_Char End = '\n', bool bFlush = true);
1768SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const char *Text, SG_Char End = '\n', bool bFlush = true);
1769SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const wchar_t *Text, SG_Char End = '\n', bool bFlush = true);
1770SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr (const CSG_String &Text, SG_Char End = '\n', bool bFlush = true);
1771
1772//---------------------------------------------------------
1776
1777SAGA_API_DLL_EXPORT bool SG_UI_Process_Get_Okay (bool bBlink = false);
1778SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Okay (bool bOkay = true);
1779SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Busy (bool bOn = true, const CSG_String &Message = "");
1780SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress (int Position, int Range);
1782SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress (double Position, double Range);
1784
1789SAGA_API_DLL_EXPORT void SG_UI_Process_Set_Text (const CSG_String &Text); // deprecated, use SG_UI_StatusBar_Set_Text() instead!
1790
1791SAGA_API_DLL_EXPORT bool SG_UI_Stop_Execution (bool bDialog);
1792
1793SAGA_API_DLL_EXPORT void SG_UI_Dlg_Message (const CSG_String &Message, const CSG_String &Caption);
1794SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Continue (const CSG_String &Message, const CSG_String &Caption);
1795SAGA_API_DLL_EXPORT int SG_UI_Dlg_Error (const CSG_String &Message, const CSG_String &Caption);
1796SAGA_API_DLL_EXPORT void SG_UI_Dlg_Info (const CSG_String &Message, const CSG_String &Caption);
1797SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Parameters (class CSG_Parameters *pParameters, const CSG_String &Caption);
1798
1799SAGA_API_DLL_EXPORT int SG_UI_Msg_Lock (bool bOn);
1802SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const char *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1803SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const wchar_t *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1804SAGA_API_DLL_EXPORT void SG_UI_Msg_Add (const CSG_String &Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1805SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const char *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1806SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const wchar_t *Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1807SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution (const CSG_String &Message, bool bNewLine = true, TSG_UI_MSG_STYLE Style = SG_UI_MSG_STYLE_NORMAL);
1808SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error (const char *Message);
1809SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error (const wchar_t *Message);
1812
1815
1816SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Add (class CSG_Data_Object *pDataObject, int Show);
1817SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Del (class CSG_Data_Object *pDataObject, bool bConfirm);
1818SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Update (class CSG_Data_Object *pDataObject, int Show, class CSG_Parameters *pParameters);
1819SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Show (class CSG_Data_Object *pDataObject, int Show);
1820SAGA_API_DLL_EXPORT bool SG_UI_DataObject_asImage (class CSG_Data_Object *pDataObject, class CSG_Grid *pGrid);
1821
1822SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Get (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors);
1823SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Set (class CSG_Data_Object *pDataObject, class CSG_Colors *pColors);
1824
1825SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Classify (class CSG_Data_Object *pDataObject, const class CSG_MetaData &Options);
1826
1827SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Get (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters);
1828SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Set (class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters);
1829
1830SAGA_API_DLL_EXPORT bool SG_UI_Set_Map_Extent (double xMin, double yMin, double xMax, double yMax, int Maps = SG_UI_MAP_ACTIVE);
1832SAGA_API_DLL_EXPORT bool SG_UI_Get_Map_Extent (double &xMin, double &yMin, double &xMax, double &yMax);
1834
1835SAGA_API_DLL_EXPORT bool SG_UI_Diagram_Show (class CSG_Table *pTable, class CSG_Parameters *pParameters);
1836
1838SAGA_API_DLL_EXPORT bool SG_UI_Cloud_Storage_Update (const CSG_String &Connection, const CSG_String &Path);
1839
1840
1842
1848
1849
1851// //
1852// Environment //
1853// //
1855
1856//---------------------------------------------------------
1857SAGA_API_DLL_EXPORT bool SG_Initialize_Environment (bool bLibraries = true, bool bProjections = true, const SG_Char *SAGA_Path = NULL, bool bInitializeWX = true);
1859
1860
1862// //
1863// //
1864// //
1866
1867//---------------------------------------------------------
1868#endif // #ifndef HEADER_INCLUDED__SAGA_API__api_core_H
SAGA_API_DLL_EXPORT long SG_Color_Get_Random(void)
SAGA_API_DLL_EXPORT bool SG_Get_Environment(const CSG_String &Variable, CSG_String *Value=NULL)
SAGA_API_DLL_EXPORT bool SG_File_Exists(const CSG_String &FileName)
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Get(class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
SAGA_API_DLL_EXPORT double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdErr(const char *Text, SG_Char End='\n', bool bFlush=true)
SAGA_API_DLL_EXPORT void SG_Flip_Decimal_Separators(CSG_String &String)
SAGA_API_DLL_EXPORT CSG_String SG_Get_CurrentTimeStr(bool bWithDate=true)
SAGA_API_DLL_EXPORT void SG_UI_Console_Set_UTF8(bool bOn)
TSG_Array_Growth
Definition api_core.h:291
SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Continue(const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT CSG_String SG_Double_To_Degree(double Value)
SAGA_API_DLL_EXPORT void SG_UI_Console_Print_StdOut(const char *Text, SG_Char End='\n', bool bFlush=true)
#define SG_GET_B(rgb)
Definition api_core.h:1352
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Get(class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
TSG_UI_MSG_STYLE
Definition api_core.h:1630
@ SG_UI_MSG_STYLE_03
Definition api_core.h:1640
@ SG_UI_MSG_STYLE_FAILURE
Definition api_core.h:1635
@ SG_UI_MSG_STYLE_SUCCESS
Definition api_core.h:1634
@ SG_UI_MSG_STYLE_02
Definition api_core.h:1639
@ SG_UI_MSG_STYLE_BOLD
Definition api_core.h:1632
@ SG_UI_MSG_STYLE_BIG
Definition api_core.h:1636
@ SG_UI_MSG_STYLE_NORMAL
Definition api_core.h:1631
@ SG_UI_MSG_STYLE_SMALL
Definition api_core.h:1637
@ SG_UI_MSG_STYLE_ITALIC
Definition api_core.h:1633
@ SG_UI_MSG_STYLE_01
Definition api_core.h:1638
unsigned long long uLong
Definition api_core.h:159
SAGA_API_DLL_EXPORT int SG_UI_StatusBar_Lock(bool bOn)
SAGA_API_DLL_EXPORT void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Extension(const CSG_String &File, const CSG_String &Extension)
#define SG_GET_G(rgb)
Definition api_core.h:1351
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Add(class CSG_Data_Object *pDataObject, int Show)
SAGA_API_DLL_EXPORT int SG_OMP_Get_Thread_Num(void)
Definition api_core.cpp:112
SAGA_API_DLL_EXPORT CSG_String SG_HTML_Tag_Replacer(const CSG_String &Text)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Absolute(const CSG_String &full_Path, const CSG_String &CWD="")
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Colors_Set(class CSG_Data_Object *pDataObject, class CSG_Colors *pColors)
SAGA_API_DLL_EXPORT void * SG_UI_Get_Window_Main(void)
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Okay(bool bOkay=true)
SAGA_API_DLL_EXPORT TSG_Data_Type SG_Data_Type_Get_Type(const CSG_String &Identifier)
Definition api_core.cpp:153
SAGA_API_DLL_EXPORT bool SG_UI_Dlg_Parameters(class CSG_Parameters *pParameters, const CSG_String &Caption)
SAGA_API_DLL_EXPORT int SG_UI_Msg_Reset(void)
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Show(class CSG_Data_Object *pDataObject, int Show)
SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Temp(void)
SAGA_API_DLL_EXPORT bool SG_Color_From_Text(const CSG_String &Text, long &Color)
SAGA_API_DLL_EXPORT void * SG_Malloc(size_t size)
SAGA_API_DLL_EXPORT void SG_UI_Dlg_Message(const CSG_String &Message, const CSG_String &Caption)
signed long long sLong
Definition api_core.h:158
SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Lock(bool bOn)
SAGA_API_DLL_EXPORT const SG_Char * SG_Translate(const CSG_String &Text)
SAGA_API_DLL_EXPORT bool SG_Dir_Create(const CSG_String &Directory, bool bFullPath=false)
Definition api_file.cpp:982
SAGA_API_DLL_EXPORT bool SG_Dir_List_Files(CSG_Strings &List, const CSG_String &Directory, const CSG_String &Extension="", bool bRecursive=false)
#define SG_T(s)
Definition api_core.h:537
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path(const CSG_String &full_Path)
SAGA_API_DLL_EXPORT CSG_String SG_Color_To_Text(long Color, bool bHexadecimal=true)
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Classify(class CSG_Data_Object *pDataObject, const class CSG_MetaData &Options)
SAGA_API_DLL_EXPORT CSG_String SG_File_Make_Path(const CSG_String &Directory, const CSG_String &Name)
SAGA_API_DLL_EXPORT int SG_UI_Progress_Lock(bool bOn)
SAGA_API_DLL_EXPORT bool SG_UI_Process_Get_Okay(bool bBlink=false)
SAGA_API_DLL_EXPORT void SG_UI_StatusBar_Set_Text(const CSG_String &Text)
TSG_String_Tokenizer_Mode
Definition api_core.h:761
@ SG_TOKEN_RET_DELIMS
Definition api_core.h:766
@ SG_TOKEN_RET_EMPTY_ALL
Definition api_core.h:765
@ SG_TOKEN_DEFAULT
Definition api_core.h:763
@ SG_TOKEN_RET_EMPTY
Definition api_core.h:764
@ SG_TOKEN_INVALID
Definition api_core.h:762
@ SG_TOKEN_STRTOK
Definition api_core.h:767
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Path_Relative(const CSG_String &Directory, const CSG_String &full_Path)
SAGA_API_DLL_EXPORT bool SG_File_Delete(const CSG_String &FileName)
SAGA_API_DLL_EXPORT int SG_UI_Msg_Lock(bool bOn)
SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Identifier(TSG_Data_Type Type)
Definition api_core.cpp:147
#define SG_GET_R(rgb)
Definition api_core.h:1350
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Progress(int Position, int Range)
TSG_UI_Window_Arrange
Definition api_core.h:1666
@ SG_UI_WINDOW_ARRANGE_TDI_TILE_HOR
Definition api_core.h:1671
@ SG_UI_WINDOW_ARRANGE_MDI_TILE_VER
Definition api_core.h:1668
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_RIGHT
Definition api_core.h:1673
@ SG_UI_WINDOW_ARRANGE_MDI_TILE_HOR
Definition api_core.h:1669
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_BOTTOM
Definition api_core.h:1675
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_TOP
Definition api_core.h:1674
@ SG_UI_WINDOW_ARRANGE_TDI_TILE_VER
Definition api_core.h:1670
@ SG_UI_WINDOW_ARRANGE_MDI_CASCADE
Definition api_core.h:1667
@ SG_UI_WINDOW_ARRANGE_TDI_SPLIT_LEFT
Definition api_core.h:1672
SAGA_API_DLL_EXPORT TSG_PFNC_UI_Callback SG_Get_UI_Callback(void)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name(const CSG_String &full_Path, bool bExtension)
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
SAGA_API_DLL_EXPORT bool SG_UI_ODBC_Update(const CSG_String &Server)
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Del(class CSG_Data_Object *pDataObject, bool bConfirm)
SAGA_API_DLL_EXPORT long SG_Color_From_RGB(int Red, int Green, int Blue, int Alpha=0)
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Error(const char *Message)
SAGA_API_DLL_EXPORT bool SG_Set_Environment(const CSG_String &Variable, const CSG_String &Value)
SAGA_API_DLL_EXPORT void SG_OMP_Set_Max_Num_Threads(int iCores)
Definition api_core.cpp:109
SAGA_API_DLL_EXPORT int SG_UI_StatusBar_Reset(void)
SAGA_API_DLL_EXPORT CSG_Strings SG_String_Tokenize(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
SAGA_API_DLL_EXPORT CSG_String SG_Colors_Get_Name(int Index)
SAGA_API_DLL_EXPORT bool SG_Initialize_Environment(bool bLibraries=true, bool bProjections=true, const SG_Char *SAGA_Path=NULL, bool bInitializeWX=true)
Definition api_core.cpp:452
TSG_UI_DataObject_Update
Definition api_core.h:1646
@ SG_UI_DATAOBJECT_SHOW_MAP_LAST
Definition api_core.h:1651
@ SG_UI_DATAOBJECT_SHOW_MAP
Definition api_core.h:1648
@ SG_UI_DATAOBJECT_UPDATE
Definition api_core.h:1647
@ SG_UI_DATAOBJECT_SHOW_MAP_ACTIVE
Definition api_core.h:1649
@ SG_UI_DATAOBJECT_SHOW_MAP_NEW
Definition api_core.h:1650
SAGA_API_DLL_EXPORT bool SG_is_Character_Numeric(int Character)
SAGA_API_DLL_EXPORT CSG_Translator & SG_Get_Translator(void)
const char gSG_Data_Type_Identifier[][32]
Definition api_core.h:1089
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Update(class CSG_Data_Object *pDataObject, int Show, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool SG_UI_Cloud_Storage_Update(const CSG_String &Connection, const CSG_String &Path)
SAGA_API_DLL_EXPORT int SG_UI_Dlg_Error(const CSG_String &Message, const CSG_String &Caption)
SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_API_Path(void)
Definition api_core.cpp:345
SAGA_API_DLL_EXPORT bool SG_Dir_List_Subdirectories(CSG_Strings &List, const CSG_String &Directory, bool bRecursive=false)
SAGA_API_DLL_EXPORT bool SG_UI_Console_Get_UTF8(void)
SAGA_API_DLL_EXPORT void SG_UI_Process_Set_Text(const CSG_String &Text)
SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Procs(void)
Definition api_core.cpp:111
SAGA_API_DLL_EXPORT bool SG_Dir_Exists(const CSG_String &Directory)
Definition api_file.cpp:976
SAGA_API_DLL_EXPORT bool SG_Data_Type_is_Numeric(TSG_Data_Type Type)
Definition api_core.cpp:198
SAGA_API_DLL_EXPORT bool SG_File_Copy(const CSG_String &Source, const CSG_String &Target, bool bOverwrite=true)
SAGA_API_DLL_EXPORT bool SG_Dir_Set_Temp(const CSG_String &Directory, bool bCreate=false)
Set the directory path returned by SG_Dir_Get_Temp(). Defaults to the user's temporary directory....
SAGA_API_DLL_EXPORT bool SG_UI_Set_Map_Extent(double xMin, double yMin, double xMax, double yMax, int Maps=SG_UI_MAP_ACTIVE)
SAGA_API_DLL_EXPORT void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
SAGA_API_DLL_EXPORT bool SG_UI_StatusBar_is_Locked(void)
SAGA_API_DLL_EXPORT bool SG_UI_Progress_is_Locked(void)
TSG_File_Type
Definition api_core.h:1150
@ SG_FILE_TYPE_NORMAL
Definition api_core.h:1151
@ SG_FILE_TYPE_TAR
Definition api_core.h:1153
@ SG_FILE_TYPE_ZIP
Definition api_core.h:1152
SAGA_API_DLL_EXPORT int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
#define SAGA_API_DLL_EXPORT
Definition api_core.h:94
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Name_Temp(const CSG_String &Prefix)
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add_Execution(const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT int SG_OMP_Get_Max_Num_Threads(void)
Definition api_core.cpp:110
TSG_UI_Maps
Definition api_core.h:1657
@ SG_UI_MAP_LAST
Definition api_core.h:1659
@ SG_UI_MAP_ALL
Definition api_core.h:1660
@ SG_UI_MAP_ACTIVE
Definition api_core.h:1658
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Busy(bool bOn=true, const CSG_String &Message="")
SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_Application_Name(void)
Definition api_core.cpp:378
SAGA_API_DLL_EXPORT int SG_Data_Type_Get_Flag(TSG_Data_Type Type)
Definition api_core.cpp:174
int(* TSG_PFNC_UI_Callback)(TSG_UI_Callback_ID ID, CSG_UI_Parameter &Param_1, CSG_UI_Parameter &Param_2)
Definition api_core.h:1755
SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_Current(void)
SAGA_API_DLL_EXPORT void SG_UI_Dlg_Info(const CSG_String &Message, const CSG_String &Caption)
ESG_File_Flags_Seek
Definition api_core.h:1167
@ SG_FILE_CURRENT
Definition api_core.h:1169
@ SG_FILE_END
Definition api_core.h:1170
@ SG_FILE_START
Definition api_core.h:1168
SAGA_API_DLL_EXPORT double SG_Degree_To_Double(const CSG_String &String)
SAGA_API_DLL_EXPORT void SG_UI_Msg_Add(const char *Message, bool bNewLine=true, TSG_UI_MSG_STYLE Style=SG_UI_MSG_STYLE_NORMAL)
SAGA_API_DLL_EXPORT bool SG_File_Set_Extension(CSG_String &File, const CSG_String &Extension)
SAGA_API_DLL_EXPORT bool SG_Data_Type_Range_Check(TSG_Data_Type Type, double &Value)
Definition api_core.cpp:224
TSG_Data_Type
Definition api_core.h:1043
@ SG_DATATYPE_Long
Definition api_core.h:1052
@ SG_DATATYPE_Byte
Definition api_core.h:1045
@ SG_DATATYPE_Bit
Definition api_core.h:1044
@ SG_DATATYPE_Short
Definition api_core.h:1048
@ SG_DATATYPE_Word
Definition api_core.h:1047
@ SG_DATATYPE_ULong
Definition api_core.h:1051
@ SG_DATATYPE_Float
Definition api_core.h:1053
@ SG_DATATYPE_Undefined
Definition api_core.h:1059
@ SG_DATATYPE_Binary
Definition api_core.h:1058
@ SG_DATATYPE_Double
Definition api_core.h:1054
@ SG_DATATYPE_Color
Definition api_core.h:1057
@ SG_DATATYPE_Int
Definition api_core.h:1050
@ SG_DATATYPE_Char
Definition api_core.h:1046
@ SG_DATATYPE_String
Definition api_core.h:1055
@ SG_DATATYPE_DWord
Definition api_core.h:1049
@ SG_DATATYPE_Date
Definition api_core.h:1056
SAGA_API_DLL_EXPORT void SG_UI_Msg_Flush(void)
#define SG_DEFAULT_DELIMITERS
Definition api_core.h:758
SAGA_API_DLL_EXPORT bool SG_Dir_Delete(const CSG_String &Directory, bool bRecursive=false)
Definition api_file.cpp:993
#define SG_Char
Definition api_core.h:536
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_Params_Set(class CSG_Data_Object *pDataObject, class CSG_Parameters *pParameters)
#define SG_GET_RGB(r, g, b)
Definition api_core.h:1347
TSG_UI_Callback_ID
Definition api_core.h:1681
@ CALLBACK_GET_APP_WINDOW
Definition api_core.h:1727
@ CALLBACK_DLG_INFO
Definition api_core.h:1694
@ CALLBACK_SET_MAP_EXTENT
Definition api_core.h:1716
@ CALLBACK_PROCESS_SET_PROGRESS
Definition api_core.h:1685
@ CALLBACK_STOP_EXECUTION
Definition api_core.h:1689
@ CALLBACK_DLG_ERROR
Definition api_core.h:1693
@ CALLBACK_GET_MAP_EXTENT
Definition api_core.h:1717
@ CALLBACK_WINDOW_ARRANGE
Definition api_core.h:1725
@ CALLBACK_MESSAGE_ADD_ERROR
Definition api_core.h:1699
@ CALLBACK_DATAOBJECT_UPDATE
Definition api_core.h:1704
@ CALLBACK_PROCESS_SET_TEXT
Definition api_core.h:1687
@ CALLBACK_DATAOBJECT_PARAMS_GET
Definition api_core.h:1713
@ CALLBACK_PROCESS_SET_BUSY
Definition api_core.h:1684
@ CALLBACK_DIAGRAM_SHOW
Definition api_core.h:1719
@ CALLBACK_DLG_MESSAGE
Definition api_core.h:1691
@ CALLBACK_CLOUD_STORAGE_UPDATE
Definition api_core.h:1721
@ CALLBACK_DATAOBJECT_COLORS_GET
Definition api_core.h:1708
@ CALLBACK_DLG_CONTINUE
Definition api_core.h:1692
@ CALLBACK_DATAOBJECT_COLORS_SET
Definition api_core.h:1709
@ CALLBACK_DLG_PARAMETERS
Definition api_core.h:1696
@ CALLBACK_MESSAGE_ADD
Definition api_core.h:1698
@ CALLBACK_DATAOBJECT_ASIMAGE
Definition api_core.h:1706
@ CALLBACK_DATAOBJECT_PARAMS_SET
Definition api_core.h:1714
@ CALLBACK_DATABASE_UPDATE
Definition api_core.h:1723
@ CALLBACK_DATAOBJECT_ADD
Definition api_core.h:1702
@ CALLBACK_GET_APP_PATH
Definition api_core.h:1728
@ CALLBACK_DATAOBJECT_SHOW
Definition api_core.h:1705
@ CALLBACK_DATAOBJECT_DEL
Definition api_core.h:1703
@ CALLBACK_PROCESS_SET_READY
Definition api_core.h:1686
@ CALLBACK_PROCESS_GET_OKAY
Definition api_core.h:1682
@ CALLBACK_PROCESS_SET_OKAY
Definition api_core.h:1683
@ CALLBACK_DATAOBJECT_CLASSIFY
Definition api_core.h:1711
@ CALLBACK_MESSAGE_ADD_EXECUTION
Definition api_core.h:1700
SAGA_API_DLL_EXPORT bool SG_File_Cmp_Path(const CSG_String &Path1, const CSG_String &Path2)
SAGA_API_DLL_EXPORT CSG_String operator+(const char *A, const CSG_String &B)
SAGA_API_DLL_EXPORT int SG_UI_Window_Arrange(int Arrange)
SAGA_API_DLL_EXPORT int SG_UI_Progress_Reset(void)
TSG_File_Flags_Encoding
Definition api_core.h:549
@ SG_FILE_ENCODING_UTF16LE
Definition api_core.h:553
@ SG_FILE_ENCODING_UTF16BE
Definition api_core.h:554
@ SG_FILE_ENCODING_UTF8
Definition api_core.h:552
@ SG_FILE_ENCODING_UTF7
Definition api_core.h:551
@ SG_FILE_ENCODING_UNDEFINED
Definition api_core.h:557
@ SG_FILE_ENCODING_ANSI
Definition api_core.h:550
@ SG_FILE_ENCODING_UTF32BE
Definition api_core.h:556
@ SG_FILE_ENCODING_UTF32LE
Definition api_core.h:555
SAGA_API_DLL_EXPORT int SG_Get_Significant_Decimals(double Value, int maxDecimals=6)
SAGA_API_DLL_EXPORT void SG_UI_ProgressAndMsg_Reset(void)
SAGA_API_DLL_EXPORT void SG_Swap_Bytes(void *Buffer, int nBytes)
SAGA_API_DLL_EXPORT CSG_String SG_UI_Set_Application_Name(const CSG_String &Name="")
Definition api_core.cpp:388
SAGA_API_DLL_EXPORT bool SG_UI_Msg_is_Locked(void)
SAGA_API_DLL_EXPORT CSG_String SG_UI_Get_Application_Path(bool bPathOnly=false)
Definition api_core.cpp:356
SAGA_API_DLL_EXPORT CSG_String SG_Dir_Get_User(void)
size_t SG_Data_Type_Get_Size(TSG_Data_Type Type)
Definition api_core.h:1110
SAGA_API_DLL_EXPORT bool SG_UI_Get_Map_Extent(double &xMin, double &yMin, double &xMax, double &yMax)
SAGA_API_DLL_EXPORT bool SG_Set_UI_Callback(TSG_PFNC_UI_Callback Function)
SAGA_API_DLL_EXPORT bool SG_UI_Stop_Execution(bool bDialog)
SAGA_API_DLL_EXPORT CSG_String SG_File_Get_Extension(const CSG_String &File)
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
ESG_File_Flags_Open
Definition api_core.h:1159
@ SG_FILE_W
Definition api_core.h:1161
@ SG_FILE_R
Definition api_core.h:1160
@ SG_FILE_RW
Definition api_core.h:1162
SAGA_API_DLL_EXPORT bool SG_Uninitialize_Environment(void)
Definition api_core.cpp:528
SAGA_API_DLL_EXPORT CSG_String SG_Data_Type_Get_Name(TSG_Data_Type Type, bool bShort=false)
Definition api_core.cpp:123
ESG_Colors
Definition api_core.h:1378
@ SG_COLORS_SPECTRUM_3
Definition api_core.h:1447
@ SG_COLORS_BLUE_YELLOW_RED
Definition api_core.h:1415
@ SG_COLORS_DEFAULT_BRIGHT
Definition api_core.h:1380
@ SG_COLORS_YELLOW_WHITE
Definition api_core.h:1395
@ SG_COLORS_TOPOGRAPHY_3
Definition api_core.h:1427
@ SG_COLORS_WHITE_GREEN
Definition api_core.h:1390
@ SG_COLORS_GREEN_BLUE
Definition api_core.h:1403
@ SG_COLORS_BLACK_GREEN
Definition api_core.h:1386
@ SG_COLORS_PRECIPITATION_1
Definition api_core.h:1437
@ SG_COLORS_PRECIPITATION_3
Definition api_core.h:1439
@ SG_COLORS_WHITE_RED
Definition api_core.h:1389
@ SG_COLORS_RED_GREY_BLUE
Definition api_core.h:1410
@ SG_COLORS_GREEN_WHITE_RED
Definition api_core.h:1406
@ SG_COLORS_WHITE_BLUE
Definition api_core.h:1391
@ SG_COLORS_RED_GREY_GREEN
Definition api_core.h:1412
@ SG_COLORS_RAINBOW_2
Definition api_core.h:1382
@ SG_COLORS_GREEN_GREY_BLUE
Definition api_core.h:1413
@ SG_COLORS_RED_BLUE_GREEN
Definition api_core.h:1421
@ SG_COLORS_BLACK_WHITE
Definition api_core.h:1384
@ SG_COLORS_GREEN_YELLOW_RED
Definition api_core.h:1416
@ SG_COLORS_YELLOW_RED
Definition api_core.h:1397
@ SG_COLORS_NEON
Definition api_core.h:1423
@ SG_COLORS_SPECTRUM_2
Definition api_core.h:1446
@ SG_COLORS_GREEN_GREY_RED
Definition api_core.h:1411
@ SG_COLORS_THERMAL_1
Definition api_core.h:1434
@ SG_COLORS_GREEN_WHITE_BLUE
Definition api_core.h:1407
@ SG_COLORS_BLACK_BLUE
Definition api_core.h:1387
@ SG_COLORS_RED_GREEN_BLUE
Definition api_core.h:1420
@ SG_COLORS_PRECIPITATION_4
Definition api_core.h:1440
@ SG_COLORS_RED_YELLOW_GREEN
Definition api_core.h:1417
@ SG_COLORS_GREEN_YELLOW_BLUE
Definition api_core.h:1418
@ SG_COLORS_ASPECT_3
Definition api_core.h:1432
@ SG_COLORS_YELLOW_BLUE
Definition api_core.h:1399
@ SG_COLORS_TOPOGRAPHY_2
Definition api_core.h:1426
@ SG_COLORS_BLACK_RED
Definition api_core.h:1385
@ SG_COLORS_BLUE_WHITE_RED
Definition api_core.h:1405
@ SG_COLORS_VEGETATION
Definition api_core.h:1443
@ SG_COLORS_TOPOGRAPHY_4
Definition api_core.h:1428
@ SG_COLORS_MAGENTA_WHITE
Definition api_core.h:1394
@ SG_COLORS_SPECTRUM_1
Definition api_core.h:1445
@ SG_COLORS_ASPECT_2
Definition api_core.h:1431
@ SG_COLORS_ASPECT_1
Definition api_core.h:1430
@ SG_COLORS_GREEN_RED
Definition api_core.h:1402
@ SG_COLORS_RAINBOW
Definition api_core.h:1381
@ SG_COLORS_YELLOW_GREEN
Definition api_core.h:1398
@ SG_COLORS_CYAN_WHITE
Definition api_core.h:1393
@ SG_COLORS_THERMAL_2
Definition api_core.h:1435
@ SG_COLORS_GREEN_RED_BLUE
Definition api_core.h:1422
@ SG_COLORS_TOPOGRAPHY
Definition api_core.h:1425
@ SG_COLORS_BLUE_RED
Definition api_core.h:1401
@ SG_COLORS_BLUE_GREY_RED
Definition api_core.h:1409
@ SG_COLORS_DEFAULT
Definition api_core.h:1379
@ SG_COLORS_PRECIPITATION_5
Definition api_core.h:1441
@ SG_COLORS_COUNT
Definition api_core.h:1449
@ SG_COLORS_PRECIPITATION_2
Definition api_core.h:1438
SAGA_API_DLL_EXPORT bool SG_UI_Diagram_Show(class CSG_Table *pTable, class CSG_Parameters *pParameters)
SAGA_API_DLL_EXPORT bool SG_UI_Process_Set_Ready(void)
SAGA_API_DLL_EXPORT bool SG_UI_DataObject_asImage(class CSG_Data_Object *pDataObject, class CSG_Grid *pGrid)
bool is_Zip(void) const
Definition api_core.h:1265
virtual TSG_File_Type Get_File_Type(void) const
Definition api_core.h:1264
TSG_File_Type m_Type
Definition api_core.h:1283
bool is_Tar(void) const
Definition api_core.h:1266
CSG_Archive(void)
Definition api_file.cpp:590
size_t Get_File_Count(void)
Definition api_core.h:1271
virtual bool Open(const SG_Char *FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
Definition api_file.cpp:610
CSG_Array_Pointer m_Files
Definition api_core.h:1287
virtual bool Open(const SG_Char *FileName, int Mode, bool bBinary, int Encoding)
Definition api_core.h:1259
virtual const CSG_String & Get_Archive(void) const
Definition api_core.h:1263
CSG_String m_Archive
Definition api_core.h:1285
bool Set_Growth(TSG_Array_Growth Growth)
Definition api_core.h:433
bool Set_Array(sLong nValues, bool bShrink=true)
Definition api_core.h:442
int * Get_Array(sLong nValues)
Definition api_core.h:440
TSG_Array_Growth Get_Growth(void) const
Definition api_core.h:434
size_t Get_uSize(void) const
Definition api_core.h:437
CSG_Array_Int(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition api_core.h:428
sLong Get_Size(void) const
Definition api_core.h:436
CSG_Array_Int(const CSG_Array_Int &Array)
Definition api_core.h:425
int * Create(const CSG_Array_Int &Array)
int * Get_Array(void) const
Definition api_core.h:439
int Get(sLong Index) const
Definition api_core.h:452
bool Dec_Array(bool bShrink=true)
Definition api_core.h:444
bool Assign(int Value)
bool Set(sLong Index, int Value)
Definition api_core.h:448
int & Get(sLong Index)
Definition api_core.h:450
void Destroy(void)
Definition api_core.h:431
bool Add(int Value)
bool Inc_Array(sLong nValues=1)
Definition api_core.h:443
void Destroy(void)
Definition api_core.h:376
bool Set_Array(sLong nValues, bool bShrink=true)
Definition api_core.h:387
sLong Get_Size(void) const
Definition api_core.h:381
void * Get(sLong Index) const
Definition api_core.h:397
size_t Get_uSize(void) const
Definition api_core.h:382
bool Set_Growth(TSG_Array_Growth Growth)
Definition api_core.h:378
void *& Get(sLong Index)
Definition api_core.h:395
bool Add(void *Value)
TSG_Array_Growth Get_Growth(void) const
Definition api_core.h:379
void ** Get_Array(void) const
Definition api_core.h:384
void ** Get_Array(sLong nValues)
Definition api_core.h:385
bool Dec_Array(bool bShrink=true)
Definition api_core.h:389
bool Set(sLong Index, void *Value)
Definition api_core.h:393
void ** Create(const CSG_Array_Pointer &Array)
CSG_Array_Pointer(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition api_core.h:373
bool Inc_Array(sLong nValues=1)
Definition api_core.h:388
CSG_Array_Pointer(const CSG_Array_Pointer &Array)
Definition api_core.h:370
bool Set_Growth(TSG_Array_Growth Growth)
Definition api_core.h:489
CSG_Array_sLong(const CSG_Array_sLong &Array)
Definition api_core.h:481
sLong & Get(sLong Index)
Definition api_core.h:506
sLong Get_Size(void) const
Definition api_core.h:492
CSG_Array_sLong(sLong nValues=0, TSG_Array_Growth Growth=TSG_Array_Growth::SG_ARRAY_GROWTH_0)
Definition api_core.h:484
bool Dec_Array(bool bShrink=true)
Definition api_core.h:500
size_t Get_uSize(void) const
Definition api_core.h:493
bool Add(sLong Value)
bool Set_Array(sLong nValues, bool bShrink=true)
Definition api_core.h:498
sLong * Get_Array(sLong nValues)
Definition api_core.h:496
sLong * Get_Array(void) const
Definition api_core.h:495
sLong * Create(const CSG_Array_sLong &Array)
void Destroy(void)
Definition api_core.h:487
TSG_Array_Growth Get_Growth(void) const
Definition api_core.h:490
bool Inc_Array(sLong nValues=1)
Definition api_core.h:499
sLong Get(sLong Index) const
Definition api_core.h:508
bool Set(sLong Index, sLong Value)
Definition api_core.h:504
bool Assign(sLong Value)
bool Destroy(void)
void * Create(const CSG_Array &Array)
bool Set_Array(sLong nValues, bool bShrink=true)
void * Get_Array(sLong nValues)
Definition api_core.h:337
size_t Get_Value_Size(void) const
Definition api_core.h:326
CSG_Array(void)
void * Get_Array(void) const
Definition api_core.h:336
sLong Get_Size(void) const
Definition api_core.h:327
size_t Get_uSize(void) const
Definition api_core.h:328
TSG_Array_Growth Get_Growth(void) const
Definition api_core.h:324
void * Get_Entry(sLong Index) const
Returns a pointer to the memory address of the requested variable. You have to type cast and derefere...
Definition api_core.h:331
void Add_Value(float Value, bool bBigEndian=false)
Definition api_core.h:253
float asFloat(int Offset, bool bBigEndian=false) const
Definition api_core.h:270
CSG_Buffer(void)
void Add_Value(char Value, bool bBigEndian=false)
Definition api_core.h:250
bool Inc_Size(size_t Size)
Definition api_core.h:240
void Set_Value(int Offset, short Value, bool bBigEndian=false)
Definition api_core.h:263
int asInt(int Offset, bool bBigEndian=false) const
Definition api_core.h:269
void Set_Value(int Offset, int Value, bool bBigEndian=false)
Definition api_core.h:264
void Set_Value(int Offset, char Value, bool bBigEndian=false)
Definition api_core.h:262
size_t Get_Size(void) const
Definition api_core.h:241
bool Create(void)
bool Set_Size(size_t Size, bool bShrink=true)
void Add_Value(int Value, bool bBigEndian=false)
Definition api_core.h:252
void Add_Value(double Value, bool bBigEndian=false)
Definition api_core.h:254
short asShort(int Offset, bool bBigEndian=false) const
Definition api_core.h:268
void Set_Value(int Offset, double Value, bool bBigEndian=false)
Definition api_core.h:266
void Add_Value(short Value, bool bBigEndian=false)
Definition api_core.h:251
void Set_Value(int Offset, float Value, bool bBigEndian=false)
Definition api_core.h:265
void Destroy(void)
char * Get_Data(int Offset=0) const
Definition api_core.h:244
double asDouble(int Offset, bool bBigEndian=false) const
Definition api_core.h:271
bool Destroy(void)
CSG_Bytes * Get_Bytes(int i)
Definition api_core.h:956
int Get_Count(void) const
Definition api_core.h:955
BYTE Read_Byte(void)
Definition api_core.h:922
DWORD asDWord(int i, bool bSwapBytes=false) const
Definition api_core.h:918
CSG_Bytes(void)
bool Destroy(void)
int Get_Count(void) const
Definition api_core.h:879
DWORD Read_DWord(bool bSwapBytes=false)
Definition api_core.h:927
char asChar(int i) const
Definition api_core.h:914
bool Add(WORD Value, bool bSwapBytes=false)
Definition api_core.h:902
bool Add(DWORD Value, bool bSwapBytes=false)
Definition api_core.h:906
char Read_Char(void)
Definition api_core.h:923
double Read_Double(bool bSwapBytes=false)
Definition api_core.h:929
bool Add(double Value, bool bSwapBytes=false)
Definition api_core.h:910
bool Add(short Value, bool bSwapBytes=false)
Definition api_core.h:900
bool Add(float Value, bool bSwapBytes=false)
Definition api_core.h:908
WORD Read_Word(bool bSwapBytes=false)
Definition api_core.h:925
short asShort(int i, bool bSwapBytes=false) const
Definition api_core.h:915
double asDouble(int i, bool bSwapBytes=false) const
Definition api_core.h:920
bool Add(char Value)
Definition api_core.h:898
WORD asWord(int i, bool bSwapBytes=false) const
Definition api_core.h:916
int Read_Int(bool bSwapBytes=false)
Definition api_core.h:926
bool Add(BYTE Value)
Definition api_core.h:896
bool Assign(const CSG_Bytes &Bytes)
BYTE * Get_Bytes(void) const
Definition api_core.h:880
bool is_EOF(void)
Definition api_core.h:877
BYTE asByte(int i) const
Definition api_core.h:913
CSG_Bytes Get_Bytes(int i) const
Definition api_core.h:882
short Read_Short(bool bSwapBytes=false)
Definition api_core.h:924
float Read_Float(bool bSwapBytes=false)
Definition api_core.h:928
bool Add(int Value, bool bSwapBytes=false)
Definition api_core.h:904
bool Clear(void)
BYTE Get_Byte(int i) const
Definition api_core.h:885
float asFloat(int i, bool bSwapBytes=false) const
Definition api_core.h:919
int asInt(int i, bool bSwapBytes=false) const
Definition api_core.h:917
bool Add(const CSG_Bytes &Bytes)
bool Create(void)
void Rewind(void)
Definition api_core.h:876
bool Set_Palette(const CSG_String &Name, bool bRevert=false, int nColors=0)
Definition api_core.h:1518
long Get_Brightness(int Index) const
Definition api_core.h:1497
long Get_Blue(int Index) const
Definition api_core.h:1496
long Get_Color(int Index) const
Definition api_core.h:1493
bool Set_Count(int nColors)
long Get_Red(int Index) const
Definition api_core.h:1494
CSG_Colors(void)
long Get_Green(int Index) const
Definition api_core.h:1495
bool Set_Palette(int Index, bool bRevert=false, int nColors=0)
Definition api_core.h:1517
bool Create(void)
void Destroy(void)
int Get_Count(void) const
Definition api_core.h:1481
bool Set_Predefined(int Index, bool bRevert=false, int nColors=0)
long Get_Interpolated(double Index) const
Definition api_core.h:1499
virtual bool Open(const SG_Char *FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
Definition api_file.cpp:113
CSG_String m_FileName
Definition api_core.h:1240
int m_Mode
Definition api_core.h:1238
virtual CSG_String Get_File_Name(size_t Index)
Definition api_core.h:1187
virtual const CSG_String & Get_File_Name(void) const
Definition api_core.h:1186
virtual bool Close(void)
Definition api_file.cpp:164
bool is_Open(void) const
Definition api_core.h:1195
CSG_File(void)
Definition api_file.cpp:88
class wxStreamBase * Get_Stream(void) const
Definition api_core.h:1190
void * m_pStream
Definition api_core.h:1242
bool is_Writing(void) const
Definition api_core.h:1197
bool is_Reading(void) const
Definition api_core.h:1196
int Get_Encoding(void) const
Definition api_core.h:1193
virtual TSG_File_Type Get_File_Type(void) const
Definition api_core.h:1188
void * m_pConvert
Definition api_core.h:1242
void On_Construction(void)
Definition api_file.cpp:184
int m_Encoding
Definition api_core.h:1238
size_t Get_Size(void) const
Definition api_core.h:991
bool Clear(bool bFreeMemory=false)
Definition api_core.h:993
void * Get_Record(size_t i) const
Definition api_core.h:1001
size_t Get_RecordSize(void) const
Definition api_core.h:990
bool Destroy(void)
Definition api_core.h:988
void * Get_Record_Pop(void)
Definition api_core.h:1011
void * Get_Array(void) const
Definition api_core.h:1025
void * Get_Record_Push(void)
Definition api_core.h:1006
virtual ~CSG_Stack(void)
Definition api_core.h:986
CSG_Stack(size_t RecordSize)
Definition api_core.h:981
size_t Get_Position(void) const
SG_Char Get_Last_Delimiter(void) const
size_t Get_Tokens_Count(void) const
CSG_String Get_Next_Token(void)
bool Has_More_Tokens(void) const
void Set_String(const CSG_String &String, const CSG_String &Delimiters=SG_DEFAULT_DELIMITERS, TSG_String_Tokenizer_Mode Mode=SG_TOKEN_DEFAULT)
CSG_String Get_String(void) const
const char * b_str(void) const
bool asInt(int &Value) const
void Set_Char(size_t i, char Character)
SG_Char Get_Char(size_t i) const
DWORD asDWord(void) const
Definition api_core.h:676
int asInt(void) const
Definition api_core.h:674
bool asULong(uLong &Value) const
bool asLong(sLong &Value) const
class wxString * m_pString
Definition api_core.h:700
uLong asULong(void) const
Definition api_core.h:680
bool is_Empty(void) const
CSG_String(void)
bool asLongLong(sLong &Value) const
Definition api_core.h:685
class wxString & wx_str(void)
Definition api_core.h:596
const class wxString & wx_str(void) const
Definition api_core.h:595
sLong asLong(void) const
Definition api_core.h:678
double asDouble(void) const
Definition api_core.h:682
bool Create(const class wxString *pString)
const wchar_t * w_str(void) const
sLong asLongLong(void) const
Definition api_core.h:684
bool asDWord(DWORD &Value) const
bool Add(const CSG_Strings &Strings)
CSG_Array_Pointer m_Strings
Definition api_core.h:753
CSG_String & Get_String(int Index) const
Definition api_core.h:735
CSG_String & Get_String(size_t Index) const
Definition api_core.h:736
bool Set_Count(int Count)
Definition api_core.h:723
bool Create(const CSG_Strings &Strings)
bool Assign(const CSG_Strings &Strings)
Definition api_core.h:748
size_t Get_Size(void) const
Definition api_core.h:726
int Get_Count(void) const
Definition api_core.h:725
bool Destroy(void)
bool Del(int Index)
Definition api_core.h:732
void Clear(void)
Definition api_core.h:747
bool Ins(const CSG_String &String, int Index)
Definition api_core.h:730
static CSG_String Html_Absolute_Image_Paths(const CSG_String &Text, const CSG_String &Path, bool bAltAsText=false)
static CSG_String Markdown_to_Html(const CSG_String &Text, bool bSimple=true)
static CSG_String Html_to_Markdown(const CSG_String &Text)
static CSG_String Html_to_SimpleText(const CSG_String &Text)
const SG_Char * Get_Translation(int i) const
Definition api_core.h:1579
bool Create(const CSG_String &File_Name, bool bSetExtension=true, int iText=0, int iTranslation=1, bool bCmpNoCase=false)
bool is_CaseSensitive(void) const
Definition api_core.h:1575
const SG_Char * Get_Text(int i) const
Definition api_core.h:1578
int Get_Count(void) const
Definition api_core.h:1577
CSG_UI_Parameter(const CSG_String &Value)
Definition api_core.h:1740
CSG_UI_Parameter(int Value)
Definition api_core.h:1738
CSG_UI_Parameter(void *Value)
Definition api_core.h:1741
CSG_UI_Parameter(void)
Definition api_core.h:1736
CSG_UI_Parameter(double Value)
Definition api_core.h:1739
CSG_UI_Parameter(bool Value)
Definition api_core.h:1737
CSG_String String
Definition api_core.h:1750
static CSG_String Uncompress(const CSG_String &File, const CSG_String &Target="")
Definition api_file.cpp:939
static bool is_GZip_Supported(void)
Definition api_file.cpp:903
static CSG_String Compress(const CSG_String &File, const CSG_String &Target="")
Definition api_file.cpp:909
CSG_ZLib(void)
Definition api_file.cpp:897
#define B
#define A