RAII holder for strings allocated by FFmpeg internals.
More...
#include <dictionary.h>
|
char * | c_str () const noexcept |
| Access to the holded string with std::string interface. More...
|
|
size_t | length () const noexcept |
| RAW string length in bytes. More...
|
|
char & | operator[] (size_t index) const noexcept |
| Array-like char access. More...
|
|
RAII holder for strings allocated by FFmpeg internals.
◆ base_class
◆ c_str()
char* av::Dictionary::AvStringPtr::c_str |
( |
| ) |
const |
|
inlinenoexcept |
Access to the holded string with std::string
interface.
- Returns
- holded raw string pointer, or
nullptr
if string is not allocated
◆ length()
size_t av::Dictionary::AvStringPtr::length |
( |
| ) |
const |
|
inlinenoexcept |
RAW string length in bytes.
- Note
- to avoid extra size and keeps
sizeof(AvStringPtr) == sizeof(char*)
we do not cache and holds string size. As a result string length calculates every call and complexity is O(n)
, where n
- count of bytes in string exclude end zero.
8-bit based multibyte string like UTF-8 must be processes with appropriate libraries externally.
- Returns
- calculated length of string in bytes
◆ operator[]()
char& av::Dictionary::AvStringPtr::operator[] |
( |
size_t |
index | ) |
const |
|
inlinenoexcept |
Array-like char access.
This call avoid any checks. When index
is greater then length()
behavior undefined.
- Parameters
-
index | char index to access |
- Returns
- char reference to read/modify.
The documentation for this struct was generated from the following file: