Qt Virtual Chart Table (QVCT)
CUnitTimeZone.cpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 // QT
20 #include <QMap>
21 #include <QString>
22 
23 // QVCT
24 #include "units/CUnitTimeZone.hpp"
25 
26 
27 //------------------------------------------------------------------------------
28 // CONSTANTS / STATIC
29 //------------------------------------------------------------------------------
30 
33 
34 const QMap<CUnitTimeZone::EUnit,QString> &CUnitTimeZone::symbols()
35 {
37 }
38 
40 {
41  return oUnitTimeZoneSymbols.qMapSymbols.value( _eUnit, "?" );
42 }
43 
45 {
46  return oUnitTimeZoneSymbols.qMapSymbols.key( _rqString, UNDEFINED );
47 }
48 
49 const QMap<CUnitTimeZone::EUnit,QString> &CUnitTimeZone::codes()
50 {
52 }
53 
55 {
56  return oUnitTimeZoneCodes.qMapCodes.value( _eUnit, "undef" );
57 }
58 
59 CUnitTimeZone::EUnit CUnitTimeZone::fromCode( const QString& _rqString )
60 {
61  return oUnitTimeZoneCodes.qMapCodes.key( _rqString, UNDEFINED );
62 }
Container class for supported machine-friendly format/unit codes.
QMap< CUnitTimeZone::EUnit, QString > qMapCodes
Container class for supported human-readable format/unit symbols.
QMap< CUnitTimeZone::EUnit, QString > qMapSymbols
static QString toCode(EUnit _eUnit)
Returns the machine-friendly code corresponding to the given format/unit ID.
static EUnit fromSymbol(const QString &_rqsSymbol)
Returns the format/unit ID corresponding to the given human-readable symbol.
static EUnit fromCode(const QString &_rqsCode)
Returns the format/unit ID corresponding to the given machine-friendly code.
static QString toSymbol(EUnit _eUnit)
Returns the human-readable symbol corresponding to the given format/unit ID.
static const QMap< EUnit, QString > & symbols()
Returns the list of supported human-readable format/unit symbols.
static const CUnitTimeZoneSymbols oUnitTimeZoneSymbols
Container for supported human-readable format/unit symbols.
static const QMap< EUnit, QString > & codes()
Returns the list of supported machine-friendly format/unit codes.
static const CUnitTimeZoneCodes oUnitTimeZoneCodes
Container for supported machine-friendly format/unit codes.
EUnit
Format/unit ID.
@ UNDEFINED
undefined format/unit