xtd 0.2.0
Loading...
Searching...
No Matches

◆ to_string()

virtual xtd::string xtd::object::to_string ( ) const
virtualnoexcept

Returns a xtd::string that represents the current object.

Returns
A string that represents the current object.
Examples
The following code example demonstrates what to_string returns.
#include <xtd/xtd>
using namespace xtd;
namespace examples {
namespace object_test {
class object1 : public object {
};
}
}
auto main() -> int {
ptr<object> obj1 = new_ptr<examples::object_test::object1>();
console::write_line(obj1->to_string());
ptr<object> obj2 = new_ptr<date_time>(1971, 1, 5, 23, 5, 0);
console::write_line(obj2->to_string());
ptr<object> obj3 = new_ptr<boolean_object>();
console::write_line(obj3->to_string());
}
// This code produces the following output :
//
// examples::object_test::object1
// Tue Jan 5 23:05:00 1971
// false
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.h:27
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10

Reimplemented in xtd::any_object, xtd::basic_array< type_t, allocator_t >, xtd::basic_array< type_t, allocator_t >, xtd::basic_string< char_t, traits_t, allocator_t >, xtd::box< type_t >, xtd::collections::generic::list< type_t, allocator_t >, xtd::collections::generic::params< type_t >, xtd::compiler, xtd::configuration::file_settings, xtd::cpp_language, xtd::date_time, xtd::diagnostics::stack_frame, xtd::diagnostics::stack_trace, xtd::distribution, xtd::enum_object< enum_t >, xtd::environment::xtd_library, xtd::exception, xtd::guid, xtd::io::drive_info, xtd::io::file_system_info, xtd::io::string_writer, xtd::net::dns_end_point, xtd::net::end_point, xtd::net::ip_address, xtd::net::ip_end_point, xtd::net::socket_address, xtd::operating_system, xtd::processor, xtd::target_type, xtd::text::basic_string_builder< char_t, traits_t, allocator_t >, xtd::threading::thread_local_object< value_t >, xtd::time_span, xtd::time_zone_info, xtd::toolkit, xtd::type_object, xtd::uri, xtd::version, xtd::web::css::property, xtd::drawing::brush, xtd::drawing::color, xtd::drawing::drawing_2d::graphics_path, xtd::drawing::drawing_2d::matrix, xtd::drawing::font, xtd::drawing::font_family, xtd::drawing::graphics, xtd::drawing::icon, xtd::drawing::imaging::image_format, xtd::drawing::pen, xtd::drawing::point, xtd::drawing::point_f, xtd::drawing::rectangle, xtd::drawing::rectangle_f, xtd::drawing::size, xtd::drawing::size_f, xtd::forms::control, xtd::forms::control_layout_style, xtd::forms::country, xtd::forms::create_params, xtd::forms::cursor, xtd::forms::domain_up_down::item, xtd::forms::emoticon, xtd::forms::file_dialog, xtd::forms::horizontal_control_layout_style, xtd::forms::link_area, xtd::forms::list_control::item, xtd::forms::menu, xtd::forms::menu_item, xtd::forms::message, xtd::forms::month_calendar, xtd::forms::numeric_up_down, xtd::forms::padding, xtd::forms::progress_bar, xtd::forms::radio_button, xtd::forms::renderer, xtd::forms::selection_range, xtd::forms::status_bar_panel, xtd::forms::style_sheets::background_image, xtd::forms::style_sheets::length, xtd::forms::style_sheets::lengths, xtd::forms::style_sheets::theme, xtd::forms::tool_bar_button, xtd::forms::track_bar, xtd::forms::up_down_button, and xtd::forms::vertical_control_layout_style.

Examples
boxing.cpp.