forked from edukaj/fontdef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogramoptions.h
More file actions
72 lines (58 loc) · 1.92 KB
/
programoptions.h
File metadata and controls
72 lines (58 loc) · 1.92 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#ifndef PROGRAMOPTIONS_H
#define PROGRAMOPTIONS_H
#include "codepoint.h"
#include <string>
#include <boost/program_options.hpp>
#include <iosfwd>
class ProgramOptions {
public:
using CodePoints = std::vector< CodePointRange >;
enum class FileFormat { BMP, JPEG, PNG, DDS };
enum class LogLevel { NONE, LOW, MEDIUM, HIGH };
ProgramOptions(int argc, char* argv[]);
const std::string& version() const noexcept;
bool showOnlyUsage() const noexcept;
bool showOnlyVersion() const noexcept;
void printParameterOn(std::ostream& os) const noexcept;
const std::string& fontName() const noexcept;
const std::string& output() const noexcept;
const std::string& inputFont() const noexcept;
float size() const noexcept;
int resolution() const noexcept;
int charachterSpace() const noexcept;
int pixelSize() const noexcept;
bool useAntialiasColor() const noexcept;
const std::string& imageFilename() const noexcept;
const std::string& imageExtension() const noexcept;
bool isAppend() const noexcept;
LogLevel verboseLevel() const noexcept;
const CodePoints& codepoints() const noexcept;
friend std::ostream& operator << (std::ostream& os, const ProgramOptions& po);
private:
bool mustDisplayOnlyHelp(int argc) const noexcept;
bool mustDisplayOnlyVersion() const noexcept;
void fillDescription();
void extractImageFilenameAndExtension();
bool exist(const std::string& str) const noexcept;
void logParameters();
private:
boost::program_options::options_description desc{"Options"};
boost::program_options::variables_map vm;
std::string mInputFont;
std::string mOutputFontDef;
std::string mFontName;
std::string mImageFilename;
std::string mImageExtension;
std::vector<CodePointRange> mCodePoints;
float mSize;
int mResolution;
int mCharSpace;
int mVerboseLevel;
int mPixelSize;
bool mIsAppend;
bool mUseAntialiasColor;
bool mShowOnlyVersion;
bool mShowOnlyUsage;
};
#endif // PROGRAMOPTIONS_H