String with extra allocation for ease of use with parser::parse()
More...
#include <padded_string.h>
String with extra allocation for ease of use with parser::parse()
This is a move-only class, it cannot be copied.
Definition at line 23 of file padded_string.h.
◆ padded_string() [1/5]
| simdjson::padded_string::padded_string |
( |
size_t |
length | ) |
|
|
inlineexplicitnoexcept |
Create a new padded string buffer.
- Parameters
-
| length | the size of the string. |
Definition at line 48 of file padded_string-inl.h.
◆ padded_string() [2/5]
| simdjson::padded_string::padded_string |
( |
const char * |
data, |
|
|
size_t |
length |
|
) |
| |
|
inlineexplicitnoexcept |
Create a new padded string by copying the given input.
- Parameters
-
| data | the buffer to copy |
| length | the number of bytes to copy |
Definition at line 51 of file padded_string-inl.h.
◆ padded_string() [3/5]
| simdjson::padded_string::padded_string |
( |
const std::string & |
str_ | ) |
|
|
inlinenoexcept |
Create a new padded string by copying the given input.
- Parameters
-
Definition at line 72 of file padded_string-inl.h.
◆ padded_string() [4/5]
| simdjson::padded_string::padded_string |
( |
std::string_view |
sv_ | ) |
|
|
inlinenoexcept |
Create a new padded string by copying the given input.
- Parameters
-
Definition at line 81 of file padded_string-inl.h.
◆ padded_string() [5/5]
Move one padded string into another.
The original padded string will be reduced to zero capacity.
- Parameters
-
Definition at line 92 of file padded_string-inl.h.
◆ ~padded_string()
| simdjson::padded_string::~padded_string |
( |
| ) |
|
|
inlinenoexcept |
◆ data() [1/2]
| const char * simdjson::padded_string::data |
( |
| ) |
const |
|
inlinenoexcept |
◆ data() [2/2]
| char * simdjson::padded_string::data |
( |
| ) |
|
|
inlinenoexcept |
◆ length()
| size_t simdjson::padded_string::length |
( |
| ) |
const |
|
inlinenoexcept |
◆ load()
Load this padded string from a file.
Windows and Unicode
Windows users who need to read files with non-ANSI characters in the name should set their code page to UTF-8 (65001) before calling this function. This should be the default with Windows 11 and better. Further, they may use the AreFileApisANSI function to determine whether the filename is interpreted using the ANSI or the system default OEM codepage, and they may call SetFileApisToOEM accordingly.
- Returns
- IO_ERROR on error. Be mindful that on some 32-bit systems, the file size might be limited to 2 GB.
- Parameters
-
| path | the path to the file. |
Definition at line 134 of file padded_string-inl.h.
◆ operator padded_string_view()
◆ operator std::string_view()
| simdjson::padded_string::operator std::string_view |
( |
| ) |
const |
|
inline |
◆ operator=()
Move one padded string into another.
The original padded string will be reduced to zero capacity.
- Parameters
-
Definition at line 98 of file padded_string-inl.h.
◆ size()
| size_t simdjson::padded_string::size |
( |
| ) |
const |
|
inlinenoexcept |
◆ swap()
◆ u8data()
| const uint8_t * simdjson::padded_string::u8data |
( |
| ) |
const |
|
inlinenoexcept |
The documentation for this struct was generated from the following files: