Cupt
common.hpp
Go to the documentation of this file.
1/**************************************************************************
2* Copyright (C) 2010-2014 by Eugene V. Lyubimkin *
3* *
4* This program is free software; you can redistribute it and/or modify *
5* it under the terms of the GNU General Public License *
6* (version 3 or above) as published by the Free Software Foundation. *
7* *
8* This program is distributed in the hope that it will be useful, *
9* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11* GNU General Public License for more details. *
12* *
13* You should have received a copy of the GNU GPL *
14* along with this program; if not, write to the *
15* Free Software Foundation, Inc., *
16* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA *
17**************************************************************************/
18#ifndef CUPT_COMMON_SEEN
19#define CUPT_COMMON_SEEN
20
22#define CUPT_API __attribute__ ((visibility("default")))
23#define CUPT_LOCAL __attribute__ ((visibility("hidden")))
25
27
28#include <string>
29#include <vector>
30#include <memory>
31#include <stdexcept>
32#include <cstdint>
33
35namespace cupt {
36
37CUPT_API extern const char* const libraryVersion;
38
39using std::vector;
40using std::string;
41
43
46class CUPT_API Exception: public std::runtime_error
47{
48 public:
50
55 Exception(const char* message)
56 : std::runtime_error(message)
57 {}
58
59
62 Exception(const string& message)
63 : std::runtime_error(message)
64 {}
65};
66
67using std::pair;
68
69using std::shared_ptr;
70using std::static_pointer_cast;
71using std::dynamic_pointer_cast;
72using std::unique_ptr;
73
75
79CUPT_API extern int messageFd;
80
82CUPT_API string join(const string& joiner, const vector< string >& parts);
83CUPT_API string humanReadableSizeString(uint64_t bytes);
84CUPT_API string globToRegexString(const string&);
86
88
92CUPT_API const char* __(const char* message);
93
94} // namespace
95
96#include <cupt/format2.hpp>
97
98#endif
99
Exception(const char *message)
constructor
Definition common.hpp:55
Exception(const string &message)
constructor
Definition common.hpp:62
STL class.
const char *const libraryVersion
the version of Cupt library
const char * __(const char *message)
localizes message