Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
LocalPolicy Namespace Reference

Local policy settings. More...

Typedefs

using PolicyKey = Yuni::ShortString64
 A key entry.
 

Functions

bool Open (bool expandEntries=true)
 Open the local policies.
 
void Close ()
 Close all resources related to the local policies.
 
void CheckRootPrefix (const char *argv0)
 Check the root prefix, and throws a FatalError if fails.
 
bool Read (YString &out, const PolicyKey &key)
 Read the content of a single entry.
 
bool ReadAsBool (const PolicyKey &key, bool defval=false)
 Read the content of a single entry as a bool.
 
void DumpToLogs ()
 Dump the entries to the logs.
 
void DumpToString (Yuni::Clob &out)
 Dump to string.
 
bool Read (String &out, const PolicyKey &key)
 
void DumpToString (Clob &out)
 

Detailed Description

Local policy settings.

Function Documentation

◆ Open()

bool LocalPolicy::Open ( bool expandEntries = true)

Open the local policies.

Nothing will be done (and will return true) if the local policies are already loaded.

Parameters
expandEntriesTrue to expand the raw values
Returns
True if some local policies have been found

◆ Read()

bool LocalPolicy::Read ( YString & out,
const PolicyKey & key )

Read the content of a single entry.

If the local policies are not opened, the value is guaranted to be empty.

Returns
True if the entry exists, false otherwise

◆ ReadAsBool()

bool LocalPolicy::ReadAsBool ( const PolicyKey & key,
bool defval = false )

Read the content of a single entry as a bool.

If the local policies are not opened, the value is guaranted to be defval.

Returns
True if the entry exists, false otherwise