Beatmup
Beatmup::String Class Reference

StringBuilder including a string container. More...

#include <string_builder.h>

Inheritance diagram for Beatmup::String:
Beatmup::StringBuilder

Public Member Functions

 String ()
 
 String (const String &content)
 
 String (const std::string &content)
 
 String (std::initializer_list< const char * > lines)
 
StringBuilderoperator= (const std::string &content)
 
- Public Member Functions inherited from Beatmup::StringBuilder
 StringBuilder (std::string &workspace)
 
StringBuilderreplace (const std::string &search, const std::string &replacement)
 
StringBuilderoperator() (const std::string &append)
 
StringBuilderline (const std::string &append)
 
template<const int BUF_SIZE = 256>
StringBuilderprintf (const char *format,...)
 
StringBuildernl ()
 
 operator std::string & ()
 
void dump (std::string filename)
 

Private Attributes

std::string str
 

Detailed Description

StringBuilder including a string container.

Definition at line 83 of file string_builder.h.

Constructor & Destructor Documentation

◆ String() [1/4]

Beatmup::String::String ( )
inline

Definition at line 87 of file string_builder.h.

87 : StringBuilder(str) {}
StringBuilder(std::string &workspace)
std::string str

◆ String() [2/4]

Beatmup::String::String ( const String content)
inline

Definition at line 89 of file string_builder.h.

89  : StringBuilder(str) {
90  str = content.str;
91  }
std::string content

◆ String() [3/4]

Beatmup::String::String ( const std::string &  content)
inline

Definition at line 93 of file string_builder.h.

93  : StringBuilder(str) {
94  str = content;
95  }

◆ String() [4/4]

Beatmup::String::String ( std::initializer_list< const char * >  lines)
inline

Definition at line 97 of file string_builder.h.

97  : StringBuilder(str) {
98  static const std::string NL("\n");
99  for (auto& line : lines)
100  str += line + NL;
101  }
StringBuilder & line(const std::string &append)

Member Function Documentation

◆ operator=()

StringBuilder& Beatmup::String::operator= ( const std::string &  content)
inline

Definition at line 103 of file string_builder.h.

103  {
104  str = content;
105  return *this;
106  }

Member Data Documentation

◆ str

std::string Beatmup::String::str
private

Definition at line 85 of file string_builder.h.


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