37 #define QUOTE_IT(parm) #parm 42 template <
typename T,
size_t N>
43 constexpr
size_t countof(T
const (&)[N]) noexcept {
56 bool DeSerialize(FILE* fp,
char* data,
size_t n = 1);
57 bool DeSerialize(FILE* fp,
float* data,
size_t n = 1);
58 bool DeSerialize(FILE* fp, int8_t* data,
size_t n = 1);
59 bool DeSerialize(FILE* fp, int16_t* data,
size_t n = 1);
60 bool DeSerialize(FILE* fp, int32_t* data,
size_t n = 1);
61 bool DeSerialize(FILE* fp, uint8_t* data,
size_t n = 1);
62 bool DeSerialize(FILE* fp, uint16_t* data,
size_t n = 1);
63 bool DeSerialize(FILE* fp, uint32_t* data,
size_t n = 1);
66 bool Serialize(FILE* fp,
const char* data,
size_t n = 1);
67 bool Serialize(FILE* fp,
const float* data,
size_t n = 1);
68 bool Serialize(FILE* fp,
const int8_t* data,
size_t n = 1);
69 bool Serialize(FILE* fp,
const int16_t* data,
size_t n = 1);
70 bool Serialize(FILE* fp,
const int32_t* data,
size_t n = 1);
71 bool Serialize(FILE* fp,
const uint8_t* data,
size_t n = 1);
72 bool Serialize(FILE* fp,
const uint16_t* data,
size_t n = 1);
73 bool Serialize(FILE* fp,
const uint32_t* data,
size_t n = 1);
87 bool Open(
const char* data,
int size);
89 bool Open(FILE* fp, int64_t end_offset);
102 bool DeSerialize(uint16_t* data,
size_t count = 1);
103 bool DeSerialize(uint32_t* data,
size_t count = 1);
104 bool DeSerialize(uint64_t* data,
size_t count = 1);
107 bool Serialize(
const char* data,
size_t count = 1);
108 bool Serialize(
const double* data,
size_t count = 1);
109 bool Serialize(
const float* data,
size_t count = 1);
110 bool Serialize(
const int8_t* data,
size_t count = 1);
111 bool Serialize(
const int16_t* data,
size_t count = 1);
112 bool Serialize(
const int32_t* data,
size_t count = 1);
113 bool Serialize(
const int64_t* data,
size_t count = 1);
114 bool Serialize(
const uint8_t* data,
size_t count = 1);
115 bool Serialize(
const uint16_t* data,
size_t count = 1);
116 bool Serialize(
const uint32_t* data,
size_t count = 1);
117 bool Serialize(
const uint64_t* data,
size_t count = 1);
120 bool Skip(
size_t count);
126 char*
FGets(
char* buffer,
int buffer_size);
130 int FReadEndian(
void* buffer,
size_t size,
int count);
132 int FRead(
void* buffer,
size_t size,
int count);
145 int FWrite(
const void* buffer,
size_t size,
int count);
~TFile()
Definition: serialis.cpp:98
bool Open(const STRING &filename, FileReader reader)
Definition: serialis.cpp:196
bool(* FileReader)(const STRING &filename, GenericVector< char > *data)
Definition: genericvector.h:360
Definition: serialis.h:77
Definition: baseapi.cpp:94
int FRead(void *buffer, size_t size, int count)
Definition: serialis.cpp:270
bool swap_
Definition: serialis.h:157
bool is_writing_
Definition: serialis.h:155
void Rewind()
Definition: serialis.cpp:290
void set_swap(bool value)
Definition: serialis.h:91
bool(* FileWriter)(const GenericVector< char > &data, const STRING &filename)
Definition: genericvector.h:363
bool DeSerialize(char *data, size_t count=1)
Definition: serialis.cpp:103
int FReadEndian(void *buffer, size_t size, int count)
Definition: serialis.cpp:259
bool Serialize(FILE *fp, const char *data, size_t n)
Definition: serialis.cpp:59
bool CloseWrite(const STRING &filename, FileWriter writer)
Definition: serialis.cpp:310
int offset_
Definition: serialis.h:149
int FWrite(const void *buffer, size_t size, int count)
Definition: serialis.cpp:318
bool data_is_owned_
Definition: serialis.h:153
bool Serialize(const char *data, size_t count=1)
Definition: serialis.cpp:147
TFile()
Definition: serialis.cpp:91
constexpr size_t countof(T const (&)[N]) noexcept
Definition: serialis.h:43
GenericVector< char > * data_
Definition: serialis.h:151
bool Skip(size_t count)
Definition: serialis.cpp:191
bool DeSerialize(FILE *fp, char *data, size_t n)
Definition: serialis.cpp:27
char * FGets(char *buffer, int buffer_size)
Definition: serialis.cpp:248
void OpenWrite(GenericVector< char > *data)
Definition: serialis.cpp:295