Fix Line Endings

This commit is contained in:
2020-06-10 11:48:41 +02:00
parent 56a1e5bb7a
commit ea92eb7b2b
16 changed files with 786 additions and 786 deletions
+73 -73
View File
@@ -1,73 +1,73 @@
#ifndef NAME_H
#define NAME_H
#include <memory>
#include <sstream>
#include <string>
#include <vector>
namespace Network {
namespace Dns {
class NameImpl;
class Name
{
public:
Name();
template<typename ...Args>
Name(const Args& ...args) :
Name(toStringVector(args...))
{
}
Name(const std::vector<std::string>& labels);
std::string GetFirstLabel() const;
std::string GetName() const;
bool empty() const;
bool endsWith(const Name& suffix) const;
void append(const std::string& label);
void prepend(const std::string& label);
void swap(Name& x) noexcept;
bool operator==(const Name& name) const;
bool operator!=(const Name& name) const;
bool operator<(const Name& name) const;
private:
Name(std::shared_ptr<NameImpl> pNameImpl);
NameImpl* PImpl() const;
private:
template <class T>
std::string toString(T&& t)
{
std::stringstream s;
s << std::forward<T>(t);
return s.str();
}
template <class... T>
std::vector<std::string> toStringVector(T&&... args)
{
std::vector<std::string> res { toString(std::forward<T>(args))... };
return res;
}
private:
friend class Query;
friend class ResourceRecord;
private:
std::shared_ptr<NameImpl> m_pNameImpl;
};
} // namespace Dns
} // namespace Network
#endif // NAME_H
#ifndef NAME_H
#define NAME_H
#include <memory>
#include <sstream>
#include <string>
#include <vector>
namespace Network {
namespace Dns {
class NameImpl;
class Name
{
public:
Name();
template<typename ...Args>
Name(const Args& ...args) :
Name(toStringVector(args...))
{
}
Name(const std::vector<std::string>& labels);
std::string GetFirstLabel() const;
std::string GetName() const;
bool empty() const;
bool endsWith(const Name& suffix) const;
void append(const std::string& label);
void prepend(const std::string& label);
void swap(Name& x) noexcept;
bool operator==(const Name& name) const;
bool operator!=(const Name& name) const;
bool operator<(const Name& name) const;
private:
Name(std::shared_ptr<NameImpl> pNameImpl);
NameImpl* PImpl() const;
private:
template <class T>
std::string toString(T&& t)
{
std::stringstream s;
s << std::forward<T>(t);
return s.str();
}
template <class... T>
std::vector<std::string> toStringVector(T&&... args)
{
std::vector<std::string> res { toString(std::forward<T>(args))... };
return res;
}
private:
friend class Query;
friend class ResourceRecord;
private:
std::shared_ptr<NameImpl> m_pNameImpl;
};
} // namespace Dns
} // namespace Network
#endif // NAME_H