This class represents a PdfName.
More...
#include <PdfName.h>
|
| PdfName () |
| Constructor to create null name (corresponds to "/") use PdfName::Null instead of this constructor.
|
|
template<std::size_t N> |
| PdfName (const char(&str)[N]) |
|
template<typename T , typename = std::enable_if_t<std::is_same_v<T, const char*>>> |
| PdfName (T str) |
|
| PdfName (const std::string_view &str) |
| Create a new PdfName object. More...
|
|
| PdfName (const std::string &str) |
|
| PdfName (charbuff &&buff) |
|
| PdfName (const PdfName &rhs) |
| Create a copy of an existing PdfName object. More...
|
|
| PdfName (PdfName &&rhs) noexcept |
|
std::string | GetEscapedName () const |
|
void | Write (OutputStream &stream, PdfWriteFlags writeMode, const PdfStatefulEncrypt *encrypt, charbuff &buffer) const |
|
std::string_view | GetString () const |
|
bool | IsNull () const |
|
std::string_view | GetRawData () const |
|
PdfName & | operator= (const PdfName &rhs) |
| Assign another name to this object. More...
|
|
PdfName & | operator= (PdfName &&rhs) noexcept |
|
bool | operator== (const PdfName &rhs) const |
| compare to PdfName objects. More...
|
|
bool | operator== (const char *str) const |
|
bool | operator== (const std::string &str) const |
|
bool | operator== (const std::string_view &view) const |
|
bool | operator!= (const PdfName &rhs) const |
| compare two PdfName objects. More...
|
|
bool | operator!= (const char *str) const |
|
bool | operator!= (const std::string &str) const |
|
bool | operator!= (const std::string_view &view) const |
|
| operator std::string_view () const |
| Default cast to raw data string view. More...
|
|
std::string | ToString (PdfWriteFlags flags=PdfWriteFlags::None) const |
| Converts the current object into a string representation which can be written directly to a PDF file on disc. More...
|
|
void | ToString (std::string &str, PdfWriteFlags flags=PdfWriteFlags::None) const |
|
This class represents a PdfName.
Whenever a key is required you have to use a PdfName object.
PdfName are required as keys in PdfObject and PdfVariant objects.
PdfName may have a maximum length of 127 characters.
- See also
- PdfObject
-
PdfVariant
◆ PdfName() [1/2]
PoDoFo::PdfName::PdfName |
( |
const std::string_view & |
str | ) |
|
Create a new PdfName object.
- Parameters
-
str | the unescaped value of this name. Please specify the name without the leading '/'. Has to be a zero terminated string. |
◆ PdfName() [2/2]
PdfName::PdfName |
( |
const PdfName & |
rhs | ) |
|
Create a copy of an existing PdfName object.
- Parameters
-
◆ FromEscaped()
PdfName PdfName::FromEscaped |
( |
const std::string_view & |
name | ) |
|
|
static |
Create a new PdfName object from a string containing an escaped name string without the leading / .
- Parameters
-
name | A string containing the escaped name |
- Returns
- A new PdfName
◆ GetEscapedName()
string PdfName::GetEscapedName |
( |
| ) |
const |
- Returns
- an escaped representation of this name without the leading / .
There is no corresponding GetEscapedLength(), since generating the return value is somewhat expensive.
◆ GetRawData()
string_view PdfName::GetRawData |
( |
| ) |
const |
- Returns
- the raw data of this name object
◆ GetString()
string_view PdfName::GetString |
( |
| ) |
const |
- Returns
- the unescaped value of this name object without the leading slash
◆ IsNull()
bool PdfName::IsNull |
( |
| ) |
const |
- Returns
- true if the name is empty
◆ operator std::string_view()
PoDoFo::PdfName::operator std::string_view |
( |
| ) |
const |
Default cast to raw data string view.
It's used in PdfDictionary lookup
◆ operator!=()
bool PdfName::operator!= |
( |
const PdfName & |
rhs | ) |
const |
compare two PdfName objects.
- Returns
- true if both PdfNames have different values.
◆ operator=()
Assign another name to this object.
- Parameters
-
◆ operator==()
bool PdfName::operator== |
( |
const PdfName & |
rhs | ) |
const |
compare to PdfName objects.
- Returns
- true if both PdfNames have the same value.
◆ operator""_n
PdfName PODOFO_API operator""_n |
( |
const char * |
name, |
|
|
size_t |
length |
|
) |
| |
|
friend |
Create a PdfName from a string literal without checking for PdfDocEncoding characters.
The documentation for this class was generated from the following files:
- src/podofo/main/PdfName.h
- src/podofo/main/PdfName.cpp