git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove extra debug.
[stg.git]
/
libs
/
srvconf
/
parsers
/
optional_utils.h
diff --git
a/libs/srvconf/parsers/optional_utils.h
b/libs/srvconf/parsers/optional_utils.h
index 9b6054bc55bb995f766652100ace2b9412383eca..9cffc1ed696e126bb4c0bc93aac7664eb77e9a44 100644
(file)
--- a/
libs/srvconf/parsers/optional_utils.h
+++ b/
libs/srvconf/parsers/optional_utils.h
@@
-20,11
+20,11
@@
#pragma once
#pragma once
-#include "stg/optional.h"
#include "stg/common.h"
#include <string>
#include <ostream>
#include "stg/common.h"
#include <string>
#include <ostream>
+#include <optional>
namespace STG
{
namespace STG
{
@@
-87,51
+87,51
@@
void appendAttr<int8_t>(std::ostream& stream, const std::string& name, const int
template <typename T>
inline
template <typename T>
inline
-void appendResetableTag(std::ostream& stream, const std::string& name, const
T
& value)
+void appendResetableTag(std::ostream& stream, const std::string& name, const
std::optional<T>
& value)
{
{
- if (
!value.empty()
)
- appendTag(stream, name, value.
const_data
());
+ if (
value
)
+ appendTag(stream, name, value.
value
());
}
template <typename T>
inline
}
template <typename T>
inline
-void appendResetableTag(std::ostream& stream, const std::string& name, size_t suffix, const
T
& value)
+void appendResetableTag(std::ostream& stream, const std::string& name, size_t suffix, const
std::optional<T>
& value)
{
{
- if (
!value.empty()
)
- appendTag(stream, name, suffix, value.
const_data
());
+ if (
value
)
+ appendTag(stream, name, suffix, value.
value
());
}
template <typename T>
inline
}
template <typename T>
inline
-void appendResetableAttr(std::ostream& stream, const std::string& name, const
T
& value)
+void appendResetableAttr(std::ostream& stream, const std::string& name, const
std::optional<T>
& value)
{
{
- if (
!value.empty()
)
- appendAttr(stream, name, value.
const_data
());
+ if (
value
)
+ appendAttr(stream, name, value.
value
());
}
template <typename T>
inline
}
template <typename T>
inline
-void appendResetableAttr(std::ostream& stream, const std::string& name, size_t suffix, const
T
& value)
+void appendResetableAttr(std::ostream& stream, const std::string& name, size_t suffix, const
std::optional<T>
& value)
{
{
- if (
!value.empty()
)
- appendAttr(stream, name, suffix, value.
const_data
());
+ if (
value
)
+ appendAttr(stream, name, suffix, value.
value
());
}
inline
}
inline
-
Optional<std::string> maybeEncode(const O
ptional<std::string>& value)
+
std::optional<std::string> maybeEncode(const std::o
ptional<std::string>& value)
{
{
-
O
ptional<std::string> res;
- if (
!value.empty()
)
- res = Encode12str(value.
data
());
+
std::o
ptional<std::string> res;
+ if (
value
)
+ res = Encode12str(value.
value
());
return res;
}
inline
return res;
}
inline
-
Optional<std::string> maybeIconv(const O
ptional<std::string>& value, const std::string& fromEncoding, const std::string& toEncoding)
+
std::optional<std::string> maybeIconv(const std::o
ptional<std::string>& value, const std::string& fromEncoding, const std::string& toEncoding)
{
{
-
O
ptional<std::string> res;
- if (
!value.empty()
)
- res = IconvString(value.
data
(), fromEncoding, toEncoding);
+
std::o
ptional<std::string> res;
+ if (
value
)
+ res = IconvString(value.
value
(), fromEncoding, toEncoding);
return res;
}
return res;
}