RTI Connext Modern C++ API  Version 5.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::core::basic_string< CharType, Allocator > Class Template Reference

<<value-type>> A string convertible to std::string and with similar functionality More...

#include <dds/core/String.hpp>

Public Member Functions

 basic_string ()
 Creates an empty string.
 
 basic_string (const basic_string &other)
 Copy constructor.
 
 basic_string (const CharType *other_str)
 Constructor from C string.
 
 basic_string (const std::basic_string< CharType > &std_string)
 Constructor from std::basic_string.
 
 basic_string (size_t size)
 Creates a string of a given size, initialized to '\0'.
 
 basic_string (basic_string &&other) OMG_NOEXCEPT
 <<C++11>> Move constructor
 
const CharType * c_str () const
 Gets the underlying C string.
 
size_type size () const
 Gets the size.
 
basic_stringoperator= (const basic_string &other)
 Assignment operator.
 
basic_stringoperator= (basic_string &&other) OMG_NOEXCEPT
 <<C++11>> Move-assignment operator
 
bool operator== (const basic_string &other) const
 Returns if two strings are equal.
 
bool operator!= (const basic_string &other) const
 Returns if two strings are different.
 
std::basic_string< CharType > to_std_string () const
 Creates a std::basic_string from this dds::core::basic_string.
 
 operator std::basic_string< CharType > () const
 Creates a std::string from this dds::core::string.
 

Related Functions

(Note that these are not member functions.)

template<typename CharType , typename Allocator >
std::ostream & operator<< (std::ostream &out, const basic_string< CharType, Allocator > &the_string)
 Prints the string.
 

Detailed Description

template<typename CharType, typename Allocator>
class dds::core::basic_string< CharType, Allocator >

<<value-type>> A string convertible to std::string and with similar functionality

In many cases, for performance reasons and other implementation requirements, the RTI Connext API uses dds::core::string instead of std::string. The most significant case is the C++ types that rtiddsgen generates from IDL.

A dds::core::string provides a subset of the functionality of a std::string. It also provides automatic conversion to and from std::string.

Examples:
Foo.hpp.

Constructor & Destructor Documentation

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( )
inline

Creates an empty string.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( const basic_string< CharType, Allocator > &  other)
inline

Copy constructor.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( const CharType *  other_str)
inline

Constructor from C string.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( const std::basic_string< CharType > &  std_string)
inline

Constructor from std::basic_string.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( size_t  size)
inlineexplicit

Creates a string of a given size, initialized to '\0'.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::basic_string ( basic_string< CharType, Allocator > &&  other)
inline

<<C++11>> Move constructor

Member Function Documentation

template<typename CharType , typename Allocator >
const CharType* dds::core::basic_string< CharType, Allocator >::c_str ( ) const
inline

Gets the underlying C string.

template<typename CharType , typename Allocator >
size_type dds::core::basic_string< CharType, Allocator >::size ( ) const
inline

Gets the size.

template<typename CharType , typename Allocator >
basic_string& dds::core::basic_string< CharType, Allocator >::operator= ( const basic_string< CharType, Allocator > &  other)
inline

Assignment operator.

template<typename CharType , typename Allocator >
basic_string& dds::core::basic_string< CharType, Allocator >::operator= ( basic_string< CharType, Allocator > &&  other)
inline

<<C++11>> Move-assignment operator

template<typename CharType , typename Allocator >
bool dds::core::basic_string< CharType, Allocator >::operator== ( const basic_string< CharType, Allocator > &  other) const
inline

Returns if two strings are equal.

template<typename CharType , typename Allocator >
bool dds::core::basic_string< CharType, Allocator >::operator!= ( const basic_string< CharType, Allocator > &  other) const
inline

Returns if two strings are different.

template<typename CharType , typename Allocator >
std::basic_string<CharType> dds::core::basic_string< CharType, Allocator >::to_std_string ( ) const
inline

Creates a std::basic_string from this dds::core::basic_string.

template<typename CharType , typename Allocator >
dds::core::basic_string< CharType, Allocator >::operator std::basic_string< CharType > ( ) const
inline

Creates a std::string from this dds::core::string.

Friends And Related Function Documentation

template<typename CharType , typename Allocator >
std::ostream & operator<< ( std::ostream &  out,
const basic_string< CharType, Allocator > &  the_string 
)
related

Prints the string.


RTI Connext Modern C++ API Version 5.2.0 Copyright © Sun Jun 21 2015 Real-Time Innovations, Inc