~aleteoryx/muditaos

ref: d6fbf631f649c7e85db1584aef774deed7ecb757 muditaos/module-db/Interface/CountryCodeRecord.hpp -rw-r--r-- 982 bytes
d6fbf631 — Kuba Kleczkowski [MOS-792] Added VoLTE setting in db 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "../Common/Common.hpp"
#include "../Databases/CountryCodesDB.hpp"
#include "Record.hpp"
#include "utf8/UTF8.hpp"

#include <vector>

struct CountryCodeRecord
{
    uint32_t id;
    uint32_t mcc;
    uint32_t mnc;
    UTF8 iso;
    UTF8 country;
    uint32_t country_code;
    UTF8 network;
};

enum class CountryCodeRecordField
{
    MCC,
    MNC,
    ISO,
    Country
};

class CountryCodeRecordInterface : public RecordInterface<CountryCodeRecord, CountryCodeRecordField>
{

  public:
    CountryCodeRecordInterface(CountryCodesDB *db) : codesDB(db)
    {}
    ~CountryCodeRecordInterface()
    {}
    CodesTableRow GetByMCC(uint32_t mcc)
    {
        if (codesDB) {
            return (codesDB->countryCodes.GetByMCC(mcc));
        }

        return (CodesTableRow());
    }

  private:
    CountryCodesDB *codesDB;
};