FOSSredder 0.5.0
Loading...
Searching...
No Matches
EntityName.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <algorithm>
9#include <cstddef>
10#include <cctype>
11#include <string>
12#include <utility>
13
14namespace core::domain {
15
17public:
18 const std::string& value() const noexcept;
19
20 EntityName() = default;
25 explicit EntityName(std::string value);
26
31 static constexpr std::size_t maxLength() noexcept;
32
38 static std::string normalize(std::string value);
39
45 static bool isValid(const std::string& value);
46
51 bool empty() const noexcept;
52
53private:
54 std::string value_;
55};
56
57} // namespace core::domain
const std::string & value() const noexcept
static bool isValid(const std::string &value)
Checks whether a raw name is valid.
bool empty() const noexcept
Checks whether the stored value is empty.
static constexpr std::size_t maxLength() noexcept
Returns the maximum supported entity name length.
static std::string normalize(std::string value)
Trims leading and trailing whitespace from a name.