|
Crossfire Server, Trunk
|
#include <LicenseManager.h>

Public Types | |
| typedef std::pair< std::string, std::string > | LicenseItem |
| typedef std::map< std::string, std::vector< LicenseItem > > | LicenseItems |
Public Member Functions | |
| std::map< std::string, LicenseItems > | getAll () const |
| LicenseItems | getForFace (const std::string &face) |
| LicenseManager () | |
| void | readLicense (BufferReader *reader, const char *filename) |
| void | reset () |
| virtual | ~LicenseManager () |
Static Public Member Functions | |
| static std::string | licenseNameFromFaceName (const std::string &face) |
| static void | parseLicenseFile (BufferReader *reader, const char *filename, std::vector< LicenseItem > &items) |
Private Attributes | |
| std::map< std::string, LicenseItems > | m_licenses |
Contains all information about licenses for faces.
Definition at line 25 of file LicenseManager.h.
| typedef std::pair<std::string, std::string> LicenseManager::LicenseItem |
One line in a license file.
Definition at line 28 of file LicenseManager.h.
| typedef std::map<std::string, std::vector<LicenseItem> > LicenseManager::LicenseItems |
For a single face, map between a faceset's prefix and the license items.
Definition at line 29 of file LicenseManager.h.
| LicenseManager::LicenseManager | ( | ) |
Standard constructor.
Definition at line 19 of file LicenseManager.cpp.
|
virtual |
Standard destructor.
Definition at line 22 of file LicenseManager.cpp.
|
inline |
Get all known license information.
Definition at line 47 of file LicenseManager.h.
References m_licenses.
Referenced by CREMainWindow::onReportLicenses().

| LicenseManager::LicenseItems LicenseManager::getForFace | ( | const std::string & | face | ) |
Get license information for a face.
| face | face name, with the suffix. |
Definition at line 75 of file LicenseManager.cpp.
References licenseNameFromFaceName(), and m_licenses.
Referenced by CREFacePanel::updateItem().


|
static |
Get the expected license name from a face name.
| face | face name, with the suffix. |
Definition at line 83 of file LicenseManager.cpp.
Referenced by getForFace(), and CREMainWindow::onReportLicenses().

|
static |
Definition at line 57 of file LicenseManager.cpp.
References bufferreader_current_line(), bufferreader_next_line(), c, npc_dialog::filename, line, llevError, and LOG().
Referenced by readLicense(), and SoundFiles::refreshSounds().


| void LicenseManager::readLicense | ( | BufferReader * | reader, |
| const char * | filename | ||
| ) |
Process a license file.
| reader | source. |
| filename | full file name. |
Definition at line 25 of file LicenseManager.cpp.
References c, npc_dialog::filename, llevError, LOG(), m_licenses, parseLicenseFile(), and nlohmann::detail::void().
Referenced by ResourcesManager::load().


|
inline |
Reset license information, before a reloading.
Definition at line 52 of file LicenseManager.h.
References m_licenses.
Referenced by CREMainWindow::onToolReloadAssets().

|
private |
License information for all faces.
Definition at line 71 of file LicenseManager.h.
Referenced by getAll(), getForFace(), readLicense(), and reset().