add utf8 string size and remove string dep
This commit is contained in:
13
bin/main.cpp
13
bin/main.cpp
@@ -20,6 +20,7 @@
|
||||
#include "security/uuid.hpp"
|
||||
#include "security/is_string.hpp"
|
||||
#include "security/is_link.hpp"
|
||||
#include "string/utf8_len.hpp"
|
||||
|
||||
// for example
|
||||
int f(int a)
|
||||
@@ -318,4 +319,16 @@ int main(int argc, char *argv[])
|
||||
if (!hack::security::is_link(link))
|
||||
hack::error()("no link");
|
||||
}
|
||||
|
||||
hack::log()("============================================================");
|
||||
hack::log()("string::utf8_size");
|
||||
|
||||
{// ex: utf8_size
|
||||
std::string str = "hi hi";
|
||||
auto s = hack::string::utf8_len(str);
|
||||
hack::log()(s);
|
||||
|
||||
s = hack::string::utf8_len("asdf");
|
||||
hack::log()(s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user