VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
makVrf::DtCountryCodesManager Class Reference

This class will read a country codes file (default settings\country-codes.csv) and allow for access of that information here. More...

Inheritance diagram for makVrf::DtCountryCodesManager:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string,
std::string > 
CountryCodes
 Map is 2 letter country code followed by engish name. More...
 

Public Member Functions

 DtCountryCodesManager (makVrv::DtDe &)
 
 DtCountryCodesManager (const DtCountryCodesManager &)
 
virtual ~DtCountryCodesManager ()
 
virtual const std::set
< std::string > & 
countryCodes () const
 Returns the current list of country codes. More...
 
virtual const CountryCodescountryCodesByCountry () const
 Returns the current list of countries mapped to country codes. More...
 
virtual const CountryCodescountriesByCountryCode () const
 Returns the current list of country codes mapped to country. More...
 
virtual void addCountry (const std::string &code, const std::string &name, bool signal=true)
 Adds a new country code and country. More...
 
virtual std::string country (const std::string &code) const
 Returns the country name for the country code. More...
 
virtual std::string countryCode (const std::string &country) const
 Returns the country code for the country name (english) More...
 
virtual bool loadCountryCodesFile (const std::string &, bool merge=false)
 Loads the country code file. Will merge if the optional flag is true, else will replace all. More...
 
virtual bool reload ()
 Clears out and reloads based on last loaded file. More...
 
virtual bool removeCountry (const std::string &, bool signal=true)
 Removes a country by code. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtCountryCodesManagerinstance (makVrv::DtDe &de)
 Returns instance of the messager. More...
 
static void registerInstance (makVrv::DtDe &, DtCountryCodesManager *)
 

Public Attributes

boost::signals2::signal< void(std::string,
std::string)> 
signal_countryAdded
 Signals Signal when country added (code, name) More...
 
boost::signals2::signal< void(std::string)> signal_countryRemoved
 Signal sent when country removed. More...
 
boost::signals2::signal< void()> signal_loaded
 Signal when loaded. More...
 

Protected Attributes

makVrv::DtDemyDe
 
std::set< std::string > myCountryCodes
 
CountryCodes myCountriesByCountryCode
 
CountryCodes myCountryCodesByCountry
 
DtFilename myLastLoadedFile
 Reverse map (for convenience) More...
 

Detailed Description

This class will read a country codes file (default settings\country-codes.csv) and allow for access of that information here.

Member Typedef Documentation

typedef std::map<std::string, std::string> makVrf::DtCountryCodesManager::CountryCodes

Map is 2 letter country code followed by engish name.

Constructor & Destructor Documentation

makVrf::DtCountryCodesManager::DtCountryCodesManager ( makVrv::DtDe )
makVrf::DtCountryCodesManager::DtCountryCodesManager ( const DtCountryCodesManager )
virtual makVrf::DtCountryCodesManager::~DtCountryCodesManager ( )
virtual

Member Function Documentation

static DtCountryCodesManager& makVrf::DtCountryCodesManager::instance ( makVrv::DtDe de)
static

Returns instance of the messager.

static void makVrf::DtCountryCodesManager::registerInstance ( makVrv::DtDe ,
DtCountryCodesManager  
)
static
virtual const std::set<std::string>& makVrf::DtCountryCodesManager::countryCodes ( ) const
inlinevirtual

Returns the current list of country codes.

virtual const CountryCodes& makVrf::DtCountryCodesManager::countryCodesByCountry ( ) const
inlinevirtual

Returns the current list of countries mapped to country codes.

virtual const CountryCodes& makVrf::DtCountryCodesManager::countriesByCountryCode ( ) const
inlinevirtual

Returns the current list of country codes mapped to country.

virtual void makVrf::DtCountryCodesManager::addCountry ( const std::string &  code,
const std::string &  name,
bool  signal = true 
)
virtual

Adds a new country code and country.

virtual std::string makVrf::DtCountryCodesManager::country ( const std::string &  code) const
virtual

Returns the country name for the country code.

Reimplemented in makVrf::DtQtCountryCodesManager.

virtual std::string makVrf::DtCountryCodesManager::countryCode ( const std::string &  country) const
virtual

Returns the country code for the country name (english)

virtual bool makVrf::DtCountryCodesManager::loadCountryCodesFile ( const std::string &  ,
bool  merge = false 
)
virtual

Loads the country code file. Will merge if the optional flag is true, else will replace all.

virtual bool makVrf::DtCountryCodesManager::reload ( )
virtual

Clears out and reloads based on last loaded file.

virtual bool makVrf::DtCountryCodesManager::removeCountry ( const std::string &  ,
bool  signal = true 
)
virtual

Removes a country by code.

Member Data Documentation

boost::signals2::signal<void (std::string, std::string)> makVrf::DtCountryCodesManager::signal_countryAdded

Signals Signal when country added (code, name)

boost::signals2::signal<void (std::string)> makVrf::DtCountryCodesManager::signal_countryRemoved

Signal sent when country removed.

boost::signals2::signal<void ()> makVrf::DtCountryCodesManager::signal_loaded

Signal when loaded.

makVrv::DtDe& makVrf::DtCountryCodesManager::myDe
protected
std::set<std::string> makVrf::DtCountryCodesManager::myCountryCodes
protected
CountryCodes makVrf::DtCountryCodesManager::myCountriesByCountryCode
protected
CountryCodes makVrf::DtCountryCodesManager::myCountryCodesByCountry
protected
DtFilename makVrf::DtCountryCodesManager::myLastLoadedFile
protected

Reverse map (for convenience)


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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)