Skip to content

Implement WideString #34

Description

@xPaw

CS:GO implements it like this:

// write
{
	int nLength = dat->m_wsValue ? V_wcslen( dat->m_wsValue ) : 0;
	buffer.PutShort( nLength );
	for( int k = 0; k < nLength; ++ k )
	{
		buffer.PutShort( ( unsigned short ) dat->m_wsValue[k] );
	}
	break;
}

// read
{
	int nLength = buffer.GetShort();

	dat->m_wsValue = new wchar_t[nLength + 1];

	for( int k = 0; k < nLength; ++ k )
	{
		dat->m_wsValue[k] = buffer.GetShort();
	}
	dat->m_wsValue[ nLength ] = 0;
	break;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions