Imaging Control 4 C++ Library 1.2.0
Loading...
Searching...
No Matches
PropString Class Reference

String properties represent features whose value is a text. More...

Inheritance diagram for PropString:
Property

Public Member Functions

bool setValue (const std::string &value, Error &err=Error::Default())
 Changes the value of this property.
 
std::string getValue (Error &err=Error::Default()) const
 Reads the current value of this property.
 
uint64_t maxLength (ic4::Error &err=Error::Default()) const
 Returns the maximum length of the string that can be stored in this property.
 
- Public Member Functions inherited from Property
 Property ()=default
 Creates an invalid object.
 
bool is_valid () const noexcept
 Checks whether this property is a valid object.
 
bool operator== (const Property &other) const noexcept
 Checks whether a property object refers to the same property as another property object.
 
bool operator!= (const Property &other) const noexcept
 Checks whether a property object refers to a different property as another property object.
 
bool operator< (const Property &other) const noexcept
 Provides an ordering of property objects.
 
PropType type (Error &err=Error::Default()) const
 Returns the type of the property.
 
std::string name (Error &err=Error::Default()) const
 Returns the name of the property.
 
bool isAvailable (Error &err=Error::Default()) const
 Checks whether a property is currently available.
 
bool isLocked (Error &err=Error::Default()) const
 Checks whether a property is currently locked.
 
bool isLikelyLockedByStream (Error &err=Error::Default()) const
 Tries to determine whether a property is locked because a data stream is active.
 
bool isReadOnly (Error &err=Error::Default()) const
 Checks whether a property is read-only.
 
PropVisibility visibility (Error &err=Error::Default()) const
 Returns a visibility hint for the property.
 
std::string displayName (Error &err=Error::Default()) const
 Returns the display name of the property.
 
std::string tooltip (Error &err=Error::Default()) const
 Returns a tooltip for the property.
 
std::string description (Error &err=Error::Default()) const
 Returns a description for the property.
 
PropCommand asCommand (Error &err=Error::Default()) const
 Converts this property into a PropCommand.
 
PropInteger asInteger (Error &err=Error::Default()) const
 Converts this property into a PropInteger.
 
PropBoolean asBoolean (Error &err=Error::Default()) const
 Converts this property into a PropBoolean.
 
PropFloat asFloat (Error &err=Error::Default()) const
 Converts this property into a PropFloat.
 
PropString asString (Error &err=Error::Default()) const
 Converts this property into a PropString.
 
PropEnumeration asEnumeration (Error &err=Error::Default()) const
 Converts this property into a PropEnumeration.
 
PropEnumEntry asEnumEntry (Error &err=Error::Default()) const
 Converts this property into a PropEnumEntry.
 
PropRegister asRegister (Error &err=Error::Default()) const
 Converts this property into a PropRegister.
 
PropCategory asCategory (Error &=Error::Default()) const
 Converts this property into a PropCategory.
 
NotificationToken eventAddNotification (NotificationHandler cb, Error &err=Error::Default())
 Registers a new property notification event handler.
 
bool eventRemoveNotification (NotificationToken token, Error &err=Error::Default())
 Unregisters a previously registered property notification event handler.
 
bool isSelector (Error &err=Error::Default()) const
 Indicates whether this property's value changes the meaning and/or value of other properties.
 
std::vector< PropertyselectedProperties (Error &err=Error::Default()) const
 Returns the list of properties whose values' meaning depend on this property.
 

Additional Inherited Members

- Public Types inherited from Property
using NotificationHandler = std::function< void(Property &prop)>
 Function prototype for property notification event handlers.
 
using NotificationToken = void *
 Represents a registered callback.
 

Detailed Description

String properties represent features whose value is a text.

The maximum length of the text is indicated by PropString::maxLength().

PropString instances are created in two ways:

Member Function Documentation

◆ getValue()

std::string getValue ( Error err = Error::Default()) const
inline

Reads the current value of this property.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The current value.
If an error occurs, the function returns an empty string. Check the err output parameter for details.
See also
PropString::setValue()

◆ maxLength()

uint64_t maxLength ( ic4::Error err = Error::Default()) const
inline

Returns the maximum length of the string that can be stored in this property.

Parameters
[out]errReference to an error handler. See Error Handling for details.
Returns
The maximum string length.
If an error occurs, the function returns 0. Check the err output parameter for details.

◆ setValue()

bool setValue ( const std::string &  value,
Error err = Error::Default() 
)
inline

Changes the value of this property.

Parameters
[in]valueThe new value to set
[out]errReference to an error handler. See Error Handling for details.
Returns
true on success, otherwise false.
Check the err output parameter for details.
See also
PropString::getValue()