本文整理汇总了C++中deserializeToken函数的典型用法代码示例。如果您正苦于以下问题:C++ deserializeToken函数的具体用法?C++ deserializeToken怎么用?C++ deserializeToken使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deserializeToken函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserializeLabel
void JsonSerializer::deserializeArrayBegin(const char* label)
{
deserializeLabel(label);
expectToken('[');
m_is_first_in_block = true;
deserializeToken();
}
示例2: memcpy
void JsonSerializer::deserializeRawString(char* buffer, int max_length)
{
int size = Math::minValue(max_length - 1, m_token_size);
memcpy(buffer, m_token, size);
buffer[size] = '\0';
deserializeToken();
}
示例3: m_file
JsonSerializer::JsonSerializer(FS::IFile& file,
AccessMode access_mode,
const Path& path,
IAllocator& allocator)
: m_file(file)
, m_access_mode(access_mode)
, m_allocator(allocator)
{
m_is_error = false;
copyString(m_path, path.c_str());
m_is_first_in_block = true;
m_data = nullptr;
m_is_string_token = false;
if (m_access_mode == READ)
{
m_data_size = (int)file.size();
if (file.getBuffer() != nullptr)
{
m_data = (const char*)file.getBuffer();
m_own_data = false;
}
else
{
int size = (int)m_file.size();
char* data = (char*)m_allocator.allocate(size);
m_own_data = true;
file.read(data, m_data_size);
m_data = data;
}
m_token = m_data;
m_token_size = 0;
deserializeToken();
}
}
示例4: copyMemory
void JsonSerializer::deserializeRawString(char* buffer, int max_length)
{
int size = Math::minimum(max_length - 1, m_token_size);
copyMemory(buffer, m_token, size);
buffer[size] = '\0';
deserializeToken();
}
示例5: deserializeToken
void JsonSerializer::deserialize(bool& value, bool default_value)
{
value = !m_is_string_token
? m_token_size == 4 && (strncmp(m_token, "true", 4) == 0)
: default_value;
deserializeToken();
}
示例6: expectToken
void JsonSerializer::nextArrayItem()
{
if (!m_is_first_in_block)
{
expectToken(',');
deserializeToken();
}
}
示例7: deserializeToken
void JsonSerializer::deserialize(int32& value, int32 default_value)
{
if (m_is_string_token || !fromCString(m_token, m_token_size, &value))
{
value = default_value;
}
deserializeToken();
}
示例8: deserializeArrayComma
void JsonSerializer::deserializeArrayItem(int64& value, int64 default_value)
{
deserializeArrayComma();
if (m_is_string_token || !fromCString(m_token, m_token_size, &value))
{
value = default_value;
}
deserializeToken();
}
示例9: tokenToFloat
void JsonSerializer::deserialize(float& value, float default_value)
{
if (!m_is_string_token)
{
value = tokenToFloat();
}
else
{
value = default_value;
}
deserializeToken();
}
示例10: throw
xsd__Name Name::deserializeName(const AxisChar* valueAsChar) throw (AxisSoapException)
{
#ifdef ENABLE_AXISTRACE
if (axiscpp::AxisTrace::isTraceOn())
axiscpp::AxisTrace::traceEntry("Name", "deserializeName", this, 1,
TRACETYPE_STRING, 0, ((void*)&valueAsChar)); /* AUTOINSERTED TRACE */
#endif
{
#ifdef ENABLE_AXISTRACE
xsd__Name traceRet = ((AxisChar*) deserializeToken(valueAsChar));
if (axiscpp::AxisTrace::isTraceOn())
axiscpp::AxisTrace::traceExit("Name", "deserializeName", this, 0,
TRACETYPE_DATA, sizeof(xsd__Name), ((void*)&traceRet)); /* AUTOINSERTED TRACE */
return traceRet;
#else
return (AxisChar*) deserializeToken(valueAsChar);
#endif
}
}
示例11: ErrorProxy
void JsonSerializer::expectToken(char expected_token)
{
if (m_is_string_token || m_token_size != 1 || m_token[0] != expected_token)
{
char tmp[2];
tmp[0] = expected_token;
tmp[1] = 0;
ErrorProxy(*this).log() << "Unexpected token \""
<< string(m_token, m_token_size, m_allocator) << "\", expected "
<< tmp << ".";
deserializeToken();
}
}
示例12: copyString
void JsonSerializer::deserialize(char* value, int max_length, const char* default_value)
{
if (!m_is_string_token)
{
copyString(value, max_length, default_value);
}
else
{
int size = Math::minimum(max_length - 1, m_token_size);
copyMemory(value, m_token, size);
value[size] = '\0';
deserializeToken();
}
}
示例13: deserializeLabel
void JsonSerializer::deserialize(const char* label,
char* value,
int max_length,
const char* default_value)
{
deserializeLabel(label);
if (!m_is_string_token)
{
copyString(value, max_length, default_value);
}
else
{
int size = Math::minValue(max_length - 1, m_token_size);
memcpy(value, m_token, size);
value[size] = '\0';
deserializeToken();
}
}