Software and Services, Portable Libraries  2019.Mar.01
A library for managing digital certificates
SoftwareAndServices::Library::Common::Preference Class Reference

A base class for PreferencSet and PreferenceFile. More...

#include "<SaS/Common/PreferenceSet.hpp>"

+ Inheritance diagram for SoftwareAndServices::Library::Common::Preference:
+ Collaboration diagram for SoftwareAndServices::Library::Common::Preference:

Public Types

enum  Choice_t { ChoiceNotSet_t = 0, SingleEntry_t, ListOfItems_t, Range_t }
 Choice type. More...
 
enum  Scope_t {
  ScopeNotSet_t = 0, UserScope_t, ApplicationScope_t, SystemScope_t,
  SiteScope_t, RealmScope_t, CompanyScope_t, LicenseScope_t
}
 Get the scope of this preference. More...
 
enum  Type_t {
  TypeNotSet_t = 0, IsString_t, IsInt_t, IsFloat_t,
  IsBool_t, IsDate_t, IsTime_t, IsDateTime_t
}
 Preference type. More...
 

Public Member Functions

 Preference (PreferenceSet *Parent, const char *PrefName)
 Preference - Constructor. More...
 
 Preference (const Preference &CopyFrom)
 Preference - Copy Constructor. More...
 
virtual ~Preference ()
 Preference - Destructor. More...
 
Choice_t ChoiceType () const
 Get the Choice type. More...
 
void ChoiceType (Choice_t TheChoice)
 Set the choice type. More...
 
const char * Comment () const
 Get the comment for this preference. More...
 
void Comment (const char *NewComment)
 Set the comment for this preference. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance. More...
 
bool Get (String &Value) const
 Get a string preference. More...
 
bool Get (int64_t &Value) const
 Get an integer preference. More...
 
bool Get (double &Value) const
 Get a float preference. More...
 
bool Get (bool &Value) const
 Get a boolean preference. More...
 
bool Get (DateTime &Value) const
 Get a DateTime preference. More...
 
bool Get (std::vector< bool > &List) const
 Get the bool List. More...
 
bool Get (std::vector< String *> &List) const
 Get the String List. More...
 
bool Get (std::vector< int8_t > &List) const
 Get the integer List. More...
 
bool Get (std::vector< int16_t > &List) const
 Get the integer List. More...
 
bool Get (std::vector< int32_t > &List) const
 Get the integer List. More...
 
bool Get (std::vector< int64_t > &List) const
 Get the integer List. More...
 
bool Get (std::vector< double > &List) const
 Get a double List. More...
 
bool Get (std::vector< DateTime *> &List) const
 Get a DateTime List. More...
 
virtual InstanceCount_t getInstance () const
 
bool GetKey (String &Key) const
 Get the Key name. More...
 
void HighRange (int8_t High)
 Set a high range. More...
 
void HighRange (int16_t High)
 Set a high range. More...
 
void HighRange (int32_t High)
 Set a high range. More...
 
void HighRange (int64_t High)
 Set a high range. More...
 
void HighRange (float High)
 Set a high range. More...
 
void HighRange (double High)
 Set a high range. More...
 
void HighRange (DateTime &High)
 Set a high range. More...
 
const DateTimeHighRangeDateTime () const
 Get the high range. More...
 
double HighRangeDouble () const
 Get the high range. More...
 
int64_t HighRangeInt64_t () const
 Get the high range. More...
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
void LowRange (int8_t Low)
 Set a low range. More...
 
void LowRange (int16_t Low)
 Set a low range. More...
 
void LowRange (int32_t Low)
 Set a low range. More...
 
void LowRange (int64_t Low)
 Set a low range. More...
 
void LowRange (float Low)
 Set a low range. More...
 
void LowRange (double Low)
 Set a low range. More...
 
void LowRange (DateTime &Low)
 Set a low range. More...
 
const DateTimeLowRangeDateTime () const
 Get the low range. More...
 
double LowRangeDouble () const
 Get the low range. More...
 
