Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
StringStream.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Core module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_STRINGSTREAM_HPP
8 #define NAZARA_STRINGSTREAM_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/String.hpp>
12 #include <string>
13 #include <vector>
14 
15 namespace Nz
16 {
17  class NAZARA_CORE_API StringStream
18  {
19  public:
20  StringStream() = default;
21  StringStream(String str);
22  StringStream(const StringStream&) = default;
23  StringStream(StringStream&&) noexcept = default;
24 
25  void Clear();
26 
27  std::size_t GetBufferSize() const;
28 
29  String ToString() const;
30 
31  StringStream& operator=(const StringStream&) = default;
32  StringStream& operator=(StringStream&&) noexcept = default;
33 
34  StringStream& operator<<(bool boolean);
35  StringStream& operator<<(short number);
36  StringStream& operator<<(unsigned short number);
37  StringStream& operator<<(int number);
38  StringStream& operator<<(unsigned int number);
39  StringStream& operator<<(long number);
40  StringStream& operator<<(unsigned long number);
41  StringStream& operator<<(long long number);
42  StringStream& operator<<(unsigned long long number);
43  StringStream& operator<<(float number);
44  StringStream& operator<<(double number);
45  StringStream& operator<<(long double number);
46  StringStream& operator<<(char character);
47  StringStream& operator<<(unsigned char character);
48  StringStream& operator<<(const char* string);
49  StringStream& operator<<(const std::string& string);
50  StringStream& operator<<(const String& string);
51  StringStream& operator<<(const void* ptr);
52 
53  operator String() const;
54 
55  private:
56  String m_result;
57  };
58 }
59 
60 #endif // NAZARA_STRINGSTREAM_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents a stream of strings.
Definition: StringStream.hpp:17
Core class that represents a string.
Definition: String.hpp:22