refs #787, utility functions for shared files

* entity to shared file, shared file for DB Info
* CUrl path function
* removed redundant code in CDbInfo::getEntity() and fixed CEntityFlags::singleEntityByName
This commit is contained in:
Klaus Basan
2016-11-03 01:34:02 +01:00
parent cbcb307748
commit dcaa745e7b
7 changed files with 107 additions and 21 deletions

View File

@@ -56,6 +56,9 @@ namespace BlackMisc
//! Get entity (based on table name
Network::CEntityFlags::Entity getEntity() const;
//! The shared file name such as "airports.json"
const QString &getSharedFileName() const;
//! Set entity, should be in sync with a corresponding table name
void setEntity(Network::CEntityFlags::Entity entity);
@@ -83,6 +86,12 @@ namespace BlackMisc
//! From our database JSON format
static CDbInfo fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString());
//! The shared file names
static const QStringList &sharedFileNames();
//! Get shared file name
static const QString &entityToSharedFileName(Network::CEntityFlags::Entity entity);
private:
QString m_tableName; //!< table name
int m_entries; //!< number of entries