/usr/include/dballe/core/defs.h is in libdballe-dev 7.21-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | #ifndef DBA_MSG_DEFS_H
#define DBA_MSG_DEFS_H
/** @file
* Common definitions
*/
#include <dballe/types.h>
#include <limits.h>
#include <string>
#include <iosfwd>
namespace dballe {
/**
* A station identifier, that can be any string (including the empty string) or
* a missing value.
*/
class Ident
{
protected:
char* value = nullptr;
public:
Ident() = default;
Ident(const char* value);
Ident(const Ident& o);
Ident(Ident&& o);
~Ident();
Ident& operator=(const Ident& o);
Ident& operator=(Ident&& o);
Ident& operator=(const char* o);
Ident& operator=(const std::string& o);
const char* get() const { return value; }
void clear();
int compare(const Ident& o) const;
int compare(const char* o) const;
int compare(const std::string& o) const;
template<typename T> bool operator==(const T& o) const { return compare(o) == 0; }
template<typename T> bool operator!=(const T& o) const { return compare(o) != 0; }
template<typename T> bool operator<(const T& o) const { return compare(o) < 0; }
template<typename T> bool operator<=(const T& o) const { return compare(o) <= 0; }
template<typename T> bool operator>(const T& o) const { return compare(o) > 0; }
template<typename T> bool operator>=(const T& o) const { return compare(o) >= 0; }
bool is_missing() const { return value == nullptr; }
operator const char*() const { return value; }
operator std::string() const;
};
}
#endif
|