79 memset( utf8Name, 0,
sizeof( utf8Name ) );
84 while( aStream.peek() !=
'\n' && !aStream.eof() )
86 aStream.read( &temp, 1 );
87 utf8Name[idx++] = temp;
90 MultiByteToWideChar( CP_UTF8, 0, utf8Name, -1, tcharName, 200 );
156 std::ofstream &aStream
159 int nameLength = WideCharToMultiByte( CP_UTF8, 0,
mCurrentName, -1, NULL, 0, NULL, NULL );
160 char* name =
new char[nameLength];
162 WideCharToMultiByte( CP_UTF8, 0,
mCurrentName, -1, name, nameLength, NULL, NULL );
163 aStream <<
mId <<
"-" << name <<
'\n';
BOOL isValid() const
Check whether this item is valid.
ClientListItem()
Constructor.
void setId(const key_type &aId)
Set item's ID.
virtual void readFromStream(std::istream &aStream)
Read a ClientListItem from an input stream.
virtual void save()
Save this item.
CString getCurrentName() const
Get the current name of this item.
CString mUpdateName
The last name entered by the user.
const key_type & getId() const
Get item's ID.
void commitName()
Commit the item name.
void setValid(BOOL aValid=TRUE)
Set this item as valid.
virtual void writeToStream(std::ofstream &aStream) const
Write a ClientListItem to an output stream.
CString mCurrentName
The last name acknowledged by the client.
void setUpdateName(CString aName)
Set pending name.
BOOL mIsValid
True if this list item is mIsValid.
void setParent(FileBackedMap< ClientListItem > *aParent)
Set the parent.
FileBackedMap< ClientListItem > * mParent
The map that this item belongs to, or NULL if none.
key_type mId
The unique ID of this item.
void save()
Save the map to disk.