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. This also accepts lists in the form


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

PropertyReaderFactory prop_factory;
PropertiesReaderInterface *reader = prop_factory.get_properties_reader_interface( "" );

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");

if ( reader->list_exist("RedisConnectionString") ) {
  std::vector<std::string> list = reader->get_list("RedisConnectionString");

Go Home