4368 oracle odbc tests (#4410)

* feat(format): Add string_view format type spec #4409

* chore(Types): add demangle

* fix(Data): Oracle failing ODBC tests #4368

* fix some CQL and fuzz warnings; add Var::typeName()

* fix(build): -std=c++17 and c11

* fix windows build

* fix(Foundation): test apps vs projects c++17

* chore(build): remove uneeded compiler flag

* fix(VarHolder): number of digits range check for int->float conversion (reported by CIFuzz)

* fix(test): CIFuzz

* fix(CIFuzz): another attempt

* fix(progen): add LanguageStandard (stdcpp17, stdc11); regenerate vs170 projects

* fix(CiFuzz): add int->float precision loss barrier; fix erroneous number of digits logic

* enh(Var): silent loss of precision on int->float conversion #4423

* enh(Var): silent loss of precision on int->float conversion #4423

* chore(build): remove old build files

* chore: fix missing parens warning

* enh(Thread_POSIX): prevent double-joining; add error description to exceptions

* fix(Data): unresolved Column<long> linkage in test

* fix(demangle): determine type name from template parameter; add eror diagnostic for demangling failures

* chore(buildwin): remove old vs versions from build and progen scripts; update documentation

* chore(buildwin): remove leftover closing curly
This commit is contained in:
Aleksandar Fabijanic
2024-01-31 22:07:07 +01:00
committed by GitHub
parent bf2f96847a
commit c7d16b2a7e
243 changed files with 7158 additions and 1434 deletions

View File

@@ -475,6 +475,11 @@ public:
const std::type_info& type() const;
/// Returns the type information of the stored content.
std::string typeName(bool demangle = true) const;
/// Returns the type name of the stored content.
/// If demangling is available and emangle is true,
/// the returnsed string will be demangled.
//@ deprecated
void empty();
/// Empties Var.
@@ -521,23 +526,8 @@ public:
/// This function returns 0 when Var is empty, 1 for POD or the size (i.e. length)
/// for held container.
std::string toString() const
std::string toString() const;
/// Returns the stored value as string.
{
VarHolder* pHolder = content();
if (!pHolder)
throw InvalidAccessException("Can not convert empty value.");
if (typeid(std::string) == pHolder->type())
return extract<std::string>();
else
{
std::string result;
pHolder->convert(result);
return result;
}
}
static Var parse(const std::string& val);
/// Parses the string which must be in JSON format
@@ -617,17 +607,8 @@ private:
_placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value);
}
void construct(const char* value)
{
std::string val(value);
_placeholder.assign<VarHolderImpl<std::string>, std::string>(val);
}
void construct(const Var& other)
{
if (!other.isEmpty())
other.content()->clone(&_placeholder);
}
void construct(const char* value);
void construct(const Var& other);
Placeholder<VarHolder> _placeholder;
};
@@ -642,6 +623,20 @@ private:
/// Var members
///
inline void Var::construct(const char* value)
{
std::string val(value);
_placeholder.assign<VarHolderImpl<std::string>, std::string>(val);
}
inline void Var::construct(const Var& other)
{
if (!other.isEmpty())
other.content()->clone(&_placeholder);
}
inline void Var::swap(Var& other)
{
if (this == &other) return;
@@ -674,6 +669,13 @@ inline const std::type_info& Var::type() const
}
inline std::string Var::typeName(bool demangle) const
{
VarHolder* pHolder = content();
return pHolder ? demangle ? Poco::demangle(pHolder->type().name()) : pHolder->type().name() : std::string();
}
inline Var::ConstIterator Var::begin() const
{
if (size() == 0) return ConstIterator(const_cast<Var*>(this), true);