xtd 0.2.0
system

Definition

Contains system classes.

Collaboration diagram for system:

Modules

 collections
 collections definitions.
 
 diagnostics
 diagnostics definitions.
 
 io
 io definitions.
 
 media
 media definitions.
 
 net
 Network definitions.
 
 security
 Contains the underlying structure of the security system, including base classes for permissions.
 
 synthesis
 Contains classes for initializing and configuring a speech synthesis engine, for creating prompts, for generating speech, for responding to events, and for modifying voice characteristics.
 
 threading
 threading definitions.
 
 timers
 timers definitions.
 
 web
 web definitions.
 

Classes

class  xtd::bit_converter
 Converts base data types to an std::vector of bytes, and an std::vector of bytes to base data types. More...
 
class  xtd::box< type_t >
 Represents a boxed object. More...
 
class  xtd::box_char< type_t >
 Represents a boxed char object. More...
 
class  xtd::box_floating_point< type_t >
 Represents a boxed floating point object. More...
 
class  xtd::box_integer< type_t >
 Represents a boxed integer object. More...
 
class  xtd::console
 Represents the standard input, output, and error streams for console applications. More...
 
class  xtd::convert
 Represents API to convert base type code. More...
 
class  xtd::convert_pointer
 Represents API to convert pointers. More...
 
class  xtd::convert_string
 Represents API to convert string containers. More...
 
class  xtd::date_time
 Represents an instant in time, typically expressed as a date and time of day. More...
 
class  xtd::delegate< result_t(arguments_t...)>
 Represents a delegate, which is a data structure that refers to a static method or to a class instance && an instance method of that class. More...
 
class  xtd::enum_object< enum_t >
 Provides the base class for enumerations. More...
 
class  xtd::enum_object< std::nullptr_t >
 Provides the base class for enumerations. More...
 
struct  xtd::enum_register< enum_t >
 Provides the registration struct for enumerations. More...
 
struct  xtd::enum_set_attribute< enum_t >
 Provides the set attribute struct for enumerations. More...
 
class  xtd::environment
 The environment class. More...
 
struct  xtd::guid
 Represents a globally unique identifier (GUID). A GUID is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated. More...
 
class  xtd::math
 Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions. More...
 
class  xtd::object
 Supports all classes in the xtd class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the xtd. It is the root of the type hierarchy. More...
 
class  xtd::random
 Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet certain statistical requirements for randomness. More...
 
class  xtd::startup
 Defines the xtd::startup object that can be used in the main method to safely call the application's main entry point. More...
 
struct  xtd::time_span
 Represents a time interval. More...
 
class  xtd::translator
 Represents translator class. This class cannot be inherited. More...
 
class  xtd::type_object
 Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types. More...
 
class  xtd::uri
 Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI. More...
 
class  xtd::ustring
 Represents text as a sequence of UTF-8 code units. More...
 
class  xtd::version
 Represents the version number of an assembly, operating system, or the xtd. This class cannot be inherited. More...
 

Typedefs

using xtd::boolean_object = box< bool >
 Represent a boxed bool. More...
 
using xtd::size_object = box_integer< size_t >
 Represent a boxed size_t. More...
 

Functions

template<class type_t , class function_t >
void xtd::register_any_stringer (const function_t &func)
 Register an any stringer method for a specified type. More...
 
template<class type_t >
void xtd::unregister_any_stringer ()
 Unregister an any stringer method for a specified type. More...
 

Typedef Documentation

◆ boolean_object

using xtd::boolean_object = typedef box<bool>

#include <xtd.core/include/xtd/boolean_object.h>

Represent a boxed bool.

Header
#include <xtd/boolean_object>
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to create and use xtd::boolean_object.
auto stringer = [](const object& value) {return value.to_string();};
bool unboxed_object = true;
boolean_object boxed_object = unboxed_bool;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = true;

◆ size_object

using xtd::size_object = typedef box_integer<size_t>

