예제 #1
0
	void read_line(DynamicString& line)
	{
		const char* s  = &_str[_pos];
		const char* nl = strnl(s);
		_pos += u32(nl - s);
		line.set(s, nl - s);
	}
예제 #2
0
파일: Guid.cpp 프로젝트: XoDeR/Amstel
	void toString(const Guid& guid, DynamicString& s)
	{
		char str[36+1];
		snPrintF(str, sizeof(str), "%.8x-%.4x-%.4x-%.4x-%.4x%.8x"
			, guid.data1
			, guid.data2
			, guid.data3
			, (uint16_t)((guid.data4 & 0xffff000000000000u) >> 48)
			, (uint16_t)((guid.data4 & 0x0000ffff00000000u) >> 32)
			, (uint32_t)((guid.data4 & 0x00000000ffffffffu) >>  0)
			);
		s.set(str, sizeof(str)-1);
	}
예제 #3
0
void StringId64::to_string(DynamicString& s)
{
	char buf[16+1];
	snprintf(buf, sizeof(buf), "%.16" PRIx64, _id);
	s.set(buf, sizeof(buf)-1);
}
예제 #4
0
void StringId32::to_string(DynamicString& s)
{
	char buf[8+1];
	snprintf(buf, sizeof(buf), "%.8x", _id);
	s.set(buf, sizeof(buf)-1);
}