예제 #1
0
Firebird::string Stream::getFBString() const
{
	Firebird::string string;
	char *p = string.getBuffer (totalLength);

	for (const Segment *segment = segments; segment; segment = segment->next)
	{
		memcpy (p, segment->address, segment->length);
		p += segment->length;
	}

	fb_assert(p - string.begin() == totalLength);

	return string;
}
예제 #2
0
size_t PAR_name(CompilerScratch* csb, Firebird::string& name)
{
/**************************************
 *
 *	P A R _ n a m e
 *
 **************************************
 *
 * Functional description
 *	Parse a counted string of virtually unlimited size
 *  (up to 64K, actually <= 255), returning count.
 *
 **************************************/
	size_t l = csb->csb_blr_reader.getByte();
	char* s = name.getBuffer(l);

	while (l--)
		*s++ = csb->csb_blr_reader.getByte();

	return name.length();
}