nlib
|
std::string
が持つ機能の一部をデータの複製なしに実現するためのクラスが定義されています。
[詳解]
#include <algorithm>
#include <iterator>
#include <utility>
#include "nn/nlib/Config.h"
#include "nn/nlib/UniquePtr.h"
#include "nn/nlib/Cstring.h"
クラス | |
class | nn::nlib::StringView |
std::string が持つメソッドをstd::string を構築せずに利用するためのクラスです。 C++17のstring_viewにtypedefされる予定です。 StringViewを引数に取るフリー関数についてはこちらを御覧ください。 [詳解] | |
名前空間 | |
nn::nlib | |
共通して使われることの多いストリーム関連のクラス群や各種コンテナ、及びガシェットクラスが実装されています。nlib_ns はエイリアスです。 | |
関数 | |
bool | nn::nlib::operator== (const StringView &lhs, const StringView &rhs) noexcept |
文字列が一致するかどうか比較します。 | |
bool | nn::nlib::operator< (const StringView &lhs, const StringView &rhs) noexcept |
文字列を辞書順で比較します。 | |
bool | nn::nlib::StartsWith (const StringView &str, const StringView &prefix) noexcept |
prefix がstr のプレフィックスである場合true を返します。 | |
bool | nn::nlib::StartsWith (const StringView &str, char c) noexcept |
c がstr のプレフィックスである場合true を返します。 | |
bool | nn::nlib::StartsWith (const StringView &str, const char *prefix) noexcept |
prefix がstr のプレフィックスである場合true を返します。 | |
bool | nn::nlib::EndsWith (const StringView &str, const StringView &suffix) noexcept |
suffix がstr のサフィックスである場合true を返します。 | |
bool | nn::nlib::EndsWith (const StringView &str, char c) noexcept |
c がstr のサフィックスである場合true を返します。 | |
bool | nn::nlib::EndsWith (const StringView &str, const char *suffix) noexcept |
suffix がstr のサフィックスである場合true を返します。 | |
bool | nn::nlib::ToCstring (char *buf, size_t buf_size, const StringView &str) noexcept |
ヌル終端文字列として文字列をコピーします。コピーできた場合はtrue を返します。 | |
template<size_t N> | |
bool | nn::nlib::ToCstring (char(&buf)[N], const StringView &str) noexcept |
ヌル終端文字列として文字列をコピーします。コピーできた場合はtrue を返します。 | |
UniquePtr< char[]> | nn::nlib::ToCstring (const StringView &str) noexcept |
メモリを割り当ててヌル終端文字列として文字列をコピーします。コピーできた場合はtrue を返します。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int8_t *v, const StringView &str, int base) noexcept |
内部でnlib_int8_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int16_t *v, const StringView &str, int base) noexcept |
内部でnlib_int16_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int32_t *v, const StringView &str, int base) noexcept |
内部でnlib_int32_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (int64_t *v, const StringView &str, int base) noexcept |
内部でnlib_int64_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint8_t *v, const StringView &str, int base) noexcept |
内部でnlib_uint8_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint16_t *v, const StringView &str, int base) noexcept |
内部でnlib_uint16_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint32_t *v, const StringView &str, int base) noexcept |
内部でnlib_uint32_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (uint64_t *v, const StringView &str, int base) noexcept |
内部でnlib_uint64_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToFloat (float *v, const StringView &str) noexcept |
内部でnlib_float_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
std::pair< errno_t, size_t > | nn::nlib::ToDouble (double *v, const StringView &str) noexcept |
内部でnlib_double_from_chars() を呼び出して、文字列を数値に変換します。戻り値はエラー値と読み込んだ文字数のペアです。 | |
template<class T > | |
std::pair< errno_t, size_t > | nn::nlib::ToInteger (T *v, const StringView &str) noexcept |
ToInteger(v, str, 10) を返します。つまり10進数として文字列を数値に変換します。 | |
bool | nn::nlib::TrimLeft (StringView &str) noexcept |
文字列の先頭の空白を切り詰めます。 [詳解] | |
bool | nn::nlib::TrimRight (StringView &str) noexcept |
文字列の末尾の空白を切り詰めます。 [詳解] | |
void | nn::nlib::Trim (StringView &str) noexcept |
文字列の先頭と末尾の空白を切り詰めます。 | |
StringView | nn::nlib::GetLine (StringView &str) noexcept |
先頭から行末までの文字列を取得します。自身のオブジェクト(str )は次の行の行頭に移動します。 [詳解] | |
bool | nn::nlib::Proceed (StringView &str, const StringView &prefix) noexcept |
str がprefix で始まっていればその文字列長だけ進めます。 [詳解] | |
bool | nn::nlib::Proceed (StringView &str, const char *prefix) noexcept |
str がprefix で始まっていればその文字列長だけ進めます。 [詳解] | |
bool | nn::nlib::Proceed (StringView &str, char c) noexcept |
str がc で始まっていればその文字列長だけ進めます。 [詳解] | |
StringView | nn::nlib::GetName (StringView &str) noexcept |
一般に変数名とされるような文字列を取得します。自身のオブジェクト(str )は取得した文字列の次に移動します。 [詳解] | |
std::string
が持つ機能の一部をデータの複製なしに実現するためのクラスが定義されています。
StringView.h に定義があります。
© 2012-2017 Nintendo Co., Ltd. All rights reserved.