SAGA API v9.10
Loading...
Searching...
No Matches
api_memory.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_memory.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 "api_core.h"
54
55
57// //
58// //
59// //
61
62#ifndef _WINDOWS_
63
64//---------------------------------------------------------
65void * SG_Malloc(size_t size)
66{
67 return( malloc(size) );
68}
69
70//---------------------------------------------------------
71void * SG_Calloc(size_t num, size_t size)
72{
73 return( calloc(num, size) );
74}
75
76//---------------------------------------------------------
77void * SG_Realloc(void *memblock, size_t new_size)
78{
79 return( realloc(memblock, new_size) );
80}
81
82//---------------------------------------------------------
83void SG_Free(void *memblock)
84{
85 if( memblock )
86 {
87 free(memblock);
88 }
89}
90
91
93// //
94// //
95// //
97
98//---------------------------------------------------------
99// Due to a bad 'feature' in the realloc routine of MS's
100// MSVCRT (C-Runtime-Library), we recommend to use our own
101// memory allocation routines...
102
103#else // ifndef _WINDOWS_
104
105void * SG_Malloc(size_t size)
106{
107 return( HeapAlloc(GetProcessHeap(), 0, size) );
108}
109
110void * SG_Calloc(size_t num, size_t size)
111{
112 return( HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num * size) );
113}
114
115void * SG_Realloc(void *memblock, size_t new_size)
116{
117 if( new_size > 0 )
118 {
119 if( memblock )
120 {
121 return( HeapReAlloc(GetProcessHeap(), 0, memblock, new_size) );
122 }
123 else
124 {
125 return( HeapAlloc(GetProcessHeap(), 0, new_size) );
126 }
127 }
128 else
129 {
130 SG_Free(memblock);
131
132 return( NULL );
133 }
134}
135
136void SG_Free(void *memblock)
137{
138 if( memblock )
139 {
140 HeapFree(GetProcessHeap(), 0, memblock);
141 }
142}
143
144#endif // ifndef _WINDOWS_
145
146
148// //
149// //
150// //
152
153//---------------------------------------------------------
154void SG_Swap_Bytes(void *Buffer, int nBytes)
155{
156 char Byte, *pA, *pB;
157
158 pA = (char *)Buffer;
159 pB = pA + nBytes - 1;
160
161 while( pA < pB )
162 {
163 Byte = *pA;
164 *(pA++) = *pB;
165 *(pB--) = Byte;
166 }
167}
168
169
171// //
172// //
173// //
175
176//---------------------------------------------------------
177int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
178{
179 int Value = *(int *)Buffer;
180
181 if( bSwapBytes )
182 {
183 SG_Swap_Bytes(&Value, sizeof(Value));
184 }
185
186 return( Value );
187}
188
189void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
190{
191 if( bSwapBytes )
192 {
193 SG_Swap_Bytes(&Value, sizeof(Value));
194 }
195
196 *((int *)Buffer) = Value;
197}
198
199//---------------------------------------------------------
200double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
201{
202 double Value = *(double *)Buffer;
203
204 if( bSwapBytes )
205 {
206 SG_Swap_Bytes(&Value, sizeof(Value));
207 }
208
209 return( Value );
210}
211
212void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
213{
214 if( bSwapBytes )
215 {
216 SG_Swap_Bytes(&Value, sizeof(Value));
217 }
218
219 *(double *)Buffer = Value;
220}
221
222
224// //
225// //
226// //
228
229//---------------------------------------------------------
231{
232 m_nBuffer = 0;
233 m_nValues = 0;
234 m_Values = NULL;
235
236 m_Value_Size = sizeof(char);
238}
239
240//---------------------------------------------------------
242{
243 m_nBuffer = 0;
244 m_nValues = 0;
245 m_Values = NULL;
246
247 Create(Array);
248}
249
250void * CSG_Array::Create(const CSG_Array &Array)
251{
252 Destroy();
253
254 m_Value_Size = Array.m_Value_Size;
255 m_Growth = Array.m_Growth;
256
257 if( Array.m_nValues > 0 && Get_Array(Array.m_nValues) )
258 {
259 memcpy(m_Values, Array.m_Values, Array.m_nValues * Array.m_Value_Size);
260 }
261
262 return( Get_Array() );
263}
264
265//---------------------------------------------------------
266CSG_Array::CSG_Array(size_t Value_Size, sLong nValues, TSG_Array_Growth Growth)
267{
268 m_nBuffer = 0;
269 m_nValues = 0;
270 m_Values = NULL;
271
272 Create(Value_Size, nValues, Growth);
273}
274
275void * CSG_Array::Create(size_t Value_Size, sLong nValues, TSG_Array_Growth Growth)
276{
277 Destroy();
278
279 m_Value_Size = Value_Size;
280 m_Growth = Growth;
281
282 return( Get_Array(nValues) );
283}
284
285//---------------------------------------------------------
287{
288 Destroy();
289}
290
292{
293 m_nBuffer = 0;
294 m_nValues = 0;
295
296 SG_FREE_SAFE(m_Values);
297
298 return( true );
299}
300
301//---------------------------------------------------------
303{
304 m_Growth = Growth;
305
306 return( true );
307}
308
309//---------------------------------------------------------
310bool CSG_Array::Set_Array(sLong nValues, bool bShrink)
311{
312 if( nValues >= m_nValues && nValues <= m_nBuffer )
313 {
314 m_nValues = nValues;
315
316 return( true );
317 }
318
319 if( nValues < m_nValues && !bShrink )
320 {
321 m_nValues = nValues;
322
323 return( true );
324 }
325
326 if( nValues == 0 )
327 {
328 Destroy();
329
330 return( true );
331 }
332
333 //-----------------------------------------------------
334 sLong nBuffer;
335
336 switch( m_Growth )
337 {
339 nBuffer = nValues;
340 break;
341
343 nBuffer = nValues < 10 ? nValues
344 : nValues < 100 ? (1 + nValues / 10) * 10
345 : nValues < 1000 ? (1 + nValues / 100) * 100
346 : nValues < 10000 ? (1 + nValues / 1000) * 1000
347 : (1 + nValues / 10000) * 10000;
348 break;
349
351 nBuffer = nValues < 100 ? nValues
352 : nValues < 1000 ? (1 + nValues / 10) * 10
353 : nValues < 10000 ? (1 + nValues / 100) * 100
354 : nValues < 100000 ? (1 + nValues / 1000) * 1000
355 : (1 + nValues / 10000) * 10000;
356 break;
357
359 nBuffer = nValues < 1000 ? (1 + nValues / 1000) * 1000
360 : nValues < 10000 ? (1 + nValues / 10000) * 10000
361 : nValues < 100000 ? (1 + nValues / 100000) * 100000
362 : (1 + nValues / 1000000) * 1000000;
363 break;
364
365 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_8 : nBuffer = (1 + nValues / 8) * 8; break;
366 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_16 : nBuffer = (1 + nValues / 16) * 16; break;
367 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_32 : nBuffer = (1 + nValues / 32) * 32; break;
368 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_64 : nBuffer = (1 + nValues / 64) * 64; break;
369 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_128 : nBuffer = (1 + nValues / 128) * 128; break;
370 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_256 : nBuffer = (1 + nValues / 256) * 256; break;
371 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_512 : nBuffer = (1 + nValues / 512) * 512; break;
372 case TSG_Array_Growth::SG_ARRAY_GROWTH_FIX_1024: nBuffer = (1 + nValues / 1024) * 1024; break;
373 }
374
375 //-----------------------------------------------------
376 if( nBuffer == m_nBuffer )
377 {
378 m_nValues = nValues;
379
380 return( true );
381 }
382
383 //-----------------------------------------------------
384 void *Values = SG_Realloc(m_Values, nBuffer * m_Value_Size);
385
386 if( Values )
387 {
388 m_nBuffer = nBuffer;
389 m_nValues = nValues;
390 m_Values = Values;
391
392 return( true );
393 }
394
395 return( false );
396}
397
398//---------------------------------------------------------
399bool CSG_Array::Set_Array(sLong nValues, void **pArray, bool bShrink)
400{
401 if( Set_Array(nValues, bShrink) )
402 {
403 *pArray = m_Values;
404
405 return( true );
406 }
407
408 *pArray = m_Values;
409
410 return( false );
411}
412
413//---------------------------------------------------------
415{
416 return( Set_Array(m_nValues + nValues) );
417}
418
419bool CSG_Array::Inc_Array (void **pArray)
420{
421 return( Set_Array(m_nValues + 1, pArray) );
422}
423
424//---------------------------------------------------------
425bool CSG_Array::Dec_Array (bool bShrink)
426{
427 return( m_nValues > 0 ? Set_Array(m_nValues - 1, bShrink) : false );
428}
429
430bool CSG_Array::Dec_Array (void **pArray, bool bShrink)
431{
432 return( m_nValues > 0 ? Set_Array(m_nValues - 1, pArray, bShrink) : false );
433}
434
435//---------------------------------------------------------
436bool CSG_Array::Del_Entry(sLong Index, bool bShrink)
437{
438 if( Index >= 0 && Index < m_nValues )
439 {
440 if( Index < m_nValues - 1 )
441 {
442 char *ip = (char *)m_Values + Index * m_Value_Size; char *jp = ip + m_Value_Size;
443
444 for(sLong i=Index, j=Index+1; j<m_nValues; i++, j++, ip+=m_Value_Size, jp+=m_Value_Size)
445 {
446 for(size_t k=0; k<m_Value_Size; k++)
447 {
448 ip[k] = jp[k];
449 }
450 }
451 }
452
453 Set_Array(m_nValues - 1, bShrink);
454
455 return( true );
456 }
457
458 return( false );
459}
460
461
463// //
464// //
465// //
467
468//---------------------------------------------------------
470{
471 m_Array.Create(Array.m_Array);
472
473 return( (void **)m_Array.Get_Array() );
474}
475
476//---------------------------------------------------------
478{
479 m_Array.Create(sizeof(void *), nValues, Growth);
480
481 return( (void **)m_Array.Get_Array() );
482}
483
484//---------------------------------------------------------
485bool CSG_Array_Pointer::Add(void *Value)
486{
487 if( Inc_Array() )
488 {
489 Get_Array()[Get_Size() - 1] = Value;
490
491 return( true );
492 }
493
494 return( false );
495}
496
497//---------------------------------------------------------
499{
500 for(sLong i=0; i<Array.Get_Size(); i++)
501 {
502 if( Add(Array[i]) == false )
503 {
504 return( false );
505 }
506 }
507
508 return( true );
509}
510
511//---------------------------------------------------------
513{
514 if( Index < Get_Size() )
515 {
516 for(sLong i=Index+1; i<Get_Size(); i++, Index++)
517 {
518 (*this)[Index] = (*this)[i];
519 }
520
521 return( Dec_Array() );
522 }
523
524 return( false );
525}
526
527//---------------------------------------------------------
529{
530 sLong n = 0;
531
532 for(sLong i=Get_Size(); i>0; i--)
533 {
534 if( Value == (*this)[i - 1] && Del(i - 1) )
535 {
536 n++;
537 }
538 }
539
540 return( n );
541}
542
543
545// //
546// //
547// //
549
550//---------------------------------------------------------
552{
553 m_Array.Create(Array.m_Array);
554
555 return( (int *)m_Array.Get_Array() );
556}
557
558//---------------------------------------------------------
560{
561 m_Array.Create(sizeof(int), nValues, Growth);
562
563 return( (int *)m_Array.Get_Array() );
564}
565
566//---------------------------------------------------------
567bool CSG_Array_Int::Add(int Value)
568{
569 if( Inc_Array() )
570 {
571 Get_Array()[Get_Size() - 1] = Value;
572
573 return( true );
574 }
575
576 return( false );
577}
578
579//---------------------------------------------------------
581{
582 for(sLong i=0; i<Array.Get_Size(); i++)
583 {
584 if( Add(Array[i]) == false )
585 {
586 return( false );
587 }
588 }
589
590 return( true );
591}
592
593//---------------------------------------------------------
595{
596 for(sLong i=0; i<Get_Size(); i++)
597 {
598 Get_Array()[i] = Value;
599 }
600
601 return( true );
602}
603
604
606// //
607// //
608// //
610
611//---------------------------------------------------------
613{
614 m_Array.Create(Array.m_Array);
615
616 return( (sLong *)m_Array.Get_Array() );
617}
618
619//---------------------------------------------------------
621{
622 m_Array.Create(sizeof(sLong), nValues, Growth);
623
624 return( (sLong *)m_Array.Get_Array() );
625}
626
627//---------------------------------------------------------
629{
630 if( Inc_Array() )
631 {
632 Get_Array()[Get_Size() - 1] = Value;
633
634 return( true );
635 }
636
637 return( false );
638}
639
640//---------------------------------------------------------
642{
643 for(sLong i=0; i<Array.Get_Size(); i++)
644 {
645 if( Add(Array[i]) == false )
646 {
647 return( false );
648 }
649 }
650
651 return( true );
652}
653
654//---------------------------------------------------------
656{
657 for(sLong i=0; i<Get_Size(); i++)
658 {
659 Get_Array()[i] = Value;
660 }
661
662 return( true );
663}
664
665
667// //
668// //
669// //
671
672//---------------------------------------------------------
674{
675 m_Data = NULL;
676 m_Size = 0;
677}
678
680{
681 Destroy();
682
683 return( true );
684}
685
686//---------------------------------------------------------
688{
689 m_Data = NULL;
690 m_Size = 0;
691
692 Create(Buffer);
693}
694
696{
697 return( Set_Data(Buffer.m_Data, Buffer.m_Size) );
698}
699
700//---------------------------------------------------------
702{
703 m_Data = NULL;
704 m_Size = 0;
705
706 Create(Size);
707}
708
709bool CSG_Buffer::Create(size_t Size)
710{
711 return( Set_Size(Size) );
712}
713
714//---------------------------------------------------------
716{
717 Destroy();
718}
719
721{
722 if( m_Data )
723 {
724 SG_Free(m_Data);
725 }
726
727 m_Data = NULL;
728 m_Size = 0;
729}
730
731//---------------------------------------------------------
732bool CSG_Buffer::Set_Size(size_t Size, bool bShrink)
733{
734 if( Size < 1 )
735 {
736 Destroy();
737 }
738 else if( Size > m_Size || (Size < m_Size && bShrink) )
739 {
740 char *Data = (char *)SG_Realloc(m_Data, Size * sizeof(char));
741
742 if( !Data )
743 {
744 return( false );
745 }
746
747 m_Data = Data;
748 m_Size = Size;
749 }
750
751 return( true );
752}
753
754//---------------------------------------------------------
755bool CSG_Buffer::Set_Data(const char *Data, size_t Size, bool bShrink)
756{
757 if( !Data || !Size || !Set_Size(Size, bShrink) )
758 {
759 return( false );
760 }
761
762 memcpy(m_Data, Data, m_Size);
763
764 return( true );
765}
766
767
769// //
770// //
771// //
773
774//---------------------------------------------------------
776{
777 m_Bytes = NULL;
778 m_nBytes = 0;
779 m_nBuffer = 0;
780 m_Cursor = 0;
781}
782
783//---------------------------------------------------------
785{
786 return( Destroy() );
787}
788
789//---------------------------------------------------------
791{
792 m_Bytes = NULL;
793 m_nBytes = 0;
794 m_nBuffer = 0;
795 m_Cursor = 0;
796
797 Create(Bytes);
798}
799
800bool CSG_Bytes::Create(const CSG_Bytes &Bytes)
801{
802 return( Assign(Bytes) );
803}
804
805//---------------------------------------------------------
806CSG_Bytes::CSG_Bytes(const BYTE *Bytes, int nBytes)
807{
808 m_Bytes = NULL;
809 m_nBytes = 0;
810 m_nBuffer = 0;
811 m_Cursor = 0;
812
813 Create(Bytes, nBytes);
814}
815
816bool CSG_Bytes::Create(const BYTE *Bytes, int nBytes)
817{
818 Destroy();
819
820 return( Add((void *)Bytes, nBytes, false) );
821}
822
823//---------------------------------------------------------
825{
826 Destroy();
827}
828
830{
831 if( m_Bytes )
832 {
833 SG_Free(m_Bytes);
834 }
835
836 m_Bytes = NULL;
837 m_nBytes = 0;
838 m_nBuffer = 0;
839 m_Cursor = 0;
840
841 return( true );
842}
843
845{
846 m_nBytes = 0;
847 m_Cursor = 0;
848
849 return( true );
850}
851
852
854// //
856
857//---------------------------------------------------------
858bool CSG_Bytes::_Inc_Array(int nBytes)
859{
860 if( m_nBuffer < m_nBytes + nBytes )
861 {
862 int nBuffer = m_nBuffer + nBytes + 1024;
863 BYTE *Bytes = (BYTE *)SG_Realloc(m_Bytes, nBuffer * sizeof(BYTE));
864
865 if( !Bytes )
866 {
867 return( false );
868 }
869
870 m_Bytes = Bytes;
871 m_nBuffer = nBuffer;
872 }
873
874 m_nBytes += nBytes;
875
876 return( true );
877}
878
879
881// //
883
884//---------------------------------------------------------
885bool CSG_Bytes::Assign(const CSG_Bytes &Bytes)
886{
887 Destroy();
888
889 if( _Inc_Array(Bytes.m_nBytes) )
890 {
891 memcpy(m_Bytes, Bytes.m_Bytes, m_nBytes);
892
893 return( true );
894 }
895
896 return( false );
897}
898
899
901// //
903
904//---------------------------------------------------------
905bool CSG_Bytes::Add(const CSG_Bytes &Bytes)
906{
907 return( Add(Bytes.m_Bytes, Bytes.m_nBytes, false) );
908}
909
910//---------------------------------------------------------
911bool CSG_Bytes::Add(void *Bytes, int nBytes, bool bSwapBytes)
912{
913 int Offset = m_nBytes;
914
915 if( _Inc_Array(nBytes) )
916 {
917 memcpy(m_Bytes + Offset, Bytes, nBytes);
918
919 if( bSwapBytes )
920 {
921 SG_Swap_Bytes(m_Bytes + Offset, nBytes);
922 }
923
924 return( true );
925 }
926
927 return( false );
928}
929
930
932// //
934
935//---------------------------------------------------------
936BYTE SG_Hex_to_Byte (const SG_Char Hex)
937{
938 switch( Hex )
939 {
940 case '1': return( 1 );
941 case '2': return( 2 );
942 case '3': return( 3 );
943 case '4': return( 4 );
944 case '5': return( 5 );
945 case '6': return( 6 );
946 case '7': return( 7 );
947 case '8': return( 8 );
948 case '9': return( 9 );
949 case 'a': case 'A': return( 10 );
950 case 'b': case 'B': return( 11 );
951 case 'c': case 'C': return( 12 );
952 case 'd': case 'D': return( 13 );
953 case 'e': case 'E': return( 14 );
954 case 'f': case 'F': return( 15 );
955 }
956
957 return( 0 );
958}
959
960
962// //
964
965//---------------------------------------------------------
967{
968 CSG_String HexString;
969
970 for(int i=0; i<m_nBytes; i++)
971 {
972 HexString += CSG_String::Format(SG_T("%02X"), m_Bytes[i]);
973 }
974
975 return( HexString );
976}
977
978//---------------------------------------------------------
980{
981 Destroy();
982
983 const SG_Char *s = HexString.c_str();
984
985 for(size_t i=0; i<HexString.Length(); i+=2, s+=2)
986 {
987 Add((BYTE)(SG_Hex_to_Byte(s[1]) + 16 * SG_Hex_to_Byte(s[0])));
988 }
989
990 return( true );
991}
992
993
995// //
996// //
997// //
999
1000//---------------------------------------------------------
1002{
1003 m_pBytes = NULL;
1004 m_nBytes = 0;
1005 m_nBuffer = 0;
1006}
1007
1008//---------------------------------------------------------
1013
1014//---------------------------------------------------------
1016{
1017 if( m_pBytes )
1018 {
1019 for(int i=0; i<m_nBytes; i++)
1020 {
1021 delete(m_pBytes[i]);
1022 }
1023
1024 SG_Free(m_pBytes);
1025 }
1026
1027 m_pBytes = NULL;
1028 m_nBytes = 0;
1029 m_nBuffer = 0;
1030
1031 return( true );
1032}
1033
1034//---------------------------------------------------------
1036{
1037 if( m_nBytes >= m_nBuffer )
1038 {
1039 CSG_Bytes **pBytes = (CSG_Bytes **)SG_Realloc(m_pBytes, ((uLong)m_nBuffer + 256) * sizeof(CSG_Bytes *));
1040
1041 if( !pBytes )
1042 {
1043 return( NULL );
1044 }
1045
1046 m_pBytes = pBytes;
1047 m_nBuffer += 256;
1048 }
1049
1050 return( m_pBytes[m_nBytes++] = new CSG_Bytes );
1051}
1052
1053
1055// //
1056// //
1057// //
1059
1060//---------------------------------------------------------
TSG_Array_Growth
Definition api_core.h:291
unsigned long long uLong
Definition api_core.h:159
signed long long sLong
Definition api_core.h:158
#define SG_T(s)
Definition api_core.h:537
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
SAGA_API_DLL_EXPORT void * SG_Realloc(void *memblock, size_t size)
#define SG_FREE_SAFE(PTR)
Definition api_core.h:205
#define SG_Char
Definition api_core.h:536
SAGA_API_DLL_EXPORT void SG_Swap_Bytes(void *Buffer, int nBytes)
void * SG_Calloc(size_t num, size_t size)
void SG_Mem_Set_Int(char *Buffer, int Value, bool bSwapBytes)
void SG_Mem_Set_Double(char *Buffer, double Value, bool bSwapBytes)
double SG_Mem_Get_Double(const char *Buffer, bool bSwapBytes)
void SG_Swap_Bytes(void *Buffer, int nBytes)
BYTE SG_Hex_to_Byte(const SG_Char Hex)
void SG_Free(void *memblock)
void * SG_Realloc(void *memblock, size_t new_size)
void * SG_Malloc(size_t size)
int SG_Mem_Get_Int(const char *Buffer, bool bSwapBytes)
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
bool Assign(int Value)
bool Add(int Value)
bool Inc_Array(sLong nValues=1)
Definition api_core.h:443
bool Del(sLong Index)
sLong Get_Size(void) const
Definition api_core.h:381
bool Add(void *Value)
void ** Get_Array(void) const
Definition api_core.h:384
bool Dec_Array(bool bShrink=true)
Definition api_core.h:389
void ** Create(const CSG_Array_Pointer &Array)
bool Inc_Array(sLong nValues=1)
Definition api_core.h:388
CSG_Array_Pointer(const CSG_Array_Pointer &Array)
Definition api_core.h:370
CSG_Array_sLong(const CSG_Array_sLong &Array)
Definition api_core.h:481
sLong Get_Size(void) const
Definition api_core.h:492
bool Add(sLong Value)
sLong * Get_Array(void) const
Definition api_core.h:495
sLong * Create(const CSG_Array_sLong &Array)
bool Inc_Array(sLong nValues=1)
Definition api_core.h:499
bool Assign(sLong Value)
bool Destroy(void)
void * Create(const CSG_Array &Array)
bool Set_Array(sLong nValues, bool bShrink=true)
~CSG_Array(void)
bool Inc_Array(sLong nValues=1)
bool Dec_Array(bool bShrink=true)
bool Set_Growth(TSG_Array_Growth Growth)
bool Del_Entry(sLong Index, bool bShrink=true)
CSG_Array(void)
void * Get_Array(void) const
Definition api_core.h:336
virtual ~CSG_Buffer(void)
CSG_Buffer(void)
bool Create(void)
bool Set_Size(size_t Size, bool bShrink=true)
bool Set_Data(const char *Data, size_t Size, bool bShrink=true)
void Destroy(void)
CSG_Bytes * Add(void)
bool Destroy(void)
virtual ~CSG_Bytes_Array(void)
bool fromHexString(const CSG_String &HexString)
CSG_Bytes(void)
bool Destroy(void)
CSG_String toHexString(void) const
bool Assign(const CSG_Bytes &Bytes)
bool Clear(void)
virtual ~CSG_Bytes(void)
bool Add(const CSG_Bytes &Bytes)
bool Create(void)
size_t Length(void) const
static CSG_String Format(const char *Format,...)
const SG_Char * c_str(void) const