Go to the documentation of this file.
64 operator const char*()
const
74 const char*
c_str()
const
79 explicit operator String()
const
86 return other !=
nullptr && strncmp(
buffer, other,
length) == 0;
100 memcpy(
buffer, src, copylen);
103 return (copylen == srclen) ?
FS_OK : Error::BufferTooSmall;
106 int copy(
const char* src)
108 return copy(src, strlen(src));
113 return copy(name.buffer, name.length);
135 return Error::BufferTooSmall;
166 }
else if(
size != 0) {
180 bool endsWith(
const char* suffix)
const
182 if(suffix ==
nullptr) {
185 auto suffix_len = strlen(suffix);
186 if(
length < suffix_len || suffix_len == 0) {
189 return memcmp(&
buffer[
length - suffix_len], suffix, suffix_len) == 0;
bool endsWith(const char *suffix) const
Definition: NameBuffer.h:218
void terminate()
ensure the buffer has a nul terminator, even if it means overwriting content
Definition: NameBuffer.h:200
uint16_t space()
get the number of free characters available
Definition: NameBuffer.h:192
NameBuffer()
Definition: NameBuffer.h:87
a quick'n'dirty name buffer with maximum path allocation
Definition: NameBuffer.h:215
bool operator==(const char *other)
Definition: NameBuffer.h:122
The String class.
Definition: WString.h:136
int addSep()
When building file paths this method simplified appending separators.
Definition: NameBuffer.h:159
uint16_t length
OUT: length of name.
Definition: NameBuffer.h:85
constexpr ErrorCode FS_OK
Definition: Components/IFS/src/include/IFS/Error.h:130
bool overflow() const
determine if name buffer overflowed
Definition: NameBuffer.h:213
Definition: DirectoryTemplate.h:36
uint16_t size
IN: Size of buffer.
Definition: NameBuffer.h:84
const char * c_str() const
Definition: NameBuffer.h:112
int copy(const char *src, uint16_t srclen)
copies text from a source buffer into a name buffer
Definition: NameBuffer.h:133
FileNameBuffer()
Definition: NameBuffer.h:217
char * endptr()
get a pointer to the next write position
Definition: NameBuffer.h:182
defines a 'safe' name buffer
Definition: NameBuffer.h:63
char * buffer
Buffer to store name.
Definition: NameBuffer.h:83
char * begin()
Definition: NameBuffer.h:107