Public Member Functions

nitro::StringCollection Class Reference

#include <utilities/mvc/string_collection.h>

List of all members.

Public Member Functions

virtual std::size_t GetCount (void)=0
virtual const char * GetStringName (std::size_t i)=0
virtual const char * GetValueAsString (const char *StringName)=0
virtual int GetValueAsInteger (const char *StringName)
virtual double GetValueAsFloat (const char *StringName)
virtual const char * GetValueAsString (std::size_t i)
virtual int GetValueAsInteger (std::size_t i)
virtual double GetValueAsFloat (std::size_t i)

Detailed Description

Class provides string collection access.

Author:
Dodonov A.A.

Definition at line 25 of file string_collection.h.


Member Function Documentation

virtual std::size_t nitro::StringCollection::GetCount ( void   )  [pure virtual]

Function returns count of the strings.

Returns:
Count of the strings.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.
virtual const char* nitro::StringCollection::GetStringName ( std::size_t  i  )  [pure virtual]

Function returns string's name.

Parameters:
i - Cursor of the string.
Returns:
Name of the string.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Referenced by GetValueAsFloat(), GetValueAsInteger(), and GetValueAsString().

double nitro::StringCollection::GetValueAsFloat ( std::size_t  i  )  [virtual]

Function returns specified string

Parameters:
i - String's cursor.
Returns:
Float value.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Definition at line 77 of file string_collection.cpp.

References nitro::Converters::atof(), nitro::exception::code(), GetStringName(), GetValueAsString(), and nitro::exception::what().

        {
                try
                {
                        return( nitro::Converters::atof( std::string( GetValueAsString( GetStringName( i ) ) ) ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "StringCollection::GetValueAsFloat( std::size_t i )::" )+ e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "StringCollection::GetValueAsFloat( std::size_t i )::An error occured" , 1 ) );
                }
        }

Here is the call graph for this function:

double nitro::StringCollection::GetValueAsFloat ( const char *  StringName  )  [virtual]

Function returns specified string.

Parameters:
StringName - String's name.
Returns:
Float value.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Definition at line 29 of file string_collection.cpp.

References nitro::Converters::atof(), nitro::exception::code(), GetValueAsString(), and nitro::exception::what().

        {
                try
                {
                        return( nitro::Converters::atof( std::string( GetValueAsString( StringName ) ) ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "StringCollection::GetValueAsFloat( const char * StringName )::" )+ e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "StringCollection::GetValueAsFloat( const char * StringName )::An error occured" , 1 ) );
                }
        }

Here is the call graph for this function:

int nitro::StringCollection::GetValueAsInteger ( const char *  StringName  )  [virtual]

Function returns specified string.

Parameters:
StringName - String's name.
Returns:
Numeric value.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Definition at line 13 of file string_collection.cpp.

References nitro::Converters::atoi(), nitro::exception::code(), GetValueAsString(), and nitro::exception::what().

        {
                try
                {
                        return( nitro::Converters::atoi( std::string( GetValueAsString( StringName ) ) ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "StringCollection::GetValueAsInteger( const char * StringName )::" )+ e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "StringCollection::GetValueAsInteger( const char * StringName )::An error occured" , 1 ) );
                }
        }

Here is the call graph for this function:

int nitro::StringCollection::GetValueAsInteger ( std::size_t  i  )  [virtual]

Function returns specified string

Parameters:
i - String's cursor.
Returns:
Numeric value.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Definition at line 61 of file string_collection.cpp.

References nitro::Converters::atoi(), nitro::exception::code(), GetStringName(), GetValueAsString(), and nitro::exception::what().

        {
                try
                {
                        return( nitro::Converters::atoi( std::string( GetValueAsString( GetStringName( i ) ) ) ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "StringCollection::GetStringValue( std::size_t i )::" )+ e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "StringCollection::GetStringValue( std::size_t i )::An error occured" , 1 ) );
                }
        }

Here is the call graph for this function:

const char * nitro::StringCollection::GetValueAsString ( std::size_t  i  )  [virtual]

Function returns specified string

Parameters:
i - String's cursor.
Returns:

Definition at line 45 of file string_collection.cpp.

References nitro::exception::code(), GetStringName(), GetValueAsString(), and nitro::exception::what().

        {
                try
                {
                        return( GetValueAsString( GetStringName( i ) ) );
                }
                catch( nitro::exception e )
                {
                        throw( nitro::exception( std::string( "StringCollection::GetStringValue( std::size_t i )::" )+ e.what() , e.code() ) );
                }
                catch( ... )
                {
                        throw( nitro::exception( "StringCollection::GetStringValue( std::size_t i )::An error occured" , 1 ) );
                }
        }

Here is the call graph for this function:

virtual const char* nitro::StringCollection::GetValueAsString ( const char *  StringName  )  [pure virtual]

Function returns specified string.

Parameters:
StringName - String's name.
Returns:
Requesting string.
Exceptions:
nitro::exception An exception of this type is thrown if the error occured.
Author:
Dodonov A.A.

Referenced by GetValueAsFloat(), GetValueAsInteger(), and GetValueAsString().


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.1