CeylanOperators.h File Reference

#include "CeylanException.h"
#include "CeylanDisplayable.h"
#include "CeylanTypes.h"
#include <string>
#include <list>

Include dependency graph for CeylanOperators.h:

Go to the source code of this file.


Namespaces

namespace  Ceylan
 This part of the Ceylan namespace gathers some convenient string manipulation facilities to be widely used.

Functions

CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Sint8 i)
 This module offers the operators lacking in C++ in order to perform appending of numerical values to standard strings, and basic string conversion.
CEYLAN_DLL std::string operator+ (Ceylan::Sint8 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Uint8 i)
CEYLAN_DLL std::string operator+ (Ceylan::Uint8 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Sint16 i)
CEYLAN_DLL std::string operator+ (Ceylan::Sint16 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Uint16 i)
CEYLAN_DLL std::string operator+ (Ceylan::Uint16 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Sint32 i)
CEYLAN_DLL std::string operator+ (Ceylan::Sint32 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Uint32 i)
CEYLAN_DLL std::string operator+ (Ceylan::Uint32 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::SignedLongInteger i)
CEYLAN_DLL std::string operator+ (Ceylan::SignedLongInteger i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::UnsignedLongInteger i)
CEYLAN_DLL std::string operator+ (Ceylan::UnsignedLongInteger i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Float32 i)
CEYLAN_DLL std::string operator+ (Ceylan::Float32 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::Float64 i)
CEYLAN_DLL std::string operator+ (Ceylan::Float64 i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, Ceylan::LongFloat i)
CEYLAN_DLL std::string operator+ (Ceylan::LongFloat i, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &s, const void *p)
CEYLAN_DLL std::string operator+ (const void *p, const std::string &s)
CEYLAN_DLL std::string operator+ (const std::string &a, const char *b)
CEYLAN_DLL std::string operator+ (const char *a, const std::string &b)
CEYLAN_DLL std::string Ceylan::toString (const void *pointer)
 Returns a user-friendly representation of a pointer.
CEYLAN_DLL std::string Ceylan::toString (bool value)
 Returns a user-friendly textual representation of a bool ("true" or "false").
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Sint8 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Uint8 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Sint16 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Uint16 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Sint32 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Uint32 value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::UnsignedLongInteger value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::SignedLongInteger value, bool bitField=false)
 Converts the numerical value to a string.
CEYLAN_DLL std::string Ceylan::toHexString (Ceylan::UnsignedLongInteger value, bool prefix=true, Ceylan::Uint8 minDigits=1)
 Converts the numerical value to a string with the value in hexadecimal format.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Float32 value, Ceylan::Uint8 precision=Ceylan::DigitOutputPrecision)
 Converts the numerical value to a string, with specified precision, in fixed (not scientific) notation.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::Float64 value, Ceylan::Uint8 precision=Ceylan::DigitOutputPrecision)
 Converts the numerical value to a string, with specified precision, in fixed (not scientific) notation.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::LongFloat value, Ceylan::Uint8 precision=Ceylan::DigitOutputPrecision)
 Converts the numerical value to a string, with specified precision, in fixed (not scientific) notation.
CEYLAN_DLL std::string Ceylan::toString (Ceylan::VerbosityLevels level)
 Converts a verbosity level into a string.
CEYLAN_DLL std::string Ceylan::toString (const std::list< Ceylan::Uint32 > &intList)
CEYLAN_DLL std::string Ceylan::toString (const std::list< const void * > &pointerList)
CEYLAN_DLL std::string Ceylan::toNumericalString (Uint8 number)
CEYLAN_DLL std::string Ceylan::toString (char character)
CEYLAN_DLL int Ceylan::stringToUnsignedLong (const std::string &numericalString)
 This section focuses on conversion from standard strings to various numerical types.
CEYLAN_DLL void * Ceylan::stringToAddress (const std::string &addressString)
 Converts, if possible, a string containing a pointer into that pointer.

Variables

CEYLAN_DLL const Ceylan::Uint16 Ceylan::DigitOutputPrecision = 40
 This section focuses on conversion from various numerical types to standard strings.
CEYLAN_DLL const std::string Ceylan::HexDigits = "0123456789ABCDEF"
 The hexadecimal digits: 0123456789ABCDEF.


Function Documentation

CEYLAN_DLL std::string operator+ ( const char *  a,
const std::string &  b 
)

Definition at line 784 of file CeylanOperators.cc.

CEYLAN_DLL std::string operator+ ( const std::string &  a,
const char *  b 
)

Definition at line 775 of file CeylanOperators.cc.

CEYLAN_DLL std::string operator+ ( const void *  p,
const std::string &  s 
)

Definition at line 748 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
const void *  p 
)

Definition at line 721 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::LongFloat  i,
const std::string &  s 
)

Definition at line 694 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::LongFloat  i 
)

Definition at line 667 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Float64  i,
const std::string &  s 
)

Definition at line 635 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Float64  i 
)

Definition at line 608 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Float32  i,
const std::string &  s 
)

Definition at line 581 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Float32  i 
)

Definition at line 554 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::UnsignedLongInteger  i,
const std::string &  s 
)

Definition at line 526 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::UnsignedLongInteger  i 
)

Definition at line 499 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::SignedLongInteger  i,
const std::string &  s 
)

Definition at line 472 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::SignedLongInteger  i 
)

Definition at line 445 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Uint32  i,
const std::string &  s 
)

Definition at line 381 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Uint32  i 
)

Definition at line 354 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Sint32  i,
const std::string &  s 
)

Definition at line 327 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Sint32  i 
)

Definition at line 300 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Uint16  i,
const std::string &  s 
)

Definition at line 273 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Uint16  i 
)

Definition at line 246 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Sint16  i,
const std::string &  s 
)

Definition at line 219 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Sint16  i 
)

Definition at line 192 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Uint8  i,
const std::string &  s 
)

Definition at line 160 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const std::string &  s,
Ceylan::Uint8  i 
)

Definition at line 128 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( Ceylan::Sint8  i,
const std::string &  s 
)

Definition at line 96 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.

CEYLAN_DLL std::string operator+ ( const string &  s,
Ceylan::Sint8  i 
)

This module offers the operators lacking in C++ in order to perform appending of numerical values to standard strings, and basic string conversion.

Various conversions are provided, from numerical to string and the other way round.

Each operator has its counterpart, which allows to add a numerical value to a string in both orders: 'numerical + string' and also 'string + numerical'.

Warning: a C++ compiler evaluates '"Four means " + 4' as 'char *' + 'int' so it does pointer arithmetic and returns unexpected bytes: actually, it returns the 'char *' starting with the space before "means", 4 characters after the initial F.

Please consider using 'string( "Four means " ) + 4', which would result in the expected string "Four means 4".

Note:
Operators should not be defined in a namespace.
See also:
CeylanStringUtils.h for other string manipulations.
Most operators can throw Ceylan::Exception.

This module offers the operators lacking in C++ in order to perform appending of numerical values to standard strings, and basic string conversion.

See also:
MutexHolder.

Definition at line 64 of file CeylanOperators.cc.

References Ceylan::DigitOutputPrecision.


Generated on Thu Jun 4 20:39:47 2009 for Ceylan by  doxygen 1.5.8