Photon C++ Client API  5.0.7.3
Public Member Functions | List of all members
ToString Class Referenceabstract
Inheritance diagram for ToString:
Inheritance graph
[legend]

Public Member Functions

virtual ~ToString (void)
 
virtual JString typeToString (void) const
 
virtual JStringtoString (JString &retStr, bool withTypes=false) const =0
 
JString toString (bool withTypes=false) const
 

Detailed Description

This class provides an interface for printing the payload of an instance of any subclass to a string.

Every subclass of this class will provide an implementation for toString() in its public interface and will therefor be printable. The implementations for container classes will include the output-strings of their elements into their own output string.

This class provides a default implementation for ToString::toString that simply returns the class name.

Inherit from this class instead of from ToString, when your class needs to implement the ToString interface, but does not have any meaningful payload to return. You should prefer to inherit from ToString and add a meaningful implementation whenever this makes sense.

Constructor & Destructor Documentation

◆ ~ToString()

~ToString ( void  )
virtual

Destructor.

Member Function Documentation

◆ typeToString()

JString typeToString ( void  ) const
virtual
Remarks
This function is intended for debugging purposes. For runtime type checking you should use RTTI's typeid() instead. Demangling and cutting off of namespaces will only happen on platforms, which offer a system functionality for demangling.
Returns
a string representation of the class name of the polymorphically correct runtime class of the instance, on which it is called on, after this class name has been demangled and eventual namespaces have been removed.

Reimplemented in Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, Dictionary< nByte, Common::Object >, DictionaryBase, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, and Dictionary< nByte, Common::Object >.

◆ toString() [1/2]

toString ( JString retStr,
bool  withTypes = false 
) const
pure virtual
Remarks
The cost of this function depends a lot on implementation details of the implementing subclasses, but for container classes this function can become quite expensive, if the instance contains huge amounts of data, as its cost for many container class implementations increases disproportionately high to the size of the payload.
Parameters
retStrreference to a string, to store the return-value in; the information, which is generated by this function, will be attached at the end of any eventually existing previous content of the string
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.

Implemented in JString, Dictionary< EKeyType, EValueType >, Dictionary< nByte, ExitGames::Common::Object >, Dictionary< ExitGames::Common::Object, ExitGames::Common::Object >, Dictionary< nByte, Common::Object >, SequenceContainer< T, Etype >, SequenceContainer< JVector, ExitGames::LoadBalancing::FriendInfo >, SequenceContainer< JList, Etype >, SequenceContainer< JVector, ExitGames::LoadBalancing::Player * >, SequenceContainer< JVector, ExitGames::Common::Object >, SequenceContainer< JVector, ExitGames::Chat::Channel * >, SequenceContainer< JQueue, SendFrameEventParams >, SequenceContainer< JVector, Etype >, SequenceContainer< JVector, Common::Helpers::SharedPointer< ExitGames::Voice::IProcessor< T > > >, SequenceContainer< JVector, ExitGames::Common::JString >, SequenceContainer< JVector, int >, SequenceContainer< JStack, Etype >, SequenceContainer< JVector, ExitGames::LoadBalancing::LobbyStatsRequest >, SequenceContainer< JQueue, Etype >, SequenceContainer< JArray, Etype >, SequenceContainer< JQueue, ExitGames::Voice::Buffer< nByte > >, SequenceContainer< JVector, Object >, SequenceContainer< JVector, ExitGames::Common::JVector< unsigned int > >, SequenceContainer< JVector, OT >, SequenceContainer< JLinkedList, Etype >, SequenceContainer< JVector, JObject >, SequenceContainer< JQueue, ExitGames::Voice::Buffer< T > >, SequenceContainer< JVector, ExitGames::LoadBalancing::Room * >, SequenceContainer< JHashSet, Etype >, SequenceContainer< JVector, unsigned int >, AssociativeContainerBase< T, OT >, AssociativeContainerBase< JHashtable, JObject >, AssociativeContainerBase< Hashtable, Object >, AssociativeContainerBase< T, JObject >, Object, JTime, DictionaryBase, JObject, Serializer, GenericAssociativeContainerBase< T, TImplementation, TObject >, GenericAssociativeContainerBase< JDictionary< int, ExitGames::Common::JDictionary< nByte, Common::Helpers::SharedPointer< ExitGames::Voice::RemoteVoice > > >, JHashtable, JObject >, GenericAssociativeContainerBase< JDictionary< nByte, int >, JHashtable, JObject >, GenericAssociativeContainerBase< JDictionary< int, ExitGames::Common::JVector< Common::Helpers::SharedPointer< ExitGames::Voice::LocalVoice > > >, JHashtable, JObject >, GenericAssociativeContainerBase< JSortedList< EKeyType, EValueType >, JHashtable, JObject >, GenericAssociativeContainerBase< JDictionary< nByte, Common::Helpers::SharedPointer< ExitGames::Voice::LocalVoice > >, JHashtable, JObject >, GenericAssociativeContainerBase< DictionaryBase, Hashtable, Object >, GenericAssociativeContainerBase< JDictionary< EKeyType, EValueType >, JHashtable, JObject >, GenericAssociativeContainerBase< T< EKeyType, EValueType >, JHashtable, JObject >, BaseCharString, Deserializer, ToStringDefaultImplementation, LoadBalancingTransport, RoomOptions, LocalVoice, VoiceInfo, TrafficStatsGameLevel, RaiseEventOptions, AuthenticationValues, AuthenticationValues, LogFormatOptions, TrafficStats, ClientConstructOptions, RemoteVoiceOptions, ConnectOptions, Channel, Logger, Player, Room, SendDirectOptions, RemoteVoice, WebFlags, ToneAudioPusher< T >, Buffer< T >, Buffer< nByte >, RemoteVoiceInfo, FriendInfo, LobbyStatsRequest, and LobbyStatsResponse.

◆ toString() [2/2]

JString toString ( bool  withTypes = false) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
withTypesset to true, to include type information in the generated string
Returns
a JString representation of the instance and its contents for debugging purposes.
See also
JString