5#if !defined(__XTD_CORE_INTERNAL__)
6#error "Do not include this file: Internal use only"
20std::string __to_string_iformatable_to_string(
const xtd::iformatable* obj,
const std::string& fmt,
const std::locale& loc);
22std::string __to_string_object_to_string(
const xtd::object* obj);
24template<
class value_t>
25inline static std::string __to_string_polymorphic(
const value_t& value,
const std::string& fmt,
const std::locale& loc, std::true_type) {
26 auto value_ptr = &value;
29 if (
dynamic_cast<const xtd::object*
>(value_ptr))
return __to_string_object_to_string(
dynamic_cast<const xtd::object*
>(value_ptr));
30 if (
dynamic_cast<const std::exception*
>(value_ptr))
return std::string {
"exception: "} +
dynamic_cast<const std::exception&
>(value).what();
34template<
class value_t>
35inline static std::string __to_string_polymorphic(
const value_t& value,
const std::string& fmt,
const std::locale& loc, std::false_type) {
36 return __to_string_enum(value, fmt, loc, std::is_enum<value_t>());
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Provides a way to represent the current object as a string.
Definition istringable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
@ format_not_iformatable
The object is not iformatable.
Definition exception_case.hpp:59
Contains xtd::istringable interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::helpers::throw_helper class.