29 #ifndef _FUNDOSHI_HPP_
30 #define _FUNDOSHI_HPP_
39 template <
class CharType>
40 static size_t strlen(
const CharType * str){
50 template <
class CharType>
52 if(c >= 0x20 && c <= 0x7E){
53 os << static_cast<char>(c);
55 os <<
'[' << c <<
']';
61 if(c >= 0x20 && c <= 0x7E){
64 os << '[' << static_cast<signed int>(c) <<
']';
70 if(c >= 0x20 && c <= 0x7E){
73 os << '[' << static_cast<unsigned int>(c) <<
']';
77 template <
class CharType>
80 for(
size_t i = 0; i < min_length; i++){
81 if(str1[i] < str2[i]){
83 }
else if(str1[i] > str2[i]){
98 template <
class CharType>
110 const CharType * buffer;
141 operator std::basic_string<value_type>(void)
const{
142 return std::basic_string<value_type>(buffer, buffer_length);
147 return fundoshi::compare<CharType>(*
this, other); }
150 return fundoshi::compare<CharType>(*
this, other) == 0; }
153 return fundoshi::compare<CharType>(*
this, other) != 0; }
155 bool operator < (const basic_string<CharType> & other)
const {
156 return fundoshi::compare<CharType>(*
this, other) < 0; }
158 bool operator <=(const basic_string<CharType> & other)
const {
159 return fundoshi::compare<CharType>(*
this, other) <= 0; }
162 return fundoshi::compare<CharType>(*
this, other) > 0; }
165 return fundoshi::compare<CharType>(*
this, other) >= 0; }
183 template <
class CharType>
184 static std::ostream & operator <<(std::ostream & os, const fundoshi::basic_string<CharType> & str){
185 for(
size_t i = 0; i < str.length(); i++){
191 #endif // _FUNDOSHI_HPP_
bool operator!=(const basic_string< CharType > &other) const
Definition: fundoshi.hpp:152
const value_type * const_iterator
Definition: fundoshi.hpp:105
CharType value_type
Definition: fundoshi.hpp:102
basic_string(const basic_string< CharType > &other)
Definition: fundoshi.hpp:118
iterator begin(void)
Definition: fundoshi.hpp:139
basic_string(const CharType *newstr, size_type offset, size_type length)
Definition: fundoshi.hpp:130
~basic_string()
Definition: fundoshi.hpp:132
basic_string(const CharType *newstr, size_type newstr_length)
Definition: fundoshi.hpp:124
bool operator>=(const basic_string< CharType > &other) const
Definition: fundoshi.hpp:164
Definition: fundoshi.hpp:37
basic_string(const basic_string< CharType > &other, size_type offset, size_type length)
Definition: fundoshi.hpp:128
basic_string< char > string
Definition: fundoshi.hpp:171
static void print_char(std::ostream &os, CharType c)
Definition: fundoshi.hpp:51
const_reference operator[](size_t pos) const
Definition: fundoshi.hpp:138
bool operator>(const basic_string< CharType > &other) const
Definition: fundoshi.hpp:161
basic_string(const std::basic_string< CharType > &newstr)
Definition: fundoshi.hpp:119
size_t size_type
Definition: fundoshi.hpp:101
const_iterator const_reverse_iterator
Definition: fundoshi.hpp:107
iterator reverse_iterator
Definition: fundoshi.hpp:106
static int compare(const basic_string< CharType > &str1, const basic_string< CharType > &str2)
Definition: fundoshi.hpp:78
basic_string(const std::basic_string< CharType > &newstr, size_type offset, size_type length)
Definition: fundoshi.hpp:129
iterator end(void)
Definition: fundoshi.hpp:140
basic_string(iterator b, iterator e)
Definition: fundoshi.hpp:125
size_type size(void) const
Definition: fundoshi.hpp:136
size_type length(void) const
Definition: fundoshi.hpp:137
static size_t strlen(const CharType *str)
Definition: fundoshi.hpp:40
basic_string< wchar_t > wstring
Definition: fundoshi.hpp:176
basic_string()
Definition: fundoshi.hpp:115
bool operator==(const basic_string< CharType > &other) const
Definition: fundoshi.hpp:149
const value_type * iterator
Definition: fundoshi.hpp:104
int compare(const basic_string< CharType > &other) const
Definition: fundoshi.hpp:146
const value_type & const_reference
Definition: fundoshi.hpp:103
const value_type * c_str(void) const
Definition: fundoshi.hpp:135
basic_string(const CharType *newstr)
Definition: fundoshi.hpp:120