aboutsummaryrefslogtreecommitdiff
path: root/src/CharacterSet.cpp
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-05 01:44:45 +0100
committerMartin Fischer <martin@push-f.com>2021-12-05 01:53:28 +0100
commit799f2d02bea9bb16780bce01d4f3d831954bf9f0 (patch)
treea9c2d425aee007cf0f16cd2172f5f1a88f31d18b /src/CharacterSet.cpp
parentc3255c4473dd3976361ac52899c504c7f70c4be9 (diff)
remove C++ implementation
Diffstat (limited to 'src/CharacterSet.cpp')
-rw-r--r--src/CharacterSet.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/CharacterSet.cpp b/src/CharacterSet.cpp
deleted file mode 100644
index d0b31a4..0000000
--- a/src/CharacterSet.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * @file IsCharacterInSet.cpp
- *
- * This module contains the implementation of the
- * Uri::CharacterSet class.
- *
- * © 2018 by Richard Walters
- */
-
-#include "CharacterSet.hpp"
-
-#include <algorithm>
-#include <set>
-
-namespace Uri {
-
- /**
- * This contains the private properties of the CharacterSet class.
- */
- struct CharacterSet::Impl {
- /**
- * This holds the characters in the set.
- */
- std::set< char > charactersInSet;
- };
-
- CharacterSet::~CharacterSet() noexcept = default;
- CharacterSet::CharacterSet(const CharacterSet& other)
- : impl_(new Impl(*other.impl_))
- {
- }
- CharacterSet::CharacterSet(CharacterSet&& other) noexcept = default;
- CharacterSet& CharacterSet::operator=(const CharacterSet& other) {
- if (this != &other) {
- *impl_ = *other.impl_;
- }
- return *this;
- }
- CharacterSet& CharacterSet::operator=(CharacterSet&& other) noexcept = default;
-
- CharacterSet::CharacterSet()
- : impl_(new Impl)
- {
- }
-
- CharacterSet::CharacterSet(char c)
- : impl_(new Impl)
- {
- (void)impl_->charactersInSet.insert(c);
- }
-
- CharacterSet::CharacterSet(char first, char last)
- : impl_(new Impl)
- {
- if (first > last) {
- std::swap(first, last);
- }
- for (char c = first; c < last + 1; ++c) {
- (void)impl_->charactersInSet.insert(c);
- }
- }
-
- CharacterSet::CharacterSet(
- std::initializer_list< const CharacterSet > characterSets
- )
- : impl_(new Impl)
- {
- for (
- auto characterSet = characterSets.begin();
- characterSet != characterSets.end();
- ++characterSet
- ) {
- impl_->charactersInSet.insert(
- characterSet->impl_->charactersInSet.begin(),
- characterSet->impl_->charactersInSet.end()
- );
- }
- }
-
- bool CharacterSet::Contains(char c) const {
- return impl_->charactersInSet.find(c) != impl_->charactersInSet.end();
- }
-
-}