64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
|
|
#ifndef BLUE_DS_STRING_HPP_
|
||
|
|
#define BLUE_DS_STRING_HPP_
|
||
|
|
|
||
|
|
#include <blue/core/encoding.hpp>
|
||
|
|
#include <blue/core/object.hpp>
|
||
|
|
#include <blue/core/status.hpp>
|
||
|
|
#include <blue/core/stringstream.hpp>
|
||
|
|
#include <cstddef>
|
||
|
|
|
||
|
|
namespace blue::ds
|
||
|
|
{
|
||
|
|
class string : public core::object
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
core::type get_type(void);
|
||
|
|
|
||
|
|
string();
|
||
|
|
string(const char *s);
|
||
|
|
string(const core::wchar *s);
|
||
|
|
string(char c, std::size_t count);
|
||
|
|
|
||
|
|
char *steal(void);
|
||
|
|
status reserve(size_t capacity);
|
||
|
|
status replace(size_t start, size_t len, const char *new_data);
|
||
|
|
status replace(const char *new_data);
|
||
|
|
status replace(const core::stringstream &new_data);
|
||
|
|
status remove(size_t start, size_t len);
|
||
|
|
status transform(int (*transformer)(int));
|
||
|
|
status trim(void);
|
||
|
|
status toupper(void)
|
||
|
|
{
|
||
|
|
return transform(::toupper);
|
||
|
|
}
|
||
|
|
|
||
|
|
status tolower(void)
|
||
|
|
{
|
||
|
|
return transform(::tolower);
|
||
|
|
}
|
||
|
|
|
||
|
|
status append(char c);
|
||
|
|
status append(core::wchar c);
|
||
|
|
status append(const string &s);
|
||
|
|
status append(const core::wchar *s);
|
||
|
|
status append(const char *format, ...);
|
||
|
|
|
||
|
|
status prepend(char c);
|
||
|
|
status prepend(core::wchar c);
|
||
|
|
status prepend(const char *s);
|
||
|
|
status prepend(const core::wchar *s);
|
||
|
|
status prepend(const char *format, ...);
|
||
|
|
|
||
|
|
status insert(char c, std::size_t at);
|
||
|
|
status insert(core::wchar c, std::size_t at);
|
||
|
|
status insert(const string &s, std::size_t at);
|
||
|
|
status insert(const char *s, std::size_t at);
|
||
|
|
status insert(const core::wchar *s, std::size_t at);
|
||
|
|
status insert(std::size_t at, const char *format, ...);
|
||
|
|
|
||
|
|
void clear(void);
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif
|