meta: add c++ wrapper for ds module
This commit is contained in:
@@ -13,7 +13,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
set(b_modules
|
||||
core ds serial term cmd io compress
|
||||
core-mm)
|
||||
core-mm ds-mm)
|
||||
|
||||
set(b_system_name ${CMAKE_SYSTEM_NAME})
|
||||
string(TOLOWER ${b_system_name} b_system_name)
|
||||
|
||||
5
ds-mm/CMakeLists.txt
Normal file
5
ds-mm/CMakeLists.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
include(../cmake/Templates.cmake)
|
||||
|
||||
add_bluelib_mm_module(
|
||||
NAME ds
|
||||
DEPENDENCIES core-mm ds)
|
||||
0
ds-mm/include/blue/core.hpp
Normal file
0
ds-mm/include/blue/core.hpp
Normal file
0
ds-mm/include/blue/ds.hpp
Normal file
0
ds-mm/include/blue/ds.hpp
Normal file
63
ds-mm/include/blue/ds/string.hpp
Normal file
63
ds-mm/include/blue/ds/string.hpp
Normal file
@@ -0,0 +1,63 @@
|
||||
#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
|
||||
0
ds-mm/string.cpp
Normal file
0
ds-mm/string.cpp
Normal file
Reference in New Issue
Block a user