LMMS
Loading...
Searching...
No Matches
fstreamer.cpp
Go to the documentation of this file.
1//------------------------------------------------------------------------
2// Project : SDK Base
3// Version : 1.0
4//
5// Category : Helpers
6// Filename : base/source/fstreamer.cpp
7// Created by : Steinberg, 15.12.2005
8// Description : Extract of typed stream i/o methods from FStream
9//
10//-----------------------------------------------------------------------------
11// LICENSE
12// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
13//-----------------------------------------------------------------------------
14// Redistribution and use in source and binary forms, with or without modification,
15// are permitted provided that the following conditions are met:
16//
17// * Redistributions of source code must retain the above copyright notice,
18// this list of conditions and the following disclaimer.
19// * Redistributions in binary form must reproduce the above copyright notice,
20// this list of conditions and the following disclaimer in the documentation
21// and/or other materials provided with the distribution.
22// * Neither the name of the Steinberg Media Technologies nor the names of its
23// contributors may be used to endorse or promote products derived from this
24// software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
27// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35// OF THE POSSIBILITY OF SUCH DAMAGE.
36//-----------------------------------------------------------------------------
37
38#include "fstreamer.h"
39
40#include "base/source/fstring.h"
41#include "base/source/fbuffer.h"
43
44#ifndef UNICODE
46#endif
47
48namespace Steinberg {
49
50//------------------------------------------------------------------------
51// IBStreamer
52//------------------------------------------------------------------------
54: FStreamer (_byteOrder)
55, stream (stream)
56{}
57
58//------------------------------------------------------------------------
60{
61 int32 numBytesRead = 0;
62 stream->read (buffer, (int32)size, &numBytesRead);
63 return numBytesRead;
64}
65
66//------------------------------------------------------------------------
67TSize IBStreamer::writeRaw (const void* buffer, TSize size)
68{
69 int32 numBytesWritten = 0;
70 stream->write ((void*)buffer, (int32)size, &numBytesWritten);
71 return numBytesWritten;
72}
73
74//------------------------------------------------------------------------
76{
77 int64 result = -1;
78 stream->seek (pos, mode, &result);
79 return result;
80}
81
82//------------------------------------------------------------------------
84{
85 int64 pos = 0;
86 stream->tell (&pos);
87 return pos;
88}
89
90//------------------------------------------------------------------------
91// FStreamSizeHolder Implementation
92//------------------------------------------------------------------------
96
97//------------------------------------------------------------------------
99{
100 sizePos = stream.tell ();
101 stream.writeInt32 (0L);
102}
103
104//------------------------------------------------------------------------
106{
107 if (sizePos < 0)
108 return 0;
109
110 int64 currentPos = stream.tell ();
111
112 stream.seek (sizePos, kSeekSet);
113 int32 size = int32 (currentPos - sizePos - sizeof (int32));
114 stream.writeInt32 (size);
115
116 stream.seek (currentPos, kSeekSet);
117 return size;
118}
119
120//------------------------------------------------------------------------
122{
123 sizePos = stream.tell ();
124 int32 size = 0;
125 stream.readInt32 (size);
126 sizePos += size + sizeof (int32);
127 return size;
128}
129
130//------------------------------------------------------------------------
132{
133 if (sizePos >= 0)
134 stream.seek (sizePos, kSeekSet);
135}
136
137//------------------------------------------------------------------------
138// FStreamer
139//------------------------------------------------------------------------
141: byteOrder (_byteOrder)
142{}
143
144// int8 / char -----------------------------------------------------------
145//------------------------------------------------------------------------
147{
148 return writeRaw ((void*)&c, sizeof (char8)) == sizeof (char8);
149}
150
151//------------------------------------------------------------------------
153{
154 return readRaw ((void*)&c, sizeof (char8)) == sizeof (char8);
155}
156
157//------------------------------------------------------------------------
158bool FStreamer::writeUChar8 (unsigned char c)
159{
160 return writeRaw ((void*)&c, sizeof (unsigned char)) == sizeof (unsigned char);
161}
162
163//------------------------------------------------------------------------
164bool FStreamer::readUChar8 (unsigned char& c)
165{
166 return readRaw ((void*)&c, sizeof (unsigned char)) == sizeof (unsigned char);
167}
168
169//------------------------------------------------------------------------
171{
172 if (BYTEORDER != byteOrder)
173 SWAP_16 (c);
174 return writeRaw ((void*)&c, sizeof (char16)) == sizeof (char16);
175}
176
177//------------------------------------------------------------------------
179{
180 if (readRaw ((void*)&c, sizeof (char16)) == sizeof (char16))
181 {
182 if (BYTEORDER != byteOrder)
183 SWAP_16 (c);
184 return true;
185 }
186 c = 0;
187 return false;
188}
189
190// int16 -----------------------------------------------------------------
191//------------------------------------------------------------------------
193{
194 if (BYTEORDER != byteOrder)
195 SWAP_16 (i);
196 return writeRaw ((void*)&i, sizeof (int16)) == sizeof (int16);
197}
198
199//------------------------------------------------------------------------
201{
202 if (readRaw ((void*)&i, sizeof (int16)) == sizeof (int16))
203 {
204 if (BYTEORDER != byteOrder)
205 SWAP_16 (i);
206 return true;
207 }
208 i = 0;
209 return false;
210}
211
212//------------------------------------------------------------------------
214{
215 for (int32 i = 0; i < count; i++)
216 {
217 if (!writeInt16 (array[i]))
218 return false;
219 }
220 return true;
221}
222
223//------------------------------------------------------------------------
225{
226 for (int32 i = 0; i < count; i++)
227 {
228 if (!readInt16 (array[i]))
229 return false;
230 }
231 return true;
232}
233
234//------------------------------------------------------------------------
236{
237 if (BYTEORDER != byteOrder)
238 SWAP_16 (i);
239 return writeRaw ((void*)&i, sizeof (uint16)) == sizeof (uint16);
240}
241
242//------------------------------------------------------------------------
244{
245 if (readRaw ((void*)&i, sizeof (uint16)) == sizeof (uint16))
246 {
247 if (BYTEORDER != byteOrder)
248 SWAP_16 (i);
249 return true;
250 }
251 i = 0;
252 return false;
253}
254
255//------------------------------------------------------------------------
257{
258 for (int32 i = 0; i < count; i++)
259 {
260 if (!writeInt16u (array[i]))
261 return false;
262 }
263 return true;
264}
265
266//------------------------------------------------------------------------
268{
269 for (int32 i = 0; i < count; i++)
270 {
271 if (!readInt16u (array[i]))
272 return false;
273 }
274 return true;
275}
276
277// int32 -----------------------------------------------------------------
278//------------------------------------------------------------------------
280{
281 if (BYTEORDER != byteOrder)
282 SWAP_32 (i);
283 return writeRaw ((void*)&i, sizeof (int32)) == sizeof (int32);
284}
285
286//------------------------------------------------------------------------
288{
289 if (readRaw ((void*)&i, sizeof (int32)) == sizeof (int32))
290 {
291 if (BYTEORDER != byteOrder)
292 SWAP_32 (i);
293 return true;
294 }
295 i = 0;
296 return false;
297}
298
299//------------------------------------------------------------------------
301{
302 for (int32 i = 0; i < count; i++)
303 {
304 if (!writeInt32 (array[i]))
305 return false;
306 }
307 return true;
308}
309
310//------------------------------------------------------------------------
312{
313 for (int32 i = 0; i < count; i++)
314 {
315 if (!readInt32 (array[i]))
316 return false;
317 }
318 return true;
319}
320
321//------------------------------------------------------------------------
323{
324 if (BYTEORDER != byteOrder)
325 SWAP_32 (i);
326 return writeRaw ((void*)&i, sizeof (uint32)) == sizeof (uint32);
327}
328
329//------------------------------------------------------------------------
331{
332 if (readRaw ((void*)&i, sizeof (uint32)) == sizeof (uint32))
333 {
334 if (BYTEORDER != byteOrder)
335 SWAP_32 (i);
336 return true;
337 }
338 i = 0;
339 return false;
340}
341
342//------------------------------------------------------------------------
344{
345 for (int32 i = 0; i < count; i++)
346 {
347 if (!writeInt32u (array[i]))
348 return false;
349 }
350 return true;
351}
352
353//------------------------------------------------------------------------
355{
356 for (int32 i = 0; i < count; i++)
357 {
358 if (!readInt32u (array[i]))
359 return false;
360 }
361 return true;
362}
363
364// int64 -----------------------------------------------------------------
365//------------------------------------------------------------------------
367{
368 if (BYTEORDER != byteOrder)
369 SWAP_64 (i);
370 return writeRaw ((void*)&i, sizeof (int64)) == sizeof (int64);
371}
372
373//------------------------------------------------------------------------
375{
376 if (readRaw ((void*)&i, sizeof (int64)) == sizeof (int64))
377 {
378 if (BYTEORDER != byteOrder)
379 SWAP_64 (i);
380 return true;
381 }
382 i = 0;
383 return false;
384}
385
386//------------------------------------------------------------------------
388{
389 for (int32 i = 0; i < count; i++)
390 {
391 if (!writeInt64 (array[i]))
392 return false;
393 }
394 return true;
395}
396
397//------------------------------------------------------------------------
399{
400 for (int32 i = 0; i < count; i++)
401 {
402 if (!readInt64 (array[i]))
403 return false;
404 }
405 return true;
406}
407
408//------------------------------------------------------------------------
410{
411 if (BYTEORDER != byteOrder)
412 SWAP_64 (i);
413 return writeRaw ((void*)&i, sizeof (uint64)) == sizeof (uint64);
414}
415
416//------------------------------------------------------------------------
418{
419 if (readRaw ((void*)&i, sizeof (uint64)) == sizeof (uint64))
420 {
421 if (BYTEORDER != byteOrder)
422 SWAP_64 (i);
423 return true;
424 }
425 i = 0;
426 return false;
427}
428
429//------------------------------------------------------------------------
431{
432 for (int32 i = 0; i < count; i++)
433 {
434 if (!writeInt64u (array[i]))
435 return false;
436 }
437 return true;
438}
439
440//------------------------------------------------------------------------
442{
443 for (int32 i = 0; i < count; i++)
444 {
445 if (!readInt64u (array[i]))
446 return false;
447 }
448 return true;
449}
450
451// float / double --------------------------------------------------------
452//------------------------------------------------------------------------
454{
455 if (BYTEORDER != byteOrder)
456 SWAP_32 (f);
457 return writeRaw ((void*)&f, sizeof (float)) == sizeof (float);
458}
459
460//------------------------------------------------------------------------
462{
463 if (readRaw ((void*)&f, sizeof (float)) == sizeof (float))
464 {
465 if (BYTEORDER != byteOrder)
466 SWAP_32 (f);
467 return true;
468 }
469 f = 0.f;
470 return false;
471}
472
473//------------------------------------------------------------------------
474bool FStreamer::writeFloatArray (const float* array, int32 count)
475{
476 for (int32 i = 0; i < count; i++)
477 {
478 if (!writeFloat (array[i]))
479 return false;
480 }
481 return true;
482}
483
484//------------------------------------------------------------------------
486{
487 for (int32 i = 0; i < count; i++)
488 {
489 if (!readFloat (array[i]))
490 return false;
491 }
492 return true;
493}
494
495//------------------------------------------------------------------------
497{
498 if (BYTEORDER != byteOrder)
499 SWAP_64 (d);
500 return writeRaw ((void*)&d, sizeof (double)) == sizeof (double);
501}
502
503//------------------------------------------------------------------------
505{
506 if (readRaw ((void*)&d, sizeof (double)) == sizeof (double))
507 {
508 if (BYTEORDER != byteOrder)
509 SWAP_64 (d);
510 return true;
511 }
512 d = 0.0;
513 return false;
514}
515
516//------------------------------------------------------------------------
517bool FStreamer::writeDoubleArray (const double* array, int32 count)
518{
519 for (int32 i = 0; i < count; i++)
520 {
521 if (!writeDouble (array[i]))
522 return false;
523 }
524 return true;
525}
526
527//------------------------------------------------------------------------
529{
530 for (int32 i = 0; i < count; i++)
531 {
532 if (!readDouble (array[i]))
533 return false;
534 }
535 return true;
536}
537
538//------------------------------------------------------------------------
540{
541 int16 v = 0;
542 bool res = readInt16 (v);
543 b = (v != 0);
544 return res;
545}
546
547//------------------------------------------------------------------------
549{
550 return writeInt16 ((int16)b);
551}
552
553//------------------------------------------------------------------------
554TSize FStreamer::writeString8 (const char8* ptr, bool terminate)
555{
556 TSize size = strlen (ptr);
557 if (terminate) // write \0
558 size++;
559
560 return writeRaw ((void*)ptr, size);
561}
562
563//------------------------------------------------------------------------
565{
566 TSize i = 0;
567 char8 c = 0;
568 while (i < size)
569 {
570 if (readRaw ((void*)&c, sizeof (char)) != sizeof (char))
571 break;
572 ptr[i] = c;
573 i++;
574 if (c == '\n' || c == '\0')
575 break;
576 }
577 if (c == '\n' && ptr[i - 2] == '\r')
578 ptr[i - 2] = 0;
579 if (i < size)
580 ptr[i] = 0;
581 else
582 ptr[size - 1] = 0;
583
584 return strlen (ptr);
585}
586
587//------------------------------------------------------------------------
589{
590 bool isUtf8 = false;
591
592 String str (ptr);
593 if (str.isAsciiString () == false)
594 {
595 str.toMultiByte (kCP_Utf8);
596 isUtf8 = true;
597 }
598 else
599 {
600 str.toMultiByte ();
601 }
602
603 if (isUtf8)
605 return false;
606
607 TSize size = str.length () + 1;
608 if (writeRaw (str.text8 (), size) != size)
609 return false;
610
611 return true;
612}
613
614//------------------------------------------------------------------------
616{
617 char8 c = 0;
618
619 ptr [0] = 0;
620
621 Buffer tmp;
622 tmp.setDelta (1024);
623
624 while (true)
625 {
626 if (readRaw ((void*)&c, sizeof (char)) != sizeof (char))
627 break;
628 tmp.put (c);
629 if (c == '\0')
630 break;
631 }
632
633 char8* source = tmp.int8Ptr ();
634 uint32 codePage = kCP_Default; // for legacy take default page if no utf8 bom is present...
635 if (tmp.getFillSize () > 2)
636 {
637 if (memcmp (source, kBomUtf8, kBomUtf8Length) == 0)
638 {
639 codePage = kCP_Utf8;
640 source += 3;
641 }
642 }
643
644 if (tmp.getFillSize () > 1)
645 {
646#ifdef UNICODE
647 ConstString::multiByteToWideString (ptr, source, nChars, codePage);
648#else
649 if (codePage == kCP_Utf8)
650 {
651 Buffer wideBuffer (tmp.getFillSize () * 3);
652 ConstString::multiByteToWideString (wideBuffer.wcharPtr (), source, wideBuffer.getSize () / 2, kCP_Utf8);
653 ConstString::wideStringToMultiByte (ptr, wideBuffer.wcharPtr (), nChars);
654 }
655 else
656 {
657 memcpy (ptr, source, Min<TSize> (nChars, tmp.getFillSize ()));
658 }
659#endif
660 }
661
662 ptr[nChars - 1] = 0;
663 return ConstString (ptr).length ();
664}
665
666//------------------------------------------------------------------------
668{
669 int32 length = (s) ? (int32) strlen (s) + 1 : 0;
670 if (!writeInt32 (length))
671 return false;
672
673 if (length > 0)
674 return writeRaw (s, sizeof (char8) * length) == static_cast<TSize>(sizeof (char8) * length);
675
676 return true;
677}
678
679//------------------------------------------------------------------------
681{
682 return sizeof (int32) + (int32)strlen (s) + 1;
683}
684
685//------------------------------------------------------------------------
687{
689 if (!readInt32 (length))
690 return nullptr;
691
692 // check corruption
693 if (length > 262144)
694 return nullptr;
695
696 char8* s = (length > 0) ? NEWVEC char8[length] : nullptr;
697 if (s)
698 readRaw (s, length * sizeof (char8));
699 return s;
700}
701
702//------------------------------------------------------------------------
704{
705 int8 tmp;
706 while (bytes-- > 0)
707 {
708 if (readInt8 (tmp) == false)
709 return false;
710 }
711 return true;
712}
713
714//------------------------------------------------------------------------
716{
717 while (bytes-- > 0)
718 {
719 if (writeInt8 (0) == false)
720 return false;
721 }
722 return true;
723}
724
725//------------------------------------------------------------------------
726} // namespace Steinberg
Definition fbuffer.h:56
uint32 getSize() const
Definition fbuffer.h:101
int8 * int8Ptr() const
conversion
Definition fbuffer.h:201
bool put(uint8)
append value at end, grows Buffer if necessary
Definition fbuffer.cpp:168
void setDelta(uint32 d)
define the block size by which the Buffer grows, see grow()
Definition fbuffer.h:132
uint32 getFillSize() const
Definition fbuffer.h:117
char16 * wcharPtr() const
conversion
Definition fbuffer.h:209
Definition fstring.h:117
bool isAsciiString() const
Checks if all characters in string are in ascii range.
Definition fstring.cpp:1819
static int32 wideStringToMultiByte(char8 *dest, const char16 *source, int32 char8Count, uint32 destCodePage=kCP_Default)
If dest is zero, this returns the maximum number of bytes needed to convert source.
Definition fstring.cpp:1924
static int32 multiByteToWideString(char16 *dest, const char8 *source, int32 wcharCount, uint32 sourceCodePage=kCP_Default)
If dest is zero, this returns the maximum number of bytes needed to convert source.
Definition fstring.cpp:1858
virtual int32 length() const
Return length of string.
Definition fstring.h:128
int64 sizePos
Definition fstreamer.h:211
FStreamSizeHolder(FStreamer &s)
Definition fstreamer.cpp:93
void beginWrite()
remembers position and writes 0
Definition fstreamer.cpp:98
void endRead()
jump to end of chunk
Definition fstreamer.cpp:131
int32 endWrite()
writes and returns size (since the start marker)
Definition fstreamer.cpp:105
FStreamer & stream
Definition fstreamer.h:210
int32 beginRead()
returns size
Definition fstreamer.cpp:121
Definition fstreamer.h:58
char8 * readStr8()
read a string length and string text (The return string must be deleted when use is finished)
Definition fstreamer.cpp:686
virtual TSize writeRaw(const void *, TSize)=0
Write one buffer of size.
bool writeInt32(int32)
Definition fstreamer.cpp:279
bool writeInt64(int64)
Definition fstreamer.cpp:366
bool readDouble(double &)
Definition fstreamer.cpp:504
bool readChar8(char8 &)
Definition fstreamer.cpp:152
TSize writeString8(const char8 *ptr, bool terminate=false)
a direct output function writing only one string (ascii 8bit)
Definition fstreamer.cpp:554
int16 byteOrder
Definition fstreamer.h:171
bool readInt64u(uint64 &)
Definition fstreamer.cpp:417
FStreamer(int16 byteOrder=BYTEORDER)
Definition fstreamer.cpp:140
bool writeUChar8(unsigned char)
Definition fstreamer.cpp:158
bool readInt16u(uint16 &)
Definition fstreamer.cpp:243
bool readInt32Array(int32 *array, int32 count)
Definition fstreamer.cpp:311
bool readInt16uArray(uint16 *array, int32 count)
Definition fstreamer.cpp:267
int32 readStringUtf8(tchar *ptr, int32 maxSize)
read a UTF8 string
Definition fstreamer.cpp:615
bool readInt64uArray(uint64 *array, int32 count)
Definition fstreamer.cpp:441
TSize readString8(char8 *ptr, TSize size)
a direct input function reading only one string (ascii) (ended by a or \0 or eof)
Definition fstreamer.cpp:564
bool writeInt16(int16)
Definition fstreamer.cpp:192
bool skip(uint32 bytes)
Definition fstreamer.cpp:703
bool readInt8(int8 &c)
Definition fstreamer.h:88
bool writeInt16u(uint16)
Definition fstreamer.cpp:235
bool readInt32(int32 &)
Definition fstreamer.cpp:287
bool writeChar8(char8)
Definition fstreamer.cpp:146
bool readInt64(int64 &)
Definition fstreamer.cpp:374
bool writeInt16Array(const int16 *array, int32 count)
Definition fstreamer.cpp:213
bool writeInt64Array(const int64 *array, int32 count)
Definition fstreamer.cpp:387
bool writeInt64u(uint64)
Definition fstreamer.cpp:409
static int32 getStr8Size(const char8 *ptr)
returns the size of a saved string
Definition fstreamer.cpp:680
bool writeStringUtf8(const tchar *ptr)
always terminated, converts to utf8 if non ascii characters are in string
Definition fstreamer.cpp:588
bool writeInt32uArray(const uint32 *array, int32 count)
Definition fstreamer.cpp:343
bool readInt16(int16 &)
Definition fstreamer.cpp:200
bool readInt32uArray(uint32 *array, int32 count)
Definition fstreamer.cpp:354
bool readInt64Array(int64 *array, int32 count)
Definition fstreamer.cpp:398
bool writeInt32u(uint32)
Definition fstreamer.cpp:322
bool writeBool(bool)
Write one boolean.
Definition fstreamer.cpp:548
bool readChar16(char16 &c)
Definition fstreamer.cpp:178
bool readUChar8(unsigned char &)
Definition fstreamer.cpp:164
bool readFloatArray(float *array, int32 count)
Definition fstreamer.cpp:485
bool writeInt64uArray(const uint64 *array, int32 count)
Definition fstreamer.cpp:430
bool pad(uint32 bytes)
Definition fstreamer.cpp:715
bool writeFloatArray(const float *array, int32 count)
Definition fstreamer.cpp:474
bool readFloat(float &)
Definition fstreamer.cpp:461
bool readInt32u(uint32 &)
Definition fstreamer.cpp:330
bool readInt16Array(int16 *array, int32 count)
Definition fstreamer.cpp:224
bool writeChar16(char16 c)
Definition fstreamer.cpp:170
bool writeInt8(int8 c)
Definition fstreamer.h:87
virtual TSize readRaw(void *, TSize)=0
Read one buffer of size.
bool writeInt16uArray(const uint16 *array, int32 count)
Definition fstreamer.cpp:256
bool writeDouble(double)
Definition fstreamer.cpp:496
bool writeFloat(float)
Definition fstreamer.cpp:453
bool writeStr8(const char8 *ptr)
write a string length (strlen) and string itself
Definition fstreamer.cpp:667
bool readBool(bool &)
Read one bool.
Definition fstreamer.cpp:539
bool readDoubleArray(double *array, int32 count)
Definition fstreamer.cpp:528
bool writeDoubleArray(const double *array, int32 count)
Definition fstreamer.cpp:517
bool writeInt32Array(const int32 *array, int32 count)
Definition fstreamer.cpp:300
Definition ibstream.h:30
int64 tell() SMTG_OVERRIDE
Return current file position.
Definition fstreamer.cpp:83
TSize writeRaw(const void *, TSize) SMTG_OVERRIDE
Write one buffer of size.
Definition fstreamer.cpp:67
IBStream * stream
Definition fstreamer.h:238
TSize readRaw(void *, TSize) SMTG_OVERRIDE
Read one buffer of size.
Definition fstreamer.cpp:59
int64 seek(int64, FSeekMode) SMTG_OVERRIDE
Set file position for stream.
Definition fstreamer.cpp:75
IBStreamer(IBStream *stream, int16 byteOrder=BYTEORDER)
Definition fstreamer.cpp:53
Definition fstring.h:308
const char8 * text8() const SMTG_OVERRIDE
Returns pointer to string of type char8.
Definition fstring.h:621
bool toMultiByte(uint32 destCodePage=kCP_Default)
Definition fstring.cpp:2225
unsigned v[N_MAX]
Definition inflate.c:1584
unsigned d
Definition inflate.c:940
register unsigned i
Definition inflate.c:1575
unsigned s
Definition inflate.c:1555
unsigned f
Definition inflate.c:1572
#define NEWVEC
Definition fdebug.h:213
#define SWAP_16(w)
Definition ftypes.h:149
#define SWAP_32(l)
Definition ftypes.h:144
#define SWAP_64(i)
Definition ftypes.h:154
Definition baseiids.cpp:43
unsigned long long uint64
Definition ftypes.h:67
short int16
Definition ftypes.h:43
int16 char16
Definition ftypes.h:101
int int32
Definition ftypes.h:50
int64 TSize
Definition ftypes.h:75
char char8
Definition ftypes.h:93
unsigned short uint16
Definition ftypes.h:44
char int8
Definition ftypes.h:39
long long int64
Definition ftypes.h:66
char16 tchar
Definition ftypes.h:105
FSeekMode
Definition fstreamer.h:46
@ kSeekSet
Definition fstreamer.h:47
@ kCP_Default
Default ANSI codepage.
Definition fstring.h:76
@ kCP_Utf8
UTF8 Encoding.
Definition fstring.h:72
static const char8 *const kBomUtf8
UTF8 Byte Order Mark.
Definition fstring.h:61
const T & Min(const T &a, const T &b)
Definition futils.h:25
static const int32 kBomUtf8Length
Definition fstring.h:62
unsigned int uint32
Definition ftypes.h:51
png_uint_32 length
Definition png.c:2247
png_structrp int mode
Definition png.h:1139
return c
Definition crypt.c:175
memcpy(hh, h, RAND_HEAD_LEN)
b
Definition crypt.c:628
ulg size
Definition extract.c:2350
int result
Definition process.c:1455
_WDL_CSTRING_PREFIX void INT_PTR count
Definition wdlcstring.h:263