int64_t LowRangeInt64_t () const
 Get the low range. More...
 
void operator delete (void *ToFree)
 
bool operator!= (const Preference &CompareTo) const
 Preference - Compare operator (!=). More...
 
Preferenceoperator= (const Preference &CopyFrom)
 Preference - Copy operator. More...
 
bool operator== (const Preference &CompareTo) const
 Preference - Compare operator (==). More...
 
PreferenceSetParent () const
 Get the parent PreferenceSet object. More...
 
bool Read (FILE *Fp, Scope_t Scope, bool InXdr=false)
 Read this preference from a (FILE*). More...
 
void ReadOnly (bool IsReadOnly)
 Mark this preference as read-only to calling applications. More...
 
bool ReadOnly () const
 See if this object value is read-only. More...
 
Scope_t Scope () const
 Get the scope of the preference. More...
 
bool Scope (Scope_t NewScope)
 Set the scope of this preference. More...
 
bool Set (const String &Value)
 Set this as a string preference. More...
 
bool Set (const char *Value)
 Set this as a string preference. More...
 
bool Set (const char16_t *Value)
 Set this as a string preference. More...
 
bool Set (const char32_t *Value)
 Set this as a string preference. More...
 
bool Set (int8_t Value)
 Set this as an integer preference. More...
 
bool Set (int16_t Value)
 Set this as an integer preference. More...
 
bool Set (int32_t Value)
 Set this as an integer preference. More...
 
bool Set (int64_t Value)
 Set this as an integer preference. More...
 
bool Set (double Value)
 Set a float preference. More...
 
bool Set (bool Value)
 Set a boolean preference. More...
 
bool Set (DateTime &Value)
 Set a DateTime preference. More...
 
bool Set (const std::vector< bool > &List)
 Set a bool List. More...
 
bool Set (const std::vector< const char *> &List)
 Set a String List. More...
 
bool Set (const std::vector< String *> &List)
 Set a String List. More...
 
bool Set (const std::vector< int8_t > &List)
 Set a integer List. More...
 
bool Set (const std::vector< int16_t > &List)
 Set a integer List. More...
 
bool Set (const std::vector< int32_t > &List)
 Set a integer List. More...
 
bool Set (const std::vector< int64_t > &List)
 Set a integer List. More...
 
bool Set (const std::vector< float > &List)
 Set a double List. More...
 
bool Set (const std::vector< double > &List)
 Set a double List. More...
 
bool Set (const std::vector< DateTime *> &List)
 Set a DateTime List. More...
 
bool SetName (const char *const Name)
 Set the preference Name. More...
 
Type_t Type () const
 Get the type of data in this preference. More...
 
void Type (Type_t TheType)
 Set the type of data in this preference. More...
 
bool Write (FILE *Fp, Scope_t Scope, bool InXdr=false)
 Write this preference to a (FILE*). More...
 
virtual bool_t xdr (XDR *xdrs)
 Read/Write the Preference in XDR format. More...
 

Static Public Member Functions

static bool_t xdr_Preference (XDR *xdrs, Preference *Pointer)
 Read/Write the Preference in XDR format. More...
 
static bool_t xdr_Preference (XDR *xdrs, void *Pointer)
 Read/Write the Preference in XDR format. More...
 
static bool_t xdr_T (XDR *xdrs, Preference *Pointer)
 Read/Write the XDR object. More...
 
static bool_t xdr_T (XDR *xdrs, void *Pointer)
 Read/Write the XDR object. More...
 

Detailed Description

A base class for PreferencSet and PreferenceFile.

A single preference that may have zero or more values.

Note
Normally a calling application will use the API from PreferenceSet or PreferenceFile as those allow for I/O and groups of preferences. This API supports groups created by PreferenceSet and PreferenceFile only. This API does not support preference groups directly by calling applications - Use PreferenceSet/PreferenceFile.

Definition at line 100 of file libSaSCommon/Preference.hpp.

Member Enumeration Documentation

