Example #1
0
unistring cMenu::getPropertyField( uint32_t type, SERIAL obj, SERIAL prop, SERIAL subProp, SERIAL subProp2 )
{
	
	VAR_TYPE t = getPropertyType( prop );
	switch( type ) {
	
		case PROpCharACTER: {
			pChar pc = cSerializable::findCharBySerial( obj );
			if ( ! pc ) return unistring();

			switch( t ) {
				case T_CHAR :
					return toWstr( getCharCharProperty( pc, prop, subProp ) );
				case T_INT:
					return toWstr( getCharIntProperty( pc, prop, subProp ) );
				case T_SHORT:
					return toWstr( getCharShortProperty( pc, prop, subProp ) );
				case T_STRING:
					return toWstr( getCharStrProperty( pc, prop, subProp ) );
				case T_UNICODE: 
					return getCharUniProperty( pc, prop, subProp );
			}
		}
		break;
		case PROpItem : {
			pItem pi = cSerializable::findItemBySerial( obj );
			if ( ! pi ) return unistring();

			switch( t ) {
				case T_CHAR :
					return toWstr( getItemCharProperty( pi, prop, subProp ) );
				case T_INT:
					return toWstr( getItemIntProperty( pi, prop, subProp ) );
				case T_SHORT:
					return toWstr( getItemShortProperty( pi, prop, subProp ) );
				case T_STRING:
					return toWstr( getItemStrProperty( pi, prop, subProp ) );
				case T_UNICODE:
					return getItemUniProperty( pi, prop, subProp );
			}
		}
		break;
		case PROP_CALENDAR:
		case PROP_GUILD:
		default:
			return unistring(L"Not implemented yet");
	}


	return unistring( L"Error" );
}
Example #2
0
unistring toWstr( T num )
{
	wchar_t buffer[TEMP_STR_SIZE];
#ifdef WIN32
	swprintf( buffer, L"%i", num );
#else
	swprintf( buffer, TEMP_STR_SIZE, L"%i", num );
#endif

	return unistring( buffer );
}
Example #3
0
 int XmlWriter::write_char_entity(gunichar ch)
 {
   Glib::ustring unistring(1, (gunichar)ch);
   DBG_OUT("write entity %s", unistring.c_str());
   return xmlTextWriterWriteString(m_writer, (const xmlChar*)unistring.c_str());
 }