2016-07-05 11:01:22 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
#include <memory>
|
|
|
|
#include <ostream>
|
|
|
|
#include <string>
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
#include "storage/model/properties/flags.hpp"
|
|
|
|
|
|
|
|
class String
|
2016-07-05 11:01:22 +08:00
|
|
|
{
|
|
|
|
public:
|
2016-09-05 17:02:48 +08:00
|
|
|
const static Type type;
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
String(std::string const &d) : data(d) {}
|
|
|
|
String(std::string &&d) : data(std::move(d)) {}
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
std::string &value() { return data; }
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
std::string const &value() const { return data; }
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
std::ostream &print(std::ostream &stream) const;
|
|
|
|
|
|
|
|
friend std::ostream &operator<<(std::ostream &stream, const String &prop);
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-08-15 20:21:38 +08:00
|
|
|
bool operator==(const String &other) const;
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-08-15 20:21:38 +08:00
|
|
|
bool operator==(const std::string &other) const;
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
operator const std::string &() const;
|
2016-07-05 11:01:22 +08:00
|
|
|
|
2016-09-05 17:02:48 +08:00
|
|
|
private:
|
|
|
|
std::string data;
|
2016-07-05 11:01:22 +08:00
|
|
|
};
|