aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/PostBuildLint_BuildType.h
blob: a5cb24f492ee259d85374d4c63f28d16950d472c (plain)
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
#pragma once
#include "PostBuildLint_ConfigurationType.h"
#include "PostBuildLint_LinkageType.h"
#include <vector>
#include <regex>

namespace vcpkg::PostBuildLint
{
    struct BuildType
    {
        static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage);

        static const BuildType DEBUG_STATIC;
        static const BuildType DEBUG_DYNAMIC;
        static const BuildType RELEASE_STATIC;
        static const BuildType RELEASE_DYNAMIC;

        static const std::vector<BuildType>& values()
        {
            static const std::vector<BuildType> v = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC };
            return v;
        }

        BuildType() = delete;

        const ConfigurationType& config() const;
        const LinkageType& linkage() const;
        std::regex crt_regex() const;
        std::string toString() const;

    private:
        BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string)
            : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string)
        {
        }

        ConfigurationType m_config;
        LinkageType m_linkage;
        std::string m_crt_regex_as_string;
    };

    bool operator ==(const BuildType& lhs, const BuildType& rhs);

    bool operator !=(const BuildType& lhs, const BuildType& rhs);
}