AOSharedServiceLibrary
Properties File Reader Interface

The property file reader accepts properties file names and interprets them. It accepts properties in the form property_name=property_value.

#include "aossl/properties/include/factory_props.h"
#include "aossl/core/include/kv_store_interface.h"
#include <string>
#include <vector>

AOSSL::PropertyReaderFactory prop_factory;
AOSSL::PropertiesReaderInterface *reader = prop_factory.get_properties_reader_interface( "test.properties" );

We can access properties via the get_opt method, and lists via the get_list method. We also have opt_exist and list_exist methods so we can determine if something has been detected in the configuration file.

if ( reader->opt_exist("DB_Password") ) {
  std::string db_pswd = reader->get_opt("DB_Password");
}

Go Home