◆ Choice_t

Choice type.

Enumerator
ChoiceNotSet_t 

Choice not set.

SingleEntry_t 

Is a single entry entered.

ListOfItems_t 

Is a zero or more items.

Range_t 

Is a range, with the first being the lowest, and the second being the highest.

Definition at line 232 of file libSaSCommon/Preference.hpp.

◆ Scope_t

Get the scope of this preference.

These scopes are not hard coded. It is up to the application, system administrators, and users to define which scope a preference goes into.

For users of the SoftwareAndServices::Libary::UPN library "UPN" library, these map to the role database table and associated library methods.

Enumerator
ScopeNotSet_t 

Not yet set.

ApplicationScope_t 

Application - Preferences that are set by the application.

These might include installed paths or the location of configuration files. Generally not changed by users.

SystemScope_t 

System scope - Preferences set by the computer administrator.

These include the location of files for other users, applications, or networks. Might be edited by an administrative user.

SiteScope_t 

Site Scope - Preferences set by your location within your organization.

Perhaps the organization or company division, department, site servers and other site specific information. Might be edited by an administrative user.

RealmScope_t 

Realm Scope - Preferences set by your organization within your company.

Enginering, Test, Production, ... Might be edited by an administrative user.

CompanyScope_t 

Company Scope - Preferences such as the company name, contact information, company top level domains.

Might be edited by an administrative user.

LicenseScope_t 

License Scope - Preferences that are directly related to the licensing of the product.

Such as the location of product keys, certificates, or other license information. Generally only set at product installation or update time and often not alterable by the user.

Definition at line 268 of file libSaSCommon/Preference.hpp.

◆ Type_t

Preference type.

Enumerator
TypeNotSet_t 

Type not set.

IsString_t 

Is a string.

IsInt_t 

Is a signed integer - up to 64 bit.

IsFloat_t 

Is a floating point type.

IsBool_t 

Is a boolean type.

IsDate_t 

Is Date.

IsTime_t 

Is Time (not including Date).

IsDateTime_t 

Is DateTime.

Definition at line 185 of file libSaSCommon/Preference.hpp.

Constructor & Destructor Documentation

◆ Preference() [1/2]

SoftwareAndServices::Library::Common::Preference::Preference ( PreferenceSet Parent,
const char *  PrefName 
)

Preference - Constructor.

A single preference.

The define Scope() is UserScope_t The default ChoiceType() is SingleEntry_t,

Parameters
ParentThe PreferencSet parent.
PrefNameThe name of the preference (key). If nullptr, nullptr will be used.

◆ Preference() [2/2]

SoftwareAndServices::Library::Common::Preference::Preference ( const Preference CopyFrom)

Preference - Copy Constructor.

Parameters
CopyFromThe Preference to copy from.

◆ ~Preference()

virtual SoftwareAndServices::Library::Common::Preference::~Preference ( )
virtual

Preference - Destructor.

Member Function Documentation

◆ ChoiceType() [1/2]

Choice_t SoftwareAndServices::Library::Common::Preference::ChoiceType ( ) const

Get the Choice type.

It is set by calling one of the Set() values. The last type Set(), is the data type.

Returns
The Choice_t of this preference. Returns ChoiceNotSet_t when no preference has been set.

◆ ChoiceType() [2/2]

void SoftwareAndServices::Library::Common::Preference::ChoiceType ( Choice_t  TheChoice)

Set the choice type.

Parameters
TheChoiceThe type of choice for this preference.

◆ Comment() [1/2]

const char* SoftwareAndServices::Library::Common::Preference::Comment ( ) const

Get the comment for this preference.

Returns
The comment for this preference or nullptr when none.

◆ Comment() [2/2]

void SoftwareAndServices::Library::Common::Preference::Comment ( const char *  NewComment)

Set the comment for this preference.

Parameters
NewCommentUse this comment for this preference.

◆ decInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< Preference >::decInstance ( ) const
inlinevirtualinherited

Decrement the instance.

