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

Definition

Contains system classes.

Modules

 collections
 Contains collections definitions.
 
 diagnostics
 Contains diagnostics definitions.
 
 io
 Contains io definitions.
 
 media
 Contains media definitions.
 
 net
 Contains 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
 Contains threading definitions.
 
 timers
 Contains timers definitions.
 
 web
 Contains 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::time_zone_info
 Represents any time zone in the world. More...
 
class  xtd::time_zone_info::adjustement_rule
 Provides information about a time zone adjustment, such as the transition to and from daylight saving time. More...
 
class  xtd::time_zone_info::transition_time
 Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone. 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.
 
using xtd::size_object = box_integer< size_t >
 Represent a boxed size_t.
 

Functions

template<typename type_t , typename ... args_t>
box< type_t > xtd::boxing (args_t &&...args) noexcept
 Allows to box an object.
 
template<typename type_t >
auto xtd::boxing (const type_t &value) noexcept
 Allows to box an object.
 
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.
 
template<typename type_t >
type_t xtd::unboxing (const xtd::box< type_t > &value) noexcept
 Allows to unbox an object.
 
template<class type_t >
void xtd::unregister_any_stringer ()
 Unregister an any stringer method for a specified type.
 

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;
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
box< bool > boolean_object
Represent a boxed bool.
Definition boolean_object.h:26

◆ 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;
box_integer< size_t > size_object
Represent a boxed size_t.
Definition size_object.h:24

Function Documentation

◆ boxing() [1/2]

template<typename type_t , typename ... args_t>
box< type_t > xtd::boxing ( args_t &&...  args)
inlinenoexcept

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

Allows to box an object.

Parameters
...argsParams used to initialize object.
Returns
Boxed object.
Remarks
The boxed object must implement operator == and operator < because a xtd::box implement xtd::icomparable and xtd::iequatable interfaces.
Header
#include <xtd/boxing>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ boxing() [2/2]

template<typename type_t >
auto xtd::boxing ( const type_t &  value)
inlinenoexcept

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

Allows to box an object.

Parameters
valueValue used to initialize object.
Returns
Boxed object.
Remarks
The boxed object must implement operator == and operator < because a xtd::box implement xtd::icomparable and xtd::iequatable interfaces.
Header
#include <xtd/boxing>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ 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)
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
static ustring format(const ustring &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition ustring.h:1131
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition date_time.h:1080
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10

◆ unboxing()

template<typename type_t >
type_t xtd::unboxing ( const xtd::box< type_t > &  value)
inlinenoexcept

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

Allows to unbox an object.

Parameters
valueObject to box.
Returns
Unboxed object.
Header
#include <xtd/unboxing>
Namespace
xtd
Library
xtd.core
Remarks
For more information about types, see Native types, boxing and unboxing.

◆ 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)