Skip to content
Snippets Groups Projects
Commit b570813c authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed documentation in string.

parent e3f6c57c
No related branches found
No related tags found
1 merge request!15Nina
...@@ -45,7 +45,6 @@ class String ...@@ -45,7 +45,6 @@ class String
///// /////
/// \brief Constructor with char pointer. /// \brief Constructor with char pointer.
/// ///
/// Copies the null-terminated character sequence (C-string) pointed by \e c.
/// Constructs a string initialized with the 8-bit string \e c, excluding /// Constructs a string initialized with the 8-bit string \e c, excluding
/// the given number of \e prefix_cut_off and \e sufix_cut_off characters. /// the given number of \e prefix_cut_off and \e sufix_cut_off characters.
/// ///
...@@ -69,6 +68,7 @@ class String ...@@ -69,6 +68,7 @@ class String
/// \brief Converts anything to a string. /// \brief Converts anything to a string.
/// ///
/// This function converts any type of value into type string. /// This function converts any type of value into type string.
/// @tparam T is a type of a value to be converted
/// @param value Word of any type (e.g. int, bool, double,...). /// @param value Word of any type (e.g. int, bool, double,...).
template< typename T > template< typename T >
explicit explicit
...@@ -127,25 +127,23 @@ class String ...@@ -127,25 +127,23 @@ class String
///// /////
/// \brief Returns pointer to data. /// \brief Returns pointer to data.
/// ///
/// It returns the content of the given string. The content can not be /// It returns the content of the given string as a constant pointer to char.
/// changed by user.
const char* getString() const; const char* getString() const;
/// \brief Returns pointer to data. /// \brief Returns pointer to data.
/// ///
/// It returns the content of the given string. The content can be changed /// It returns the content of the given string as a non-constant pointer to char.
/// by user.
char* getString(); char* getString();
///// /////
/// \brief Operator for accesing particular chars of the string. /// \brief Operator for accessing particular chars of the string.
/// ///
/// This function overloads operator[](). It returns a reference to /// This function overloads operator[](). It returns a reference to
/// the character at position \e i in given string. /// the character at position \e i in given string.
/// The character can not be changed be user. /// The character can not be changed be user.
const char& operator[]( int i ) const; const char& operator[]( int i ) const;
/// \brief Operator for accesing particular chars of the string. /// \brief Operator for accessing particular chars of the string.
/// ///
/// It returns the character at the position \e i in given string as /// It returns the character at the position \e i in given string as
/// a modifiable reference. /// a modifiable reference.
...@@ -256,23 +254,17 @@ class String ...@@ -256,23 +254,17 @@ class String
///// /////
/// \brief Function for saving file. /// \brief Function for saving file.
/// ///
/// Writes to a binary file and returns boolean expression based on the /// Writes the string to a binary file and returns boolean expression based on the
/// success in writing into the file. /// success in writing into the file.
bool save( File& file ) const; bool save( File& file ) const;
///// /////
/// \brief Function for loading from file. /// \brief Function for loading from file.
/// ///
/// Reads from binary file and returns boolean expression based on the /// Reads a string from binary file and returns boolean expression based on the
/// success in reading the file. /// success in reading the file.
bool load( File& file ); bool load( File& file );
// !!! Mozem dat prec???
// Broadcast to other nodes in MPI cluster
// void MPIBcast( int root, MPI_Comm mpi_comm = MPI_COMM_WORLD );
///// /////
/// \brief Function for getting a line from stream. /// \brief Function for getting a line from stream.
/// ///
...@@ -280,11 +272,11 @@ class String ...@@ -280,11 +272,11 @@ class String
/// expression based on the success in reading the line. /// expression based on the success in reading the line.
bool getLine( std::istream& stream ); bool getLine( std::istream& stream );
///toto neviem co
friend std::ostream& operator<<( std::ostream& stream, const String& str ); friend std::ostream& operator<<( std::ostream& stream, const String& str );
protected: protected:
/// Pointer to char ended with zero ...Preco?
/// Pointer to char ended with zero byte
char* string; char* string;
/// Length of allocated piece of memory. /// Length of allocated piece of memory.
...@@ -298,7 +290,7 @@ String operator+( char string1, const String& string2 ); ...@@ -298,7 +290,7 @@ String operator+( char string1, const String& string2 );
/// Returns concatenation of \e string1 and \e string2. /// Returns concatenation of \e string1 and \e string2.
String operator+( const char* string1, const String& string2 ); String operator+( const char* string1, const String& string2 );
/// Toto neviem co /// Performs the string output to a stream
std::ostream& operator<<( std::ostream& stream, const String& str ); std::ostream& operator<<( std::ostream& stream, const String& str );
template< typename T > template< typename T >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment