当前位置: 首页>>代码示例>>C++>>正文


C++ deserializeToken函数代码示例

本文整理汇总了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();
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:7,代码来源:json_serializer.cpp

示例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();
}
开发者ID:HoRangDev,项目名称:LumixEngine,代码行数:7,代码来源:json_serializer.cpp

示例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();
	}
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:34,代码来源:json_serializer.cpp

示例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();
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:7,代码来源:json_serializer.cpp

示例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();
}
开发者ID:HoRangDev,项目名称:LumixEngine,代码行数:7,代码来源:json_serializer.cpp

示例6: expectToken

void JsonSerializer::nextArrayItem()
{
	if (!m_is_first_in_block)
	{
		expectToken(',');
		deserializeToken();
	}
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:8,代码来源:json_serializer.cpp

示例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();
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:8,代码来源:json_serializer.cpp

示例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();
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:9,代码来源:json_serializer.cpp

示例9: tokenToFloat

void JsonSerializer::deserialize(float& value, float default_value)
{
	if (!m_is_string_token)
	{
		value = tokenToFloat();
	}
	else
	{
		value = default_value;
	}
	deserializeToken();
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:12,代码来源:json_serializer.cpp

示例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
	}

}
开发者ID:mydw,项目名称:mydw,代码行数:21,代码来源:Name.cpp

示例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();
	}
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:13,代码来源:json_serializer.cpp

示例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();
	}
}
开发者ID:Ghost-yc,项目名称:LumixEngine,代码行数:14,代码来源:json_serializer.cpp

示例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();
	}
}
开发者ID:HoRangDev,项目名称:LumixEngine,代码行数:18,代码来源:json_serializer.cpp


注:本文中的deserializeToken函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。