24 #ifndef _WRITE_UTILS_H_
25 #define _WRITE_UTILS_H_
35 #define STL_USING_VECTOR
36 #define STL_USING_STRING
67 template<
class ValueType,
class BufferType>
68 inline OdUInt32 writeValue(
const ValueType& valueToWrite, BufferType& writeBuffer,
const OdUInt64& writeBufferSize,
const char* printfTemplate)
70 #if defined(_MSC_VER) && _MSC_VER < 1900
71 return _snprintf(
reinterpret_cast<char* const
>(&writeBuffer[0]), writeBufferSize, printfTemplate, valueToWrite);
73 return snprintf(
reinterpret_cast<char* const
>(&writeBuffer[0]), writeBufferSize, printfTemplate, valueToWrite);
77 template<
class ValueType, OdUInt64 writeBufferSize>
78 inline OdUInt32 appendValue(
const ValueType& valueToWrite, std::vector<OdUInt8>& writeBuffer,
const char* printfTemplate)
80 OdUInt8* appendBuffer[writeBufferSize + 1] = { 0 };
81 OdUInt32 countWrite =
writeValue(valueToWrite, appendBuffer, writeBufferSize + 1, printfTemplate);
88 OdUInt64 insertionIndex = writeBuffer.size();
89 writeBuffer.resize(insertionIndex + countWrite);
90 memcpy(&writeBuffer[insertionIndex], &appendBuffer[0], countWrite);
95 template<
class ValueType, OdUInt64 writeBufferSize>
96 inline OdUInt32 writeValue(
const ValueType& valueToWrite, std::vector<OdUInt8>& writeBuffer,
const char* printfTemplate)
98 return appendValue<ValueType, writeBufferSize>(valueToWrite, writeBuffer, printfTemplate);
101 template<
class ValueType, OdUInt64 writeBufferSize>
104 return writeValue(valueToWrite, writeBuffer, writeBufferSize, printfTemplate);
GLsizei const GLchar *const * string
const OdUInt32 writeErorCode
OdUInt32 appendValue(const OdDbHandle &valueToWrite, std::vector< OdUInt8 > &writeBuffer)
OdUInt32 writeValue(const OdDbHandle &valueToWrite, std::vector< OdUInt8 > &writeBuffer)