nlib
StringView.h
Go to the documentation of this file.
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_STRINGVIEW_H_
17 #define INCLUDE_NN_NLIB_STRINGVIEW_H_
18 
19 #include <algorithm>
20 #include <iterator>
21 #include <utility>
22 #include <string>
23 
24 #include "nn/nlib/Config.h"
25 #include "nn/nlib/UniquePtr.h"
26 #include "nn/nlib/Cstring.h"
27 
28 #if __has_include(<string_view>) && (!defined(_MSVC_LANG) || _MSVC_LANG > 201402L) \
29  && (defined(_MSC_VER) || __cplusplus > 201402L)
30 #include <string_view>
31 
32 NLIB_NAMESPACE_BEGIN
33 typedef std::string_view StringView;
34 NLIB_NAMESPACE_END
35 
36 #elif __has_include(<experimental/string_view>)
37 #include <experimental/string_view>
38 
39 NLIB_NAMESPACE_BEGIN
40 typedef std::experimental::string_view StringView;
41 NLIB_NAMESPACE_END
42 
43 #else
44 NLIB_NAMESPACE_BEGIN
45 
47  public:
48  // types
49  typedef char charT;
50  typedef charT value_type;
51  typedef const charT* pointer;
52  typedef const charT* const_pointer;
53  typedef const charT& reference;
54  typedef const charT& const_reference;
57  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
59  typedef size_t size_type;
60  typedef ptrdiff_t difference_type;
61  static const size_type npos = size_type(-1);
62 
63  // [string.view.cons], construct/copy
64  NLIB_CEXPR StringView() NLIB_NOEXCEPT : len_(0), base_("") {}
65  // this ctor calls strlen(), use StringView(str, len) if you know the the length of the string.
66  explicit StringView(const charT* str) NLIB_NOEXCEPT : len_(nlib_strlen(str)), base_(str) {
67  NLIB_ASSERT(this->IsValid_());
68  }
69  StringView(const charT* str, size_type len) NLIB_NOEXCEPT : len_(len), base_(str) {
70  NLIB_ASSERT(this->IsValid_());
71  }
72 
73  // [string.view.iterators], iterators
75  NLIB_ASSERT(this->IsValid_());
76  return base_;
77  }
78  const_iterator end() const NLIB_NOEXCEPT { return begin() + len_; }
79  const_iterator cbegin() const NLIB_NOEXCEPT { return begin(); }
80  const_iterator cend() const NLIB_NOEXCEPT { return cbegin() + len_; }
81 
86 
87  // [string.view.capacity], capacity
89  NLIB_ASSERT(this->IsValid_());
90  return len_;
91  }
93  NLIB_ASSERT(this->IsValid_());
94  return len_;
95  }
96  size_type max_size() const NLIB_NOEXCEPT { return static_cast<size_type>(-1) / sizeof(charT); }
97  bool empty() const NLIB_NOEXCEPT { return this->size() == 0; }
98 
99  // [string.view.access], element access
100  const charT& operator[](size_type pos) const {
101  NLIB_ASSERT(this->IsValid_());
102  return base_[pos];
103  }
104  const charT& at(size_type pos) const {
105  NLIB_ASSERT(this->IsValid_());
106  return base_[pos];
107  }
108  const charT& front() const { return (*this)[0]; }
109  const charT& back() const { return (*this)[this->length() - 1]; }
110  const charT* data() const NLIB_NOEXCEPT { return base_; }
111 
112  // [string.view.modifiers], modifiers:
114  len_ = 0;
115  base_ = "";
116  }
118  if (n >= len_) {
119  base_ += len_;
120  len_ = 0;
121  } else {
122  base_ += n;
123  len_ -= n;
124  }
125  }
127  if (n >= len_) {
128  len_ = 0;
129  } else {
130  len_ -= n;
131  }
132  }
133 
134  // [string.view.ops], string operations:
136  NLIB_ASSERT(this->IsValid_());
137  if (pos >= len_) return StringView(base_ + len_, 0);
138  const charT* new_base = base_ + pos;
139  size_type r = static_cast<size_type>(len_ - pos);
140  size_type new_len = r > n ? n : r;
141  return StringView(new_base, new_len);
142  }
143  int compare(const StringView& s) const NLIB_NOEXCEPT;
144  int compare(const charT* s) const NLIB_NOEXCEPT { return this->compare(StringView(s)); }
145  size_type find(const StringView& s) const {
146  StringView::iterator it = std::search(begin(), end(), s.begin(), s.end());
147  return it == end() ? npos : it - begin();
148  }
149  size_type find(charT c) const { return find(StringView(&c, 1)); }
150  size_type find(const charT* s) const { return find(StringView(s, nlib_strlen(s))); }
151  size_type rfind(const StringView& s) const {
152  StringView::iterator it = std::find_end(begin(), end(), s.begin(), s.end());
153  return it == end() ? npos : it - begin();
154  }
155  size_type rfind(charT c) const { return rfind(StringView(&c, 1)); }
156  size_type rfind(const charT* s) const { return rfind(StringView(s, nlib_strlen(s))); }
157  size_type find_first_of(const StringView& s) const {
158  StringView::iterator it = std::find_first_of(begin(), end(), s.begin(), s.end());
159  return it == end() ? npos : it - begin();
160  }
161  size_type find_first_of(charT c) const { return find_first_of(StringView(&c, 1)); }
162  size_type find_first_of(const charT* s) const {
163  return find_first_of(StringView(s, nlib_strlen(s)));
164  }
165  size_type find_last_of(const StringView& s) const {
166  StringView::reverse_iterator it = std::find_first_of(rbegin(), rend(), s.begin(), s.end());
167  return it == rend() ? std::string::npos : it.base() - 1 - begin();
168  }
169  size_type find_last_of(charT c) const { return find_last_of(StringView(&c, 1)); }
170  size_type find_last_of(const charT* s) const {
171  return find_last_of(StringView(s, nlib_strlen(s)));
172  }
173  /*
174  size_type find_first_not_of(const StringView& s) const;
175  size_type find_first_not_of(charT c) const;
176  size_type find_first_not_of(const charT* s) const;
177  size_type find_last_not_of(const StringView& s) const;
178  size_type find_last_not_of(charT c) const;
179  size_type find_last_not_of(const charT* s) const;
180  */
181 
182  private:
183  bool IsValid_() const NLIB_NOEXCEPT {
184  if (!base_) return false;
185  return true;
186  }
187  size_type len_;
188  const charT* base_;
189 };
190 
191 // [string.view.comparison], non-member StringView comparison functions
192 inline bool operator==(const StringView& lhs, const StringView& rhs) NLIB_NOEXCEPT {
193  return lhs.compare(rhs) == 0;
194 }
195 NLIB_EQUAL_OPERATOR(StringView)
196 inline bool operator<(const StringView& lhs, const StringView& rhs) NLIB_NOEXCEPT {
197  return lhs.compare(rhs) < 0;
198 }
199 NLIB_COMPARE_OPERATOR(StringView)
200 
201 NLIB_NAMESPACE_END
202 #endif
203 
204 NLIB_NAMESPACE_BEGIN
205 
206 // Free functions
207 inline bool StartsWith(const StringView& str, const StringView& prefix) NLIB_NOEXCEPT {
208  if (prefix.length() > str.length()) return false;
209  return nlib_memcmp(prefix.data(), str.data(), prefix.length()) == 0;
210 }
211 inline bool StartsWith(const StringView& str, char c) NLIB_NOEXCEPT {
212  return str.front() == c;
213 }
214 inline bool StartsWith(const StringView& str, const char* prefix) NLIB_NOEXCEPT {
215  return StartsWith(str, StringView(prefix));
216 }
217 inline bool EndsWith(const StringView& str, const StringView& suffix) NLIB_NOEXCEPT {
218  if (suffix.length() > str.length()) return false;
219  return nlib_memcmp(suffix.data(), &*str.end() - suffix.length(), suffix.length()) == 0;
220 }
221 inline bool EndsWith(const StringView& str, char c) NLIB_NOEXCEPT {
222  return str.back() == c;
223 }
224 inline bool EndsWith(const StringView& str, const char* suffix) NLIB_NOEXCEPT {
225  return EndsWith(str, StringView(suffix));
226 }
227 inline bool ToCstring(char* buf, size_t buf_size, const StringView& str) NLIB_NOEXCEPT {
228  if (!buf || buf_size == 0) return false;
229  size_t len = str.length();
230  errno_t e = nlib_memcpy(buf, buf_size - 1, str.data(), len);
231  if (e == 0) {
232  buf[len] = '\0';
233  return true;
234  } else {
235  return false;
236  }
237 }
238 template<size_t N>
239 inline bool ToCstring(char (&buf)[N], const StringView& str) NLIB_NOEXCEPT {
240  return ToCstring(&buf[0], N, str);
241 }
242 #ifdef __cpp_rvalue_references
244  size_t buf_size = str.length() + 1;
245  char* p = new (std::nothrow) char[buf_size];
246  if (!p) return nullptr;
247  (void)ToCstring(p, buf_size, str);
248  return UniquePtr<char[]>(p);
249 }
250 #endif
251 inline std::pair<errno_t, size_t>
252 ToInteger(int8_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
253  const char* eptr;
254  errno_t e = nlib_int8_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
255  return std::make_pair(e, eptr - str.data());
256 }
257 inline std::pair<errno_t, size_t>
258 ToInteger(int16_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
259  const char* eptr;
260  errno_t e = nlib_int16_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
261  return std::make_pair(e, eptr - str.data());
262 }
263 inline std::pair<errno_t, size_t>
264 ToInteger(int32_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
265  const char* eptr;
266  errno_t e = nlib_int32_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
267  return std::make_pair(e, eptr - str.data());
268 }
269 inline std::pair<errno_t, size_t>
270 ToInteger(int64_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
271  const char* eptr;
272  errno_t e = nlib_int64_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
273  return std::make_pair(e, eptr - str.data());
274 }
275 inline std::pair<errno_t, size_t>
276 ToInteger(uint8_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
277  const char* eptr;
278  errno_t e = nlib_uint8_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
279  return std::make_pair(e, eptr - str.data());
280 }
281 inline std::pair<errno_t, size_t>
282 ToInteger(uint16_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
283  const char* eptr;
284  errno_t e = nlib_uint16_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
285  return std::make_pair(e, eptr - str.data());
286 }
287 inline std::pair<errno_t, size_t>
288 ToInteger(uint32_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
289  const char* eptr;
290  errno_t e = nlib_uint32_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
291  return std::make_pair(e, eptr - str.data());
292 }
293 inline std::pair<errno_t, size_t>
294 ToInteger(uint64_t* v, const StringView& str, int base) NLIB_NOEXCEPT {
295  const char* eptr;
296  errno_t e = nlib_uint64_from_chars(v, &eptr, str.data(), str.data() + str.size(), base);
297  return std::make_pair(e, eptr - str.data());
298 }
299 inline std::pair<errno_t, size_t> ToFloat(float* v, const StringView& str) NLIB_NOEXCEPT {
300  const char* eptr;
301  errno_t e = nlib_float_from_chars(v, &eptr, str.data(), str.data() + str.size());
302  return std::make_pair(e, eptr - str.data());
303 }
304 inline std::pair<errno_t, size_t> ToDouble(double* v, const StringView& str) NLIB_NOEXCEPT {
305  const char* eptr;
306  errno_t e = nlib_double_from_chars(v, &eptr, str.data(), str.data() + str.size());
307  return std::make_pair(e, eptr - str.data());
308 }
309 template<class T>
310 inline std::pair<errno_t, size_t> ToInteger(T* v, const StringView& str) NLIB_NOEXCEPT {
311  return ToInteger(v, str, 10);
312 }
313 inline bool TrimLeft(StringView& str) NLIB_NOEXCEPT {
314  StringView::iterator it = str.begin();
315  StringView::iterator itend = str.end();
316  for (; it != itend; ++it) {
317  if (!nlib_isspace(*it)) break;
318  }
319  ptrdiff_t cnt = std::distance(str.begin(), it);
320  if (cnt == 0) return false;
321  str.remove_prefix(cnt);
322  return true;
323 }
324 inline bool TrimRight(StringView& str) NLIB_NOEXCEPT {
325  StringView::reverse_iterator it = str.rbegin();
326  StringView::reverse_iterator itend = str.rend();
327  for (; it != itend; ++it) {
328  if (!nlib_isspace(*it)) break;
329  }
330  ptrdiff_t cnt = std::distance(str.rbegin(), it);
331  if (cnt == 0) return false;
332  str.remove_suffix(cnt);
333  return true;
334 }
335 inline void Trim(StringView& str) NLIB_NOEXCEPT {
336  TrimLeft(str);
337  TrimRight(str);
338 }
340  const char* beg = str.data();
341  const char* p = static_cast<const char*>(nlib_memchr(beg, '\n', str.length()));
342  if (!p) {
343  StringView rval(str);
344  str.remove_prefix(str.length());
345  return rval;
346  }
347  size_t width = p - beg;
348  if (width > 0 && *(p - 1) == '\r') --width;
349  StringView rval(beg, width);
350  str.remove_prefix(p - beg + 1);
351  return rval;
352 }
353 inline bool Proceed(StringView& str, const StringView& prefix) NLIB_NOEXCEPT {
354  if (!StartsWith(str, prefix)) return false;
355  str.remove_prefix(prefix.length());
356  return true;
357 }
358 inline bool Proceed(StringView& str, const char* prefix) NLIB_NOEXCEPT {
359  return Proceed(str, StringView(prefix));
360 }
361 inline bool Proceed(StringView& str, char c) NLIB_NOEXCEPT {
362  if (!StartsWith(str, c)) return false;
363  str.remove_prefix(1);
364  return true;
365 }
367  StringView::iterator it = str.begin();
368  StringView::iterator it_end = str.end();
369  if (it != it_end) {
370  if (!nlib_isalpha(*it) && *it != '_') return str;
371  while (++it != it_end) {
372  if (!nlib_isalnum(*it) && *it != '_') break;
373  }
374  }
375  ptrdiff_t len = std::distance(str.begin(), it);
376  StringView rval(str.data(), len);
377  str.remove_prefix(len);
378  return rval;
379 }
380 
381 NLIB_NAMESPACE_END
382 
383 #endif // INCLUDE_NN_NLIB_STRINGVIEW_H_
void remove_prefix(size_type n) noexcept
Removes the first n characters.
Definition: StringView.h:117
std::pair< errno_t, size_t > ToInteger(T *v, const StringView &str) noexcept
Returns ToInteger(v, str, 10). This means that a character is converted to a decimal numerical value...
Definition: StringView.h:310
std::reverse_iterator< const_iterator > const_reverse_iterator
Read-only reverse iterator.
Definition: StringView.h:57
const charT * data() const noexcept
Returns the pointer to the first character.
Definition: StringView.h:110
size_t size_type
A non-negative integer type, currently defined in size_t using typedef.
Definition: StringView.h:59
void clear() noexcept
Sets an empty string.
Definition: StringView.h:113
static int nlib_isalpha(int ch)
If ch is an ASCII character &#39;A&#39;-&#39;Z&#39; or &#39;a&#39;-&#39;z&#39;, the function returns non-zero. Othewise, the function returns 0.
Definition: Platform.h:2484
ptrdiff_t difference_type
The type returned when you take the difference between iterators.
Definition: StringView.h:60
errno_t nlib_uint64_from_chars(uint64_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the uint64_t type. For more information, refer to the description for nlib_int32...
bool empty() const noexcept
Returns true if it is an empty string, otherwise returns false.
Definition: StringView.h:97
int nlib_memcmp(const void *buf1, const void *buf2, size_t n)
Compares the n bytes from the starts of buf1 and buf2 as unsigned char data.
StringView substr(size_type pos, size_type n=npos) const noexcept
Returns a substring [pos, pos + n).
Definition: StringView.h:135
std::pair< errno_t, size_t > 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.
Definition: StringView.h:299
errno_t nlib_float_from_chars(float *result, const char **endptr, const char *first, const char *last)
Converts a string to the float type. For more information, refer to the description for nlib_double_f...
const_reverse_iterator crbegin() const noexcept
Gets the read-only reverse iterator pointing to the last element.
Definition: StringView.h:84
size_type length() const noexcept
Returns the length of the string.
Definition: StringView.h:92
In the C++11 environment (which supports alias templates), std::unique_ptr is made an alias template...
Definition: UniquePtr.h:108
bool operator==(const HeapHash &rhs, const HeapHash &lhs)
Returns true if the two compared summaries are equal.
Definition: NMalloc.h:130
Defines that class that is corresponding to std::unique_ptr.
char charT
Currently a char-type specific class.
Definition: StringView.h:49
UniquePtr< char[]> ToCstring(const StringView &str) noexcept
Allocates memory and copies a string as a null terminated string. Returns true if the string was succ...
Definition: StringView.h:243
const charT & operator[](size_type pos) const
Gets the nth character, where n is specified by pos.
Definition: StringView.h:100
errno_t nlib_uint8_from_chars(uint8_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the uint8_t type. For more information, refer to the description for nlib_int32_...
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:87
bool EndsWith(const StringView &str, const char *suffix) noexcept
Returns true if suffix is the suffix of str.
Definition: StringView.h:224
const charT & back() const
Gets a reference to the last element.
Definition: StringView.h:109
constexpr StringView() noexcept
Instantiates the object with default parameters (default constructor). Initialized as an empty string...
Definition: StringView.h:64
bool TrimRight(StringView &str) noexcept
Removes any white spaces from the end of the string.
Definition: StringView.h:324
const void * nlib_memchr(const void *s, int c, size_t n)
Searches the n bytes from the start of the memory region (s, s + n) and returns a pointer to byte c...
const_iterator end() const noexcept
Gets the read-only iterator pointing beyond the last element.
Definition: StringView.h:78
const charT * pointer
The same as const_pointer.
Definition: StringView.h:51
size_type max_size() const noexcept
Returns the maximum value for the string length.
Definition: StringView.h:96
errno_t nlib_int32_from_chars(int32_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the int32_t type.
const_iterator cend() const noexcept
Gets the read-only iterator pointing beyond the last element.
Definition: StringView.h:80
const_iterator iterator
The same as const_iterator.
Definition: StringView.h:56
int compare(const charT *s) const noexcept
Compares strings.
Definition: StringView.h:144
const charT & at(size_type pos) const
Gets the nth character, where n is specified by pos.
Definition: StringView.h:104
errno_t nlib_int8_from_chars(int8_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the int8_t type. For more information, refer to the description for nlib_int32_f...
errno_t nlib_int64_from_chars(int64_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the int64_t type. For more information, refer to the description for nlib_int32_...
static int nlib_isalnum(int ch)
If ch is an ASCII character &#39;0&#39;-&#39;9&#39;, &#39;A&#39;-&#39;Z&#39;, or &#39;a&#39;-&#39;z&#39;, the function returns non-zero. Otherwise, the function returns 0.
Definition: Platform.h:2481
const_reverse_iterator reverse_iterator
The same as const_reverse_iterator
Definition: StringView.h:58
static int nlib_isspace(int ch)
If ch is an ASCII character &#39; &#39;, &#39;\t&#39;, or &#39;\n&#39;, the function returns non-zero. Otherwise, the function returns 0.
Definition: Platform.h:2494
const_iterator begin() const noexcept
Gets the read-only iterator pointing to the first element.
Definition: StringView.h:74
bool Proceed(StringView &str, char c) noexcept
If str starts with c, it is allowed to go forward by the length of that string.
Definition: StringView.h:361
bool StartsWith(const StringView &str, const char *prefix) noexcept
Returns true if prefix is the prefix of str.
Definition: StringView.h:214
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:109
const_iterator cbegin() const noexcept
Gets the read-only iterator pointing to the first element.
Definition: StringView.h:79
StringView(const charT *str, size_type len) noexcept
Initializes using the specified calculated string length.
Definition: StringView.h:69
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
Definition: Config.h:111
A file that contains the configuration information for each development environment.
const_reverse_iterator crend() const noexcept
Gets the read-only reverse iterator pointing ahead of the first element.
Definition: StringView.h:85
const_pointer const_iterator
Read-only random-access iterator.
Definition: StringView.h:55
StringView GetName(StringView &str) noexcept
Obtains a string that is generally handled as a variable name. Its own object ( str) moves to the pos...
Definition: StringView.h:366
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..
Definition: StringView.h:46
std::pair< errno_t, size_t > 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.
Definition: StringView.h:304
void Trim(StringView &str) noexcept
Removes any white spaces from the beginning and end of the string.
Definition: StringView.h:335
void remove_suffix(size_type n) noexcept
Removes the last n characters.
Definition: StringView.h:126
size_t nlib_strlen(const char *s)
Internally calls strlen(). In some cases, it may operate as an independent implementation.
const charT * const_pointer
Read-only pointer to an element.
Definition: StringView.h:52
const charT & const_reference
Read-only reference to an element.
Definition: StringView.h:54
errno_t nlib_int16_from_chars(int16_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the int16_t type. For more information, refer to the description for nlib_int32_...
Wraps functions like strlen and strcpy so they can be safely used.
const_reverse_iterator rbegin() const noexcept
Gets the read-only reverse iterator pointing to the last element.
Definition: StringView.h:82
charT value_type
The type for a character.
Definition: StringView.h:50
StringView(const charT *str) noexcept
Initialized to reference str. The string length is calculated internally.
Definition: StringView.h:66
bool TrimLeft(StringView &str) noexcept
Removes any white spaces from the beginning of the string.
Definition: StringView.h:313
const charT & front() const
Gets a reference to the first element.
Definition: StringView.h:108
size_type size() const noexcept
Returns the length of the string.
Definition: StringView.h:88
const_reverse_iterator rend() const noexcept
Gets the read-only reverse iterator pointing ahead of the first element.
Definition: StringView.h:83
errno_t nlib_double_from_chars(double *result, const char **endptr, const char *first, const char *last)
Converts a string to the double type.
errno_t nlib_uint16_from_chars(uint16_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the uint16_t type. For more information, refer to the description for nlib_int32...
errno_t nlib_uint32_from_chars(uint32_t *result, const char **endptr, const char *first, const char *last, int base)
Converts a string to the uint32_t type. For more information, refer to the description for nlib_int32...
const charT & reference
The same as const_reference.
Definition: StringView.h:53
StringView GetLine(StringView &str) noexcept
Obtains the strings from the start to the end of the line. Its own object ( str) moves to the beginni...
Definition: StringView.h:339
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:37