Menu

Converting_Enumerations_Into_Their_String_Values_Tutorial

Karl  Jones

This feature is available from version 1-9-1.

Intro

It is now possible to convert a enumeration into its text value.

To use the feature call the function **GetEnumAsString_<enum type>(_ KINT32 Value );**

Examples

1

If we wanted to know what the value 1000 was in the enum WarheadType we would call:

KString s = GetEnumAsStringWarheadType( 1000 );

The variable _s_ would now contain _"HighExplosive_HE_Warhead"._

2

Using the PDU_Factory class we could print out each PDU type.

...
auto_ptr<Header> pHeader = Factory.Decode( cBuffer, ui32Recv );
cout

Related

Wiki: Tutorials

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.