nlib
|
Defines a class for implementing some of the features of std::string
without duplicating data.
More...
#include <algorithm>
#include <iterator>
#include <utility>
#include "nn/nlib/Config.h"
#include "nn/nlib/UniquePtr.h"
#include "nn/nlib/Cstring.h"
Go to the source code of this file.
Classes | |
class | nn::nlib::StringView |
The class for using the member functions of std::string without constructing std::string . This class will be defined as the string_view of C++17 using typedef. For more information about free functions taking StringView as the argument, seehere.. More... | |
Namespaces | |
nn::nlib | |
Implements stream-related classes usually commonly used, various containers, and other gadget classes. nlib_ns is an alias. | |
Functions | |
bool | nn::nlib::operator== (const StringView &lhs, const StringView &rhs) noexcept |
Compares strings to check whether they are the same. | |
bool | nn::nlib::operator< (const StringView &lhs, const StringView &rhs) noexcept |
Compares strings in dictionary order. | |
bool | nn::nlib::StartsWith (const StringView &str, const StringView &prefix) noexcept |
Returns true if prefix is the prefix of str. | |
bool | nn::nlib::StartsWith (const StringView &str, char c) noexcept |
Returns true if c is the prefix of str. | |
bool | nn::nlib::StartsWith (const StringView &str, const char *prefix) noexcept |
Returns true if prefix is the prefix of str. | |
bool | nn::nlib::EndsWith (const StringView &str, const StringView &suffix) noexcept |
Returns true if suffix is the suffix of str. | |
bool | nn::nlib::EndsWith (const StringView &str, char c) noexcept |
Returns true if c is the suffix of str. | |
bool | nn::nlib::EndsWith (const StringView &str, const char *suffix) noexcept |
Returns true if suffix is the suffix of str. | |
bool | nn::nlib::ToCstring (char *buf, size_t buf_size, const StringView &str) noexcept |
Copies a string as a null terminated string. Returns true if the string was successfully copied. | |
template<size_t N> | |
bool | nn::nlib::ToCstring (char(&buf)[N], const StringView &str) noexcept |
Copies a string as a null terminated string. Returns true if the string was successfully copied. | |
UniquePtr< char[]> | nn::nlib::ToCstring (const StringView &str) noexcept |
Allocates memory and copies a string as a null terminated string. Returns true if the string was successfully copied. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int8_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_int8_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int16_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_int16_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int32_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_int32_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int64_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_int64_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint8_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_uint8_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint16_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_uint16_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint32_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_uint32_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint64_t *v, const StringView &str, int base) noexcept |
Internally calls nlib_uint64_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToFloat (float *v, const StringView &str) noexcept |
Internally calls nlib_float_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
std::pair< errno_t, size_t > | nn::nlib::ToDouble (double *v, const StringView &str) noexcept |
Internally calls nlib_double_from_chars() to convert a string to a numerical value. The returned value is a pair of the error value and the number of read characters. | |
template<class T > | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (T *v, const StringView &str) noexcept |
Returns ToInteger(v, str, 10) . This means that a character is converted to a decimal numerical value. | |
bool | nn::nlib::TrimLeft (StringView &str) noexcept |
Removes any white spaces from the beginning of the string. More... | |
bool | nn::nlib::TrimRight (StringView &str) noexcept |
Removes any white spaces from the end of the string. More... | |
void | nn::nlib::Trim (StringView &str) noexcept |
Removes any white spaces from the beginning and end of the string. | |
StringView | nn::nlib::GetLine (StringView &str) noexcept |
Obtains the strings from the start to the end of the line. Its own object ( str) moves to the beginning of the next line. More... | |
bool | nn::nlib::Proceed (StringView &str, const StringView &prefix) noexcept |
If str starts with prefix, it is allowed to go forward by the length of that string. More... | |
bool | nn::nlib::Proceed (StringView &str, const char *prefix) noexcept |
If str starts with prefix, it is allowed to go forward by the length of that string. More... | |
bool | nn::nlib::Proceed (StringView &str, char c) noexcept |
If str starts with c, it is allowed to go forward by the length of that string. More... | |
StringView | nn::nlib::GetName (StringView &str) noexcept |
Obtains a string that is generally handled as a variable name. Its own object ( str) moves to the position immediately after the obtained string. More... | |
Defines a class for implementing some of the features of std::string
without duplicating data.
Definition in file StringView.h.
© 2012-2017 Nintendo Co., Ltd. All rights reserved.