#include <xtd.core/include/xtd/size_object.h>

Represent a boxed size_t.

Namespace
xtd
Library
xtd.core
Examples
The following example shows how to create and use xtd::size_object.
auto stringer = [](const object& value) {return value.to_string();};
size_t unboxed_object = 42;
size_object boxed_object = unboxed_object;
auto result = stringer(boxed_object);
console::write_line("result = {}", result); // Display: result = 42;

Function Documentation

◆ register_any_stringer()

template<class type_t , class function_t >
void xtd::register_any_stringer ( const function_t &  func)
inline

#include <xtd.core/include/xtd/register_any_stringer.h>

Register an any stringer method for a specified type.

Parameters
funcFunction to register any stringer for specified type.
Namespace
xtd
Library
xtd.core
Examples
Show how to register your own class.
#include <xtd/register_any_stringer>
#include <xtd/unregister_any_stringer>
#include <xtd/ustring>
using namespace std;
using namespace xtd;
class character {
public:
character(const ustring& name, const ustring& rank) noexcept : name_(name), rank_(rank) {}
const ustring& name() const noexcept {return name_;}
const ustring& rank() const noexcept {return rank_;}
ustring to_string() const noexcept {return name_ + " (" + rank_ + ")";}
private:
ustring name_;
ustring rank_;
};
auto main()->int {
auto value = make_any<int>(42);
cout << ustring::format("{}", value) << endl;
value = make_any<ustring>("Star Trek: The Next Generation");
cout << ustring::format("{}", value) << endl;
value = make_any<character>("Jean-Luc Picard", "Captain");
cout << "Before register_any_stringer : " << ustring::format("{}", value) << endl;
register_any_stringer<character>([](auto value) {return value.to_string();});
cout << "After register_any_stringer : " << ustring::format("{}", value) << endl;
unregister_any_stringer<character>();
cout << "After unregister_any_stringer : " << ustring::format("{}", value) << endl;
}
// This code produces the following output :
//
// 42
// Star Trek: The Next Generation
// Before register_any_stringer : (unregistered)
// After register_any_stringer : Jean-Luc Picard (Captain)
// After unregister_any_stringer : (unregistered)

◆ unregister_any_stringer()

template<class type_t >
void xtd::unregister_any_stringer ( )
inline

#include <xtd.core/include/xtd/unregister_any_stringer.h>

Unregister an any stringer method for a specified type.

Header
#include <xtd/any>
Namespace xtd
Library
xtd.core
Examples
Show how to register your own class.
#include <xtd/register_any_stringer>
#include <xtd/unregister_any_stringer>
#include <xtd/ustring>
using namespace std;
using namespace xtd;
class character {
public:
character(const ustring& name, const ustring& rank) noexcept : name_(name), rank_(rank) {}
const ustring& name() const noexcept {return name_;}
const ustring& rank() const noexcept {return rank_;}
ustring to_string() const noexcept {return name_ + " (" + rank_ + ")";}
private:
ustring name_;
ustring rank_;
};
auto main()->int {
auto value = make_any<int>(42);
cout << ustring::format("{}", value) << endl;
value = make_any<ustring>("Star Trek: The Next Generation");
cout << ustring::format("{}", value) << endl;
value = make_any<character>("Jean-Luc Picard", "Captain");
cout << "Before register_any_stringer : " << ustring::format("{}", value) << endl;
register_any_stringer<character>([](auto value) {return value.to_string();});
cout << "After register_any_stringer : " << ustring::format("{}", value) << endl;
unregister_any_stringer<character>();
cout << "After unregister_any_stringer : " << ustring::format("{}", value) << endl;
}
// This code produces the following output :
//
// 42
// Star Trek: The Next Generation
// Before register_any_stringer : (unregistered)
// After register_any_stringer : Jean-Luc Picard (Captain)
// After unregister_any_stringer : (unregistered)