42 const char *thelabel =
nullptr,
66 return myToken.isSentinel();
72 myToken.makeSentinel();
73 myLabel.makeSentinel();
77 void setAsSeparator();
81 return myToken.isSentinel() ?
nullptr : myToken.c_str();
85 return myLabel.isSentinel() ?
getToken() : myLabel.c_str();
88 unsigned getHash()
const {
return myToken.hash(); }
111 myToken.makeSentinel();
119 myLabel.makeSentinel();
135 void instance(
const int *instance,
int num);
138 static void instanceToken(
UT_String &token,
const int *instance,
int num);
139 static void instanceToken(
UT_String &token,
142 const int *instance,
int num);
151 return myToken.isstring() || myLabel.isstring();
156 exint mem = inclusive ?
sizeof(*this) : 0;
157 mem += myToken.getMemoryUsage(
false);
158 mem += myLabel.getMemoryUsage(
false);
const UT_StringRef & getLabelRef() const
Get label UT_StringRef &, might be the sentinel value.
PRM_Name()
Default PRM_Name constructor is a sentinel value.
GLuint GLsizei const GLchar * label
int64 getMemoryUsage(bool inclusive) const
PRM_Name(const char *thetoken, const char *thelabel=nullptr, int theflags=0)
void setTokenAndLabelRef(const UT_StringRef &token, const UT_StringRef &label)
Sets the token and label, doing shallow copies.
void setToken(const char *s)
Sets the token, doing a deep copy.
**But if you need a result
const char * getLabel() const
static const char *const mySeparator
const UT_StringRef & getTokenRef() const
Use this for hash tables, might be the sentinel value.
PRM_Name(PRM_NameCopy, const UT_StringHolder &thetoken, const UT_StringHolder &thelabel, int theflags=0)
Constructor for doing deep copies of the strings.
PRM_API size_t format(char *buffer, size_t buffer_size, const PRM_Name &v)
void setTokenAndLabel(const char *token, const char *label)
Sets the token and label, doing deep copies.
SYS_FORCE_INLINE UT_StringHolder getToken(Add enum_value)
void harden()
Do a deep copy of its internal references.
int getExpressionFlag() const
bool isValidChoice() const
Returns if this a valid menu choice.
void setAsSentinel()
Set to a sentinel value.
bool isSentinel() const
Check if this is a sentinel.
const char * getToken() const
void setLabel(const char *s)
Sets the label, doing a deep copy.