00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00029 #include "Types.h"
00030 #include "Global.h"
00031
00035 class String : public Singleton<String>
00036 {
00037 public:
00045 Strings lines(const std::string& input, const char* separator = "\n");
00046
00054 std::string unlines(const Strings& input, const char* filler, int newlineat = 1);
00055
00062 Strings unlines(const Strings& input);
00063
00065 size_t maxlength(const Strings& content);
00066
00074 std::string box(const Strings& content, const std::string& header = Global::Get()->EmptyString);
00075
00083 Strings createTable(const std::vector<Strings>& content, const Strings& header);
00084
00086 std::string fromInt(value_type value);
00087
00089 std::string toupper(const std::string& convertToUpper);
00090
00092 std::string tolower(const std::string& convertToLower);
00093
00095 std::vector<int> calculateMinimumFieldSizes(const std::vector<Strings>& content, int fieldcount);
00096
00098 void rebaseMinimumFieldSizes(std::vector<int>& sizes, const Strings& header);
00099
00101 void capFieldSize(std::vector<int>& sizes, const int maxlinesize);
00102
00104 void capUnfairFields(std::vector<int>& sizes, int unfairFields, int maxFairSize, int slack);
00105
00107 std::string packFields(const Strings& fields, const std::vector<int>& fieldsizes);
00108
00109 private:
00111 String(void) {};
00112
00114 ~String(void) {};
00115
00116 friend class Singleton<String>;
00117 };