BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balb::CustomString Class Reference

#include <balb_testmessages.h>

Public Types

typedef bsl::string BaseType
 

Public Member Functions

 CustomString (bslma::Allocator *basicAllocator=0)
 
 CustomString (const CustomString &original, bslma::Allocator *basicAllocator=0)
 
 CustomString (const bsl::string &value, bslma::Allocator *basicAllocator=0)
 
 ~CustomString ()
 Destroy this object.
 
CustomStringoperator= (const CustomString &rhs)
 Assign to this object the value of the specified rhs object.
 
template<class STREAM >
STREAM & bdexStreamIn (STREAM &stream, int version)
 
void reset ()
 
int fromString (const bsl::string &value)
 
template<class STREAM >
STREAM & bdexStreamOut (STREAM &stream, int version) const
 
int maxSupportedBdexVersion () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 
const bsl::stringtoString () const
 Convert this value to bsl::string.
 

Static Public Member Functions

static int checkRestrictions (const bsl::string &value)
 

Static Public Attributes

static const char CLASS_NAME []
 

Friends

bool operator== (const CustomString &lhs, const CustomString &rhs)
 
bool operator!= (const CustomString &lhs, const CustomString &rhs)
 

Member Typedef Documentation

◆ BaseType

Constructor & Destructor Documentation

◆ CustomString() [1/3]

balb::CustomString::CustomString ( bslma::Allocator basicAllocator = 0)
inlineexplicit

Create an object of type CustomString having the default value. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ CustomString() [2/3]

balb::CustomString::CustomString ( const CustomString original,
bslma::Allocator basicAllocator = 0 
)
inline

Create an object of type CustomString having the value of the specified original object. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ CustomString() [3/3]

balb::CustomString::CustomString ( const bsl::string value,
bslma::Allocator basicAllocator = 0 
)
inlineexplicit

Create an object of type CustomString having the specified value. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~CustomString()

balb::CustomString::~CustomString ( )
inline

Member Function Documentation

◆ bdexStreamIn()

template<class STREAM >
STREAM & balb::CustomString::bdexStreamIn ( STREAM &  stream,
int  version 
)

Assign to this object the value read from the specified input stream using the specified version format and return a reference to the modifiable stream. If stream is initially invalid, this operation has no effect. If stream becomes invalid during this operation, this object is valid, but its value is undefined. If version is not supported, stream is marked invalid and this object is unaltered. Note that no version is read from stream. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ bdexStreamOut()

template<class STREAM >
STREAM & balb::CustomString::bdexStreamOut ( STREAM &  stream,
int  version 
) const

Write the value of this object to the specified output stream using the specified version format and return a reference to the modifiable stream. If version is not supported, stream is unmodified. Note that version is not written to stream. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ checkRestrictions()

static int balb::CustomString::checkRestrictions ( const bsl::string value)
static

Check if the specified value satisfies the restrictions of this class (i.e., "CustomString"). Return 0 if successful (i.e., the restrictions are satisfied) and non-zero otherwise.

◆ fromString()

int balb::CustomString::fromString ( const bsl::string value)
inline

Convert from the specified value to this type. Return 0 if successful and non-zero otherwise.

◆ maxSupportedBdexVersion()

int balb::CustomString::maxSupportedBdexVersion ( ) const
inline

Return the most current bdex streaming version number supported by this class. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ operator=()

CustomString & balb::CustomString::operator= ( const CustomString rhs)
inline

◆ print()

bsl::ostream & balb::CustomString::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const
inline

Format this object to the specified output stream at the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress line breaks and format the entire output on one line. If stream is initially invalid, this operation has no effect. Note that a trailing newline is provided in multiline mode only.

◆ reset()

void balb::CustomString::reset ( )
inline

Reset this object to the default value (i.e., its value upon default construction).

◆ toString()

const bsl::string & balb::CustomString::toString ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const CustomString lhs,
const CustomString rhs 
)
friend

Return true if the specified lhs and rhs attribute objects do not have the same value, and false otherwise. Two attribute objects do not have the same value if one or more respective attributes differ in values.

◆ operator==

bool operator== ( const CustomString lhs,
const CustomString rhs 
)
friend

Return true if the specified lhs and rhs attribute objects have the same value, and false otherwise. Two attribute objects have the same value if each respective attribute has the same value.

Member Data Documentation

◆ CLASS_NAME

const char balb::CustomString::CLASS_NAME[]
static

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