Returns
The instance count, after decrementing it.

Definition at line 129 of file instance.hpp.

◆ Get() [1/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( String Value) const

Get a string preference.

Parameters
[out]ValueWhere to store the value.
Returns
true if Value set. Returns false when this preference is not a string preference.

◆ Get() [2/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( int64_t &  Value) const

Get an integer preference.

Parameters
[out]ValueWhere to store the value.
Returns
true if found and Value set. Returns false when Value is not an integer value or when Value will not fit into 64-bits.

◆ Get() [3/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( double &  Value) const

Get a float preference.

Parameters
[out]ValueWhere to store the value.
Returns
true if found and Value set.

◆ Get() [4/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( bool &  Value) const

Get a boolean preference.

Parameters
[out]ValueWhere to store the value.
Returns
true if found and Value set. Returns false when this is not a boolean type.

◆ Get() [5/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( DateTime Value) const

Get a DateTime preference.

DateTime can be used as a DateTime, Date, or Time value.

Parameters
[out]ValueWhere to store the value.
Returns
true if found and Value set. Returns false when this is not a DataTime type.

◆ Get() [6/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< bool > &  List) const

Get the bool List.

This is used for Preferences that are a list of bool objects.

Parameters
List[out]Where the results will be stored.
Returns
true if the data was accepted. Returns false when this is not a string list type.

◆ Get() [7/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< String *> &  List) const

Get the String List.

This is used for Preferences that are a list of String objects.

Parameters
List[out]Where the results will be stored.
Returns
true if the data was accepted. Returns false when this is not a string list type.

◆ Get() [8/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< int8_t > &  List) const

Get the integer List.

This is used for Preferences that are a list of int objects.

Parameters
[out]ListWhere the results will be stored.
Returns
true if the data was accepted.

◆ Get() [9/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< int16_t > &  List) const

Get the integer List.

This is used for Preferences that are a list of int objects.

Parameters
[out]ListWhere the results will be stored.
Returns
true if the data was accepted.

◆ Get() [10/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< int32_t > &  List) const

Get the integer List.

This is used for Preferences that are a list of int objects.

Parameters
[out]ListWhere the results will be stored.
Returns
true if the data was accepted.

◆ Get() [11/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< int64_t > &  List) const

Get the integer List.

This is used for Preferences that are a list of int objects.

Parameters
[out]ListWhere the results will be stored.
Returns
true if the data was accepted.

◆ Get() [12/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< double > &  List) const

Get a double List.

This is used for Preferences that are a list of double objects.

Returns
true if the data was accepted.

◆ Get() [13/13]

bool SoftwareAndServices::Library::Common::Preference::Get ( std::vector< DateTime *> &  List) const

Get a DateTime List.

This is used for Preferences that are a list of int objects.

Returns
true if the data was accepted.

◆ getInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< Preference >::getInstance ( ) const
inlinevirtualinherited
Returns
The current instance count.

Definition at line 118 of file instance.hpp.

◆ GetKey()

bool SoftwareAndServices::Library::Common::Preference::GetKey ( String Key) const

Get the Key name.

Parameters
[out]KeyWhere to place the key.
Returns
true if the key had been set and Key was filled in.

◆ HighRange() [1/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( int8_t  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [2/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( int16_t  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [3/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( int32_t  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [4/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( int64_t  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [5/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( float  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [6/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( double  High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRange() [7/7]

void SoftwareAndServices::Library::Common::Preference::HighRange ( DateTime High)

Set a high range.

Parameters
HighThe high end of the range. It will be <= to the High value.

◆ HighRangeDateTime()

const DateTime* SoftwareAndServices::Library::Common::Preference::HighRangeDateTime ( ) const

Get the high range.

Parameters
[out]HighThe high end of the range. It will be <= to the High value.
Returns
true if this preference is a range preference and High was set. Returns false if no range was set, or the preference is not of this type.

◆ HighRangeDouble()

double SoftwareAndServices::Library::Common::Preference::HighRangeDouble ( ) const

Get the high range.

Parameters
[out]HighThe high end of the range. It will be <= to the High value.
Returns
true if this preference is a range preference and High was set. Returns false if no range was set, or the preference is not of this type.

◆ HighRangeInt64_t()

int64_t SoftwareAndServices::Library::Common::Preference::HighRangeInt64_t ( ) const

Get the high range.

Parameters
[out]HighThe high end of the range. It will be <= to the High value.
Returns
true if this preference is a range preference and High was set. Returns false if no range was set, or the preference is not of this type.

◆ incInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< Preference >::incInstance ( ) const
inlinevirtualinherited

Increment the instance.

Returns
The instance value, after incrementing it.

Definition at line 109 of file instance.hpp.

◆ LowRange() [1/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( int8_t  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [2/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( int16_t  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [3/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( int32_t  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [4/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( int64_t  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [5/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( float  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [6/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( double  Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRange() [7/7]

void SoftwareAndServices::Library::Common::Preference::LowRange ( DateTime Low)

Set a low range.

Parameters
LowThe low end of the range. It will be >= to the Low value.

◆ LowRangeDateTime()

const DateTime* SoftwareAndServices::Library::Common::Preference::LowRangeDateTime ( ) const

Get the low range.

Parameters
[out]LowThe low end of the range. It will be >= to the Low value.
Returns
true if this preference is a range preference and Low was set. Returns false if no range was set, or the preference is not of this type.

◆ LowRangeDouble()

double SoftwareAndServices::Library::Common::Preference::LowRangeDouble ( ) const

Get the low range.

Parameters
[out]LowThe low end of the range. It will be >= to the Low value.
Returns
true if this preference is a range preference and Low was set. Returns false if no range was set, or the preference is not of this type.

◆ LowRangeInt64_t()

int64_t SoftwareAndServices::Library::Common::Preference::LowRangeInt64_t ( ) const

Get the low range.

Parameters
[out]LowThe low end of the range. It will be >= to the Low value.
Returns
true if this preference is a range preference and Low was set. Returns false if no range was set, or the preference is not of this type.

◆ operator!=()

bool SoftwareAndServices::Library::Common::Preference::operator!= ( const Preference CompareTo) const

Preference - Compare operator (!=).

Parameters
CompareToThe Preference object to compare to.
Returns
true if they are equal.
Note
Because of float/double rouding issues by the C/C++ compilers at runtime. Two float/double values are considered equal when they are within (0.001) of each other. If you need exact matches, store them as strings and not float or double values.

◆ operator=()

Preference& SoftwareAndServices::Library::Common::Preference::operator= ( const Preference CopyFrom)

Preference - Copy operator.

Parameters
CopyFromThe Preference to copy from.

◆ operator==()

bool SoftwareAndServices::Library::Common::Preference::operator== ( const Preference CompareTo) const

Preference - Compare operator (==).

Parameters
CompareToThe Preference object to compare to.
Note
Because of float/double rouding issues by the C/C++ compilers at runtime. Two float/double values are considered equal when they are within (0.001) of each other. If you need exact matches, store them as strings and not float or double values.
Returns
true if they are equal.

◆ Parent()

PreferenceSet* SoftwareAndServices::Library::Common::Preference::Parent ( ) const

Get the parent PreferenceSet object.

Returns
The parent PreferenceSet of this object, or nullptr when not set.

◆ Read()

bool SoftwareAndServices::Library::Common::Preference::Read ( FILE *  Fp,
Scope_t  Scope,
bool  InXdr = false 
)

Read this preference from a (FILE*).

Parameters
FpThe open FILE poiner to read from.
ScopeWhich to write. When this->Scope() != Scope, nothing is done and this method returns true.
InXdrOptional and when true, the file will be read in XDR format.
Returns
true if read. Returns false when unable to read to Fp. Returns false when unable to parse the current line in Fp.

◆ ReadOnly() [1/2]

void SoftwareAndServices::Library::Common::Preference::ReadOnly ( bool  IsReadOnly)

Mark this preference as read-only to calling applications.

Parameters
IsReadOnlyWhen true, set this preference read only. Once set, it can not be un-set.
Note
There is NO-un-mark-read-only.

◆ ReadOnly() [2/2]

bool SoftwareAndServices::Library::Common::Preference::ReadOnly ( ) const

See if this object value is read-only.

Returns
true when this objects value is read only. All attempts to update or set the value will be ignored.

◆ Scope() [1/2]

Scope_t SoftwareAndServices::Library::Common::Preference::Scope ( ) const

Get the scope of the preference.

Returns
The scope of this preference.
Note
It is NOT required that a preference have a scope, this may return ScopeNotSet_t.

◆ Scope() [2/2]

bool SoftwareAndServices::Library::Common::Preference::Scope ( Scope_t  NewScope)

Set the scope of this preference.

Parameters
NewScopeThe new Scope_t to use.
Returns
true when accepted. False when not accepted.
Note
Once set, the Scope can not be changed.

◆ Set() [1/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const String Value)

Set this as a string preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList().

◆ Set() [2/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const char *  Value)

Set this as a string preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList().

◆ Set() [3/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const char16_t *  Value)

Set this as a string preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList().

◆ Set() [4/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const char32_t *  Value)

Set this as a string preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList().

◆ Set() [5/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( int8_t  Value)

Set this as an integer preference.

Overriding any previous value and type.

Parameters
ValueThe value of this preference.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [6/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( int16_t  Value)

Set this as an integer preference.

Overriding any previous value and type.

Parameters
ValueThe value of this preference.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [7/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( int32_t  Value)

Set this as an integer preference.

Overriding any previous value and type.

Parameters
ValueThe value of this preference.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [8/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( int64_t  Value)

Set this as an integer preference.

Overriding any previous value and type.

Parameters
ValueThe value of this preference.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [9/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( double  Value)

Set a float preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [10/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( bool  Value)

Set a boolean preference.

Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the key/value was accepted.

◆ Set() [11/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( DateTime Value)

Set a DateTime preference.

DateTime can be used as a DateTime, Date, or Time value. Overriding any previous value and type.

Parameters
ValueThe value to store.
Returns
true if the key/value was accepted. False might indicate that Value is not a valid list that was set using SetList(), LowRange(), or HighRange()

◆ Set() [12/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< bool > &  List)

Set a bool List.

This is used for Preferences that are a list of bool objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [13/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< const char *> &  List)

Set a String List.

This is used for Preferences that are a list of string objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [14/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< String *> &  List)

Set a String List.

This is used for Preferences that are a list of string objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [15/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< int8_t > &  List)

Set a integer List.

This is used for Preferences that are a list of int objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [16/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< int16_t > &  List)

Set a integer List.

This is used for Preferences that are a list of int objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [17/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< int32_t > &  List)

Set a integer List.

This is used for Preferences that are a list of int objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [18/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< int64_t > &  List)

Set a integer List.

This is used for Preferences that are a list of int objects. Overriding any previous value and type.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [19/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< float > &  List)

Set a double List.

This is used for Preferences that are a list of double objects.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [20/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< double > &  List)

Set a double List.

This is used for Preferences that are a list of double objects.

Parameters
ListThe list of valid options. They will be checked in the List order.
Returns
true if the data was accepted.

◆ Set() [21/21]

bool SoftwareAndServices::Library::Common::Preference::Set ( const std::vector< DateTime *> &  List)

Set a DateTime List.

This is used for Preferences that are a list of int objects.

Parameters
ListThe list of valid options.
Returns
true if the data was accepted.

◆ SetName()

bool SoftwareAndServices::Library::Common::Preference::SetName ( const char *const  Name)

Set the preference Name.

Parameters
NameThe name of the preference.
Returns
true when Name was accepted and set.

◆ Type() [1/2]

Type_t SoftwareAndServices::Library::Common::Preference::Type ( ) const

Get the type of data in this preference.

It is set by calling one of the Set() values. The last type Set(), is the data type.

Returns
The Type_t of this object or TypeNotSet_t when no preference has been set.

◆ Type() [2/2]

void SoftwareAndServices::Library::Common::Preference::Type ( Type_t  TheType)

Set the type of data in this preference.

It is set by calling one of the Set() values. The last type Set(), is the data type.

Parameters
TheTypeSet to this type.

◆ Write()

bool SoftwareAndServices::Library::Common::Preference::Write ( FILE *  Fp,
Scope_t  Scope,
bool  InXdr = false 
)

Write this preference to a (FILE*).

Parameters
FpThe open FILE poiner to write to.
ScopeWhich to write. When this->Scope() != Scope, nothing is done and this method returns true.
InXdrOptional and when true, the file will be written in XDR format.
Returns
true if written. Returns false when unable to write to Fp.

◆ xdr()

virtual bool_t SoftwareAndServices::Library::Common::Preference::xdr ( XDR xdrs)
virtual

Read/Write the Preference in XDR format.

Parameters
xdrsAn initialized XDR object.

Implements SoftwareAndServices::Library::Common::XdrSerialize< Preference >.

◆ xdr_Preference() [1/2]

static bool_t SoftwareAndServices::Library::Common::Preference::xdr_Preference ( XDR xdrs,
Preference Pointer 
)
static

Read/Write the Preference in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_Preference() [2/2]

static bool_t SoftwareAndServices::Library::Common::Preference::xdr_Preference ( XDR xdrs,
void *  Pointer 
)
static

Read/Write the Preference in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_T() [1/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< Preference >::xdr_T ( XDR xdrs,
Preference Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

◆ xdr_T() [2/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< Preference >::xdr_T ( XDR xdrs,
void *  Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

Member Data Documentation

◆ _BoolList

std::vector<bool>* SoftwareAndServices::Library::Common::Preference::_BoolList

When IsBool_t.

Definition at line 1190 of file libSaSCommon/Preference.hpp.

◆ _BoolValue

bool SoftwareAndServices::Library::Common::Preference::_BoolValue

When IsBool_t.

Definition at line 1140 of file libSaSCommon/Preference.hpp.

◆ _DateTimeList

std::vector<DateTime*>* SoftwareAndServices::Library::Common::Preference::_DateTimeList

When IsDateTime_t, the value.

Definition at line 1170 of file libSaSCommon/Preference.hpp.

◆ _DateTimeValue

DateTime* SoftwareAndServices::Library::Common::Preference::_DateTimeValue

When IsDateTime_t, the value.

Definition at line 1120 of file libSaSCommon/Preference.hpp.

◆ _FloatList

std::vector<double>* SoftwareAndServices::Library::Common::Preference::_FloatList

When IsFloat_t.

Definition at line 1185 of file libSaSCommon/Preference.hpp.

◆ _FloatValue

double SoftwareAndServices::Library::Common::Preference::_FloatValue

When IsFloat_t.

Definition at line 1135 of file libSaSCommon/Preference.hpp.

◆ _IntList

std::vector<int64_t>* SoftwareAndServices::Library::Common::Preference::_IntList

When int (8, 16, 32, or 64), the value.

Definition at line 1180 of file libSaSCommon/Preference.hpp.

◆ _IntValue

int64_t SoftwareAndServices::Library::Common::Preference::_IntValue

When int (8, 16, 32, or 64), the value.

Definition at line 1130 of file libSaSCommon/Preference.hpp.

◆ _StringList

std::vector<String*>* SoftwareAndServices::Library::Common::Preference::_StringList

When IsString_t, the value.

Definition at line 1175 of file libSaSCommon/Preference.hpp.

◆ _StringValue

String* SoftwareAndServices::Library::Common::Preference::_StringValue

When IsString_t, the value.

Definition at line 1125 of file libSaSCommon/Preference.hpp.


The documentation for this class was generated from the following file: