xtd 0.2.0
keywords

Definition

Keywords are predefined, reserved identifiers that have special meanings to the compiler.

Macros

#define abstract_   : public abstract_object
 This keyword is used to represents an abstract class. More...
 
#define abstract_object_   : xtd::abstract_object
 This keyword is used to represents an abstract class. More...
 
#define assembly_company_(company)   xtd::reflection::assembly_company_attribute __assembly_company_attribute {company, xtd::object()}
 Sets the assembly company information. Must be called once in your application. More...
 
#define assembly_configuration_(configuration)   xtd::reflection::assembly_configuration_attribute __assembly_configuration_attribute {configuration, xtd::object()}
 Sets the assembly configuration information. Must be called once in your application. More...
 
#define assembly_copyright_(copyright)   xtd::reflection::assembly_copyright_attribute __assembly_copyright_attribute {copyright, xtd::object()}
 Sets the assembly copoyright information. Must be called once in your application. More...
 
#define assembly_culture_(culture)   xtd::reflection::assembly_culture_attribute __assembly_culture_attribute {culture, xtd::object()}
 Sets the assembly culture information. Must be called once in your application. More...
 
#define assembly_description_(description)   xtd::reflection::assembly_description_attribute __assembly_description_attribute {description, xtd::object()}
 Sets the assembly description information. Must be called once in your application. More...
 
#define assembly_file_version_(version)   xtd::reflection::assembly_file_version_attribute __assembly_file_version_attribute {version, xtd::object()}
 Sets the assembly file version information. Must be called once in your application. More...
 
#define assembly_guid_(guid)   xtd::reflection::assembly_guid_attribute __assembly_guid_attribute {guid, xtd::object()}
 Sets the assembly guid information. Must be called once in your application. More...
 
#define assembly_identifier_(identifier)   xtd::reflection::assembly_identifier_attribute __assembly_identifier_attribute {identifier, xtd::object()}
 Sets the assembly identifier information. Must be called once in your application. More...
 
#define assembly_name_(name)   xtd::reflection::assembly_name_attribute __assembly_name_attribute {name, xtd::object()}
 Sets the assembly name information. Must be called once in your application. More...
 
#define assembly_product_(product)   xtd::reflection::assembly_product_attribute __assembly_product_attribute {product, xtd::object()}
 Sets the assembly product information. Must be called once in your application. More...
 
#define assembly_title_(title)   xtd::reflection::assembly_title_attribute __assembly_title_attribute {title, xtd::object()}
 Sets the assembly title information. Must be called once in your application. More...
 
#define assembly_trademark_(trademark)   xtd::reflection::assembly_trademark_attribute __assembly_trademark_attribute {trademark, xtd::object()}
 Sets the assembly trademark information. Must be called once in your application. More...
 
#define assembly_version_(version)   xtd::reflection::assembly_version_attribute __assembly_version_attribute {xtd::ustring(version) == "" || xtd::ustring(version) == "*" ? __XTD_ASSEMBLY_VERSION__ : version, xtd::object()}
 Sets the assembly version information. Must be called once in your application. More...
 
#define block_scope_(...)
 The specified expression is cleared automatically when the scope is ended. More...
 
#define csf_   current_stack_frame_
 Provides information about the current stack frame. More...
 
#define current_stack_frame_   xtd::diagnostics::stack_frame {__FILE__, __LINE__, __func__}
 Provides information about the current stack frame. More...
 
#define enum_(namespace_name, enum_t, ...)   enum_ut_(namespace_name, enum_t, xtd::int32, __VA_ARGS__)
 Provides the registration struct for enum. More...
 
#define enum_class_(namespace_name, enum_class_t, ...)   enum_class_ut_(namespace_name, enum_class_t, xtd::int32, __VA_ARGS__)
 Provides the registration struct for enum class. More...
 
#define enum_class_ut_(namespace_name, enum_class_t, underlying_t, ...)
 Provides the registration struct for enum class with specified underlying type. More...
 
#define enum_struct_(namespace_name, enum_struct_t, ...)   enum_struct_ut_(namespace_name, enum_struct_t, xtd::int32, __VA_ARGS__)
 Provides the registration struct for enum struct. More...
 
#define enum_struct_ut_(namespace_name, enum_struct_t, underlying_t, ...)
 Provides the registration struct for enum with specified underlying type. More...
 
#define enum_ut_(namespace_name, enum_t, underlying_t, ...)
 Provides the registration struct for enum with specified underlying type. More...
 
#define flags_attribute_(namespace_name, enum_type)
 Provides the set attribute struct for enumerations helper. More...
 
#define interface_   : public xtd::interface
 This keyword is use to represent an interface. More...
 
#define nameof_(...)   std::string(#__VA_ARGS__)
 Used to obtain the simple (unqualified) string name of a variable, type, or member. More...
 
#define startup_(main_class)
 Defines the entry point to be called when the application loads. Generally this is set either to the main form in your application or to the main procedure that should run when the application starts. More...
 
#define static_   : xtd::static_object
 This keyword is use to represent a static object. A static object can't be instantiated (constructors are deleted). More...
 
#define static_object_   : xtd::static_object
 This keyword is use to represent a static object. A static object can't be instantiated (constructors are deleted). More...
 
#define typeof_   xtd::__s__::__typeof_
 Used to obtain the type string for a type. A typeof_ expression takes the following form: More...
 
#define unused_   xtd::unused
 It may be used to suppress the "unused variable" or "unused local typedefs" compiler warnings when the variable or typedef can't be removed or commented out, e.g. when some blocks of the code are conditionally activated. More...
 
#define using_(...)
 The specified expression is cleared automatically when the scope is ended. More...
 

Macro Definition Documentation

◆ abstract_

#define abstract_   : public abstract_object

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

This keyword is used to represents an abstract class.

Namespace
xtd
Library
xtd.core
Remarks
This keyword has no other use than to tag a class to abstract.
Examples
class foo abstract_ {
public:
virtual std::string to_string() = 0;
};

◆ abstract_object_

#define abstract_object_   : xtd::abstract_object

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

This keyword is used to represents an abstract class.

Namespace
xtd
Library
xtd.core
Remarks
This keyword has no other use than to tag a class to abstract.
Examples
class foo abstract_object_ {
public:
virtual std::string to_string() = 0;
};

◆ assembly_company_

#define assembly_company_ (   company)    xtd::reflection::assembly_company_attribute __assembly_company_attribute {company, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_company_attribute.h>

Sets the assembly company information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_configuration_

#define assembly_configuration_ (   configuration)    xtd::reflection::assembly_configuration_attribute __assembly_configuration_attribute {configuration, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_configuration_attribute.h>

Sets the assembly configuration information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_copyright_

#define assembly_copyright_ (   copyright)    xtd::reflection::assembly_copyright_attribute __assembly_copyright_attribute {copyright, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_copyright_attribute.h>

Sets the assembly copoyright information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_culture_

#define assembly_culture_ (   culture)    xtd::reflection::assembly_culture_attribute __assembly_culture_attribute {culture, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_culture_attribute.h>

Sets the assembly culture information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_description_

#define assembly_description_ (   description)    xtd::reflection::assembly_description_attribute __assembly_description_attribute {description, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_description_attribute.h>

Sets the assembly description information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_file_version_

#define assembly_file_version_ (   version)    xtd::reflection::assembly_file_version_attribute __assembly_file_version_attribute {version, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_file_version_attribute.h>

Sets the assembly file version information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_guid_

#define assembly_guid_ (   guid)    xtd::reflection::assembly_guid_attribute __assembly_guid_attribute {guid, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_guid_attribute.h>

Sets the assembly guid information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_identifier_

#define assembly_identifier_ (   identifier)    xtd::reflection::assembly_identifier_attribute __assembly_identifier_attribute {identifier, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_identifier_attribute.h>

Sets the assembly identifier information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_name_

#define assembly_name_ (   name)    xtd::reflection::assembly_name_attribute __assembly_name_attribute {name, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_name_attribute.h>

Sets the assembly name information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_product_

#define assembly_product_ (   product)    xtd::reflection::assembly_product_attribute __assembly_product_attribute {product, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_product_attribute.h>

Sets the assembly product information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_title_

#define assembly_title_ (   title)    xtd::reflection::assembly_title_attribute __assembly_title_attribute {title, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_title_attribute.h>

Sets the assembly title information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_trademark_

#define assembly_trademark_ (   trademark)    xtd::reflection::assembly_trademark_attribute __assembly_trademark_attribute {trademark, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_trademark_attribute.h>

Sets the assembly trademark information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ assembly_version_

#define assembly_version_ (   version)    xtd::reflection::assembly_version_attribute __assembly_version_attribute {xtd::ustring(version) == "" || xtd::ustring(version) == "*" ? __XTD_ASSEMBLY_VERSION__ : version, xtd::object()}

#include <xtd.core/include/xtd/reflection/assembly_version_attribute.h>

Sets the assembly version information. Must be called once in your application.

Remarks
Use this keyword if you create create assembly informations manually.
Use CMake assembly macro if you want create assembly informations with CMake scripts.
Parameters
versionThe version information.
Namespace
xtd
Library
xtd.core
Examples
The following example shows how to use assembly information manually.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
static auto main() {
application::run(form1 {});
}
form1() {
text("Form with manual assembly info");
controls().push_back_range({company, product, version, company_name, product_name, product_version});
client_size({350, 105});
company.auto_size(true);
company.text("Company name");
company.location({10, 10});
company.text_align(content_alignment::middle_left);
product.auto_size(true);
product.text("Product name");
product.location({10, 40});
product.text_align(content_alignment::middle_left);
version.auto_size(true);
version.text("Product version");
version.location({10, 70});
company_name.text(application::company_name());
company_name.read_only(true);
company_name.location({120, 10});
company_name.width(220);
product_name.text(application::product_name());
product_name.read_only(true);
product_name.location({120, 40});
product_name.width(220);
product_version.text(application::product_version());
product_version.read_only(true);
product_version.location({120, 70});
product_version.width(220);
}
private:
label company;
label product;
text_box company_name;
text_box product_name;
text_box product_version;
};
startup_(form1);
#pragma region xtd generated code
// This code was generated by CMake script.
//
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
// Remarks : If this file was manually created, you need re-run cmake generator after creating
// or modifying any parameter bellow.
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
assembly_title_("Forms with manual assembly information");
assembly_description_("This example shows how to use xtd assembly informations");
assembly_company_("Gammasoft");
assembly_product_("form_with_manual_assembly_info");
assembly_copyright_("Copyright © Gammasoft 2023");
// The following GUID is for the ID of the typelib if this project is exposed to COM
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// In not specify or empty or "*" the cmake project version is used.
#pragma endregion

◆ block_scope_

#define block_scope_ (   ...)

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

Value:
for (bool __xtd_block_scope__ = true; __xtd_block_scope__; __xtd_block_scope__ = false)\
for (__VA_ARGS__; __xtd_block_scope__; __xtd_block_scope__ = false)

The specified expression is cleared automatically when the scope is ended.

Namespace
xtd
Library
xtd.core
Examples
// values is released automatically after the end closure }.
block_scope_(auto values = {1, 2, 3, 4, 5}) {
cout << ustring::join(", ", values) << endl;
}
Remarks
same as using_
Examples:
block_scope.cpp.

◆ csf_

#define csf_   current_stack_frame_

#include <xtd.core/include/xtd/diagnostics/stack_frame.h>

Provides information about the current stack frame.

Library
xtd.core
Returns
Informations about the current stack frame.
Examples
The following example shows how to use the csf_.
#include <xtd/xtd>
using namespace std;
using namespace xtd;
void trace_message(const ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
console::write_line("stack_frame: {}\n", stack_frame);
console::write_line("Message: {}", message);
console::write_line("Method: {}", stack_frame.get_method());
console::write_line("File name: {}", stack_frame.get_file_name());
console::write_line("File line number: {}", stack_frame.get_file_line_number());
}
auto main()->int {
trace_message("Something has happened.", csf_);
// trace_message("Something has happened.", csf_); is same as :
//
// trace_message("Something has happened.", {__FILE__, __LINE__, __func__});
}
// This code can produce the following output:
//
// stack_frame: /!---OMITTED---!/csf.cpp:15:0
//
// Message: Something happened.
// Method name: main
// File name: /!---OMITTED---!/current_stack_trace.cpp
// File line number: 15
Remarks
same as current_stack_frame_
Examples:
csf.cpp, exception_ptr.cpp, line_info.cpp, and system_exception.cpp.

◆ current_stack_frame_

#define current_stack_frame_   xtd::diagnostics::stack_frame {__FILE__, __LINE__, __func__}

#include <xtd.core/include/xtd/diagnostics/stack_frame.h>

Provides information about the current stack frame.

Library
xtd.core
Returns
Informations about the current stack frame.
Examples
The following example shows how to use the current_stack_frame_.
#include <xtd/xtd>
using namespace std;
using namespace xtd;
void trace_message(const ustring& message, const xtd::diagnostics::stack_frame& stack_frame) {
console::write_line("stack_frame: {}\n", stack_frame);
console::write_line("Message: {}", message);
console::write_line("Method: {}", stack_frame.get_method());
console::write_line("File name: {}", stack_frame.get_file_name());
console::write_line("File line number: {}", stack_frame.get_file_line_number());
}
auto main()->int {
trace_message("Something has happened.", current_stack_frame_);
// trace_message("Something has happened.", current_stack_frame_); is same as :
//
// trace_message("Something has happened.", {__FILE__, __LINE__, __func__});
}
// This code can produce the following output:
//
// stack_frame: /!---OMITTED---!/current_stack_frame.cpp:15:0
//
// Message: Something happened.
// Method name: main
// File name: /!---OMITTED---!/current_stack_trace.cpp
// File line number: 15
Remarks
same as csf_
Examples:
application_and_exception.cpp, current_stack_frame.cpp, exception_box.cpp, exception_dialog.cpp, format_class_with_specified_formating.cpp, and sprintf_class_with_specified_formating.cpp.

◆ enum_

#define enum_ (   namespace_name,
  enum_t,
  ... 
)    enum_ut_(namespace_name, enum_t, xtd::int32, __VA_ARGS__)

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

Provides the registration struct for enum.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_typeThe name of the enum.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_(, enum_test,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_int32());
console::write_line("as<int> = {}", as<int>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<int> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum.cpp, and parse_enum.cpp.

◆ enum_class_

#define enum_class_ (   namespace_name,
  enum_class_t,
  ... 
)    enum_class_ut_(namespace_name, enum_class_t, xtd::int32, __VA_ARGS__)

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

Provides the registration struct for enum class.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_class_typeThe name of the enum class.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_class_(, enum_test,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_int32());
console::write_line("as<int> = {}", as<int>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<int> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum_class.cpp, enum_class_flags.cpp, enum_class_flags_introspection.cpp, enum_class_parse.cpp, and parse_enum_class.cpp.

◆ enum_class_ut_

#define enum_class_ut_ (   namespace_name,
  enum_class_t,
  underlying_t,
  ... 
)

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

Value:
namespace namespace_name {enum class enum_class_t : underlying_t { __VA_ARGS__ };} \
__enum_introspection__(namespace_name, enum_class_t, underlying_t, __VA_ARGS__) \
template<> struct xtd::enum_register<namespace_name::enum_class_t> {explicit operator auto() const {return __enum_definition_to_enum_collection__<namespace_name::enum_class_t>(#__VA_ARGS__);}}
Provides the registration struct for enumerations.
Definition: enum_register.h:36

Provides the registration struct for enum class with specified underlying type.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_class_typeThe name of the enum class.
underlying_typeThe underying type.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_class_ut_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_class_ut_(, enum_test, byte,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_int32());
console::write_line("as<int> = {}", as<int>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<int> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum_class_ut.cpp.

◆ enum_struct_

#define enum_struct_ (   namespace_name,
  enum_struct_t,
  ... 
)    enum_struct_ut_(namespace_name, enum_struct_t, xtd::int32, __VA_ARGS__)

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

Provides the registration struct for enum struct.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_struct_typeThe name of the enum struct.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_struct_(, enum_test,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_int32());
console::write_line("as<int> = {}", as<int>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<int> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum_struct.cpp, and parse_enum_struct.cpp.

◆ enum_struct_ut_

#define enum_struct_ut_ (   namespace_name,
  enum_struct_t,
  underlying_t,
  ... 
)

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

Value:
namespace namespace_name {enum struct enum_struct_t : underlying_t { __VA_ARGS__ };} \
__enum_introspection__(namespace_name, enum_struct_t, underlying_t, __VA_ARGS__) \
template<> struct xtd::enum_register<namespace_name::enum_struct_t> {explicit operator auto() const {return __enum_definition_to_enum_collection__<namespace_name::enum_struct_t>(#__VA_ARGS__);}}
Provides the registration struct for enumerations.
Definition: enum_register.h:36

Provides the registration struct for enum with specified underlying type.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_struct_typeThe name of the enum struct.
underlying_typeThe underying type.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_struct_ut_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_struct_ut_(, enum_test, byte,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_int32());
console::write_line("as<int> = {}", as<int>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<int> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum_struct_ut.cpp.

◆ enum_ut_

#define enum_ut_ (   namespace_name,
  enum_t,
  underlying_t,
  ... 
)

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

Value:
namespace namespace_name {enum enum_t : underlying_t {__VA_ARGS__};} \
__enum_introspection__(namespace_name, enum_t, underlying_t, __VA_ARGS__) \
template<> struct xtd::enum_register<namespace_name::enum_t> {explicit operator auto() const {return __enum_definition_to_enum_collection__<namespace_name::enum_t>(#__VA_ARGS__);}}
Provides the registration struct for enumerations.
Definition: enum_register.h:36

Provides the registration struct for enum with specified underlying type.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_typeThe name of the enum.
underlying_typeThe underying type.
...The nemumeration lists. This helper is created to facilitate to set the xtd::enum_register with the enumeration identifiers.
Warning
The helper has one limitiation :
  • The enumeration's cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enumeration is in a class or struct, add operators manually and use xtd::enum_register to register the enumeration identifiers.
Examples
The following code show how to use enum_ut_ helper.
#include <xtd/xtd>
using namespace xtd;
enum_ut_(, enum_test, byte,
value_one,
value_two,
value_three,
value_four
);
auto main()->int {
console::write_line("name = {}", enum_test::value_four);
console::write_line("value = {}", enum_object(enum_test::value_four).to_byte());
console::write_line("as<byte> = {}", as<byte>(enum_test::value_four));
}
// This code produces the following output :
//
// name = value_four
// value = 3
// as<byte> = 3
// values = [0, 1, 2, 3]
// names = [value_one, value_two, value_three, value_four]
// entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]
Examples:
enum_ut.cpp.

◆ flags_attribute_

#define flags_attribute_ (   namespace_name,
  enum_type 
)

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

Value:
namespace namespace_name { \
[[maybe_unused]] inline enum_type& operator ^=(enum_type& lhs, enum_type rhs) {lhs = static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) ^ static_cast<std::underlying_type<enum_type>::type>(rhs)); return lhs;} \
[[maybe_unused]] inline enum_type& operator &=(enum_type& lhs, enum_type rhs) {lhs = static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) & static_cast<std::underlying_type<enum_type>::type>(rhs)); return lhs;} \
[[maybe_unused]] inline enum_type& operator |=(enum_type& lhs, enum_type rhs) {lhs = static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) | static_cast<std::underlying_type<enum_type>::type>(rhs)); return lhs;} \
[[maybe_unused]] inline enum_type& operator +=(enum_type& lhs, enum_type rhs) {lhs = static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) + static_cast<std::underlying_type<enum_type>::type>(rhs)); return lhs;} \
[[maybe_unused]] inline enum_type& operator -=(enum_type& lhs, enum_type rhs) {lhs = static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) - static_cast<std::underlying_type<enum_type>::type>(rhs)); return lhs;} \
[[maybe_unused]] inline enum_type operator ^(enum_type lhs, enum_type rhs) {return static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) ^ static_cast<std::underlying_type<enum_type>::type>(rhs));} \
[[maybe_unused]] inline enum_type operator &(enum_type lhs, enum_type rhs) {return static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) & static_cast<std::underlying_type<enum_type>::type>(rhs));} \
[[maybe_unused]] inline enum_type operator |(enum_type lhs, enum_type rhs) {return static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) | static_cast<std::underlying_type<enum_type>::type>(rhs));} \
[[maybe_unused]] inline enum_type operator +(enum_type lhs, enum_type rhs) {return static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) + static_cast<std::underlying_type<enum_type>::type>(rhs));} \
[[maybe_unused]] inline enum_type operator -(enum_type lhs, enum_type rhs) {return static_cast<enum_type>(static_cast<std::underlying_type<enum_type>::type>(lhs) - static_cast<std::underlying_type<enum_type>::type>(rhs));} \
[[maybe_unused]] inline enum_type operator ~(enum_type lhs) {return static_cast<enum_type>(~static_cast<std::underlying_type<enum_type>::type>(lhs));} \
}\
template<> struct xtd::enum_set_attribute<namespace_name::enum_type> {explicit operator auto() const noexcept {return xtd::enum_attribute::flags;}}
std::type_info type
Stores information about a type.
Definition: types.h:136
Enum flags attribute.
Provides the set attribute struct for enumerations.
Definition: enum_set_attribute.h:28

Provides the set attribute struct for enumerations helper.

Namespace
xtd
Library
xtd.core
Parameters
namespace_nameThe name of the the namespace. Empty if no namespace.
enum_typeThe name of the enum flags. This helper is created to facilitate to set the xtd::enum_set_attribute with the xtd::enum_attribute::flags atribute and the implementation of the following operators for enum flags:
Operator Name
^= Bitwise XOR assignment
&= Bitwise AND assignment
|= Bitwise OR assignment
+= Addition assignment
-= Subtraction assignment
^ Bitwise XOR
& Bitwise AND
| Bitwise OR
+ Addition
- Subtraction
~ Bitwise NOT
Warning
The helper as one limitiation :
  • The enum's flags cannot be in a class or struct. The enum must be in the global namespace or in a namespace hierarchy. If the enum flags is in a class or struct, add operators manually and use xtd::enum_set_attribute to register the xtd::enum_attribute::flags attribute.
Examples
The following code show how to use flags_attribute_ helper.
#include <xtd/xtd>
using namespace std;
using namespace xtd;
enum class text_styles {
normal = 0b0,
bold = 0b1,
italic = 0b10,
underline = 0b100,
strikeout = 0b1000,
};
// Add text_style enum class flags operators and register flags attribute.
flags_attribute_(, text_styles);
// Only this operator is needed for text_styles enum class to be recognized by xtd::ustring::format().
template<> struct xtd::enum_register<text_styles> {
explicit operator auto() const noexcept {return xtd::enum_collection<text_styles> {{text_styles::normal, "normal"}, {text_styles::bold, "bold"}, {text_styles::italic, "italic"}, {text_styles::underline, "underline"}, {text_styles::strikeout, "strikeout"}};}
};
auto main()->int {
cout << ustring::format("{}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0b{:b}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0b{:B}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("{:d}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("{:D}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("{:g}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("{:G}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0{:o}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0{:O}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0x{:x}", text_styles::bold | text_styles::italic) << endl;
cout << ustring::format("0x{:X}", text_styles::bold | text_styles::italic) << endl;
}
// This code produces the following output :
//
// saturday
// 0b101
// 0b101
// 5
// 5
// saturday
// saturday
// 05
// 05
// 0x5
// 0x5
Examples:
enum_class_flags.cpp, enum_class_flags_introspection.cpp, and format_enum_class_flags.cpp.

◆ interface_

#define interface_   : public xtd::interface

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

This keyword is use to represent an interface.

Library
xtd.core
Examples
class istringable interface_ {
public:
virtual std::string to_string() const = 0;
};
class foo : public istringable {
public:
Foo() = default;
std:::string to_string() const override {return "foo";}
};

◆ nameof_

#define nameof_ (   ...)    std::string(#__VA_ARGS__)

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

Used to obtain the simple (unqualified) string name of a variable, type, or member.

Namespace
xtd
Library
xtd.core

When reporting errors in code, hooking up model-view-controller (MVC) links, firing property changed events, etc., you often want to capture the string name of a method. Using nameof helps keep your code valid when renaming definitions. Before, you had to use string literals to refer to definitions, which is brittle when renaming code elements because tools do not know to check these string literals.

A nameof expression has this form:

if (x == null) throw std::argument_error(nameof_(x));
write_line(nameof_(person.address().zip_code())); // prints "person.address().zip_code()"
Examples
Some C++ examples:
Remarks
The argument to nameof must be a simple name, qualified name, member access, base access with a specified member, or this access with a specified member. The argument expression identifies a code definition, but it is never evaluated.
Because the argument needs to be an expression syntactically, there are many things disallowed that are not useful to list. The following are worth mentioning that produce errors: predefined types (for example, int or void), nullable types (Point?), array types (Customer[,]), pointer types (Buffer*), qualified alias (A::B), and unbound generic types (Dictionary<,>), preprocessing symbols (DEBUG), and labels (loop:).
If you need to get the fully-qualified name, you can use the typeof_ expression along with nameof. For example:
class c {
public_ void f(int i) {
log(xtd::ustring::format("{0}.{1}", typeof_(C), nameof_(f)), "method entry");
}
}

◆ startup_

#define startup_ (   main_class)

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

Value:
auto main(int argc, char* argv[])->int {\
try {\
return __startup__::run(main_class::main, argc, argv);\
} catch(const std::exception& e) {\
__startup_catch_exception__(e);\
} catch(...) {\
__startup_catch_exception__();\
}\
}\
auto __startup_force_to_end_with_semicolon__ = 0

Defines the entry point to be called when the application loads. Generally this is set either to the main form in your application or to the main procedure that should run when the application starts.

Namespace
xtd
Library
xtd.core
Parameters
main_classThe class that contains the static main method.
Examples
This example show a main method without arguments and without return code
#include <xtd/xtd>
using namespace xtd;
namespace main1_example {
class program {
public:
static void main() {
// Write arguments to the console output
// return 42
}
};
}
startup_(main1_example::program);
// startup_(main1_example::program); is same as :
//
// auto main(int argc, char* argv[])->int {
// main1_example::program::main();
// return environment::exit_code();
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// /!---OMITTED---!/main1
// one
// two
// three four
// five
This example show a main method with a return code and without arguments
#include <xtd/xtd>
using namespace xtd;
namespace main2_example {
class program {
public:
static int main() {
// Write arguments to the console output
return 42;
}
};
}
startup_(main2_example::program);
// startup_(main2_example::program); is same as :
//
// auto main(int argc, char* argv[])->int {
// return main2_example::program::main();
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// /!---OMITTED---!/main2
// one
// two
// three four
// five
This example show a main method with argument and without return code
#include <xtd/xtd>
using namespace std;
using namespace xtd;
namespace main3_example {
class program {
public:
static void main(const vector<ustring>& args) {
// Write arguments to the console output
for (ustring arg : args)
console::write_line(arg);
// return 42
environment::exit_code(42);
}
};
}
startup_(main3_example::program);
// startup_(main3_example::program); is same as :
//
// auto main(int argc, char* argv[])->int {
// main3_example::program::main({argv + 1, argv + argc});
// return environment::exit_code();
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// one
// two
// three four
// five
This example show a main method with argument and return code
#include <xtd/xtd>
using namespace std;
using namespace xtd;
namespace main4_example {
class program {
public:
static int main(const vector<ustring>& args) {
// Write arguments to the console output
for (ustring arg : args)
console::write_line(arg);
return 42;
}
};
}
startup_(main4_example::program);
// startup_(main4_example::program); is same as :
//
// auto main(int argc, char* argv[])->int {
// return main4_example::program::main({argv + 1, argv + argc});
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// one
// two
// three four
// five
Examples:
application_and_assert.cpp, application_and_exception.cpp, application_enable_dark_mode.cpp, application_enable_light_mode.cpp, application_with_cmake_assembly_info.cpp, application_with_manual_assembly_info.cpp, binary_reader.cpp, binary_reader2.cpp, bit_converter_endianness.cpp, bit_converter_is_big_endian.cpp, bit_converter_is_little_endian.cpp, bit_converter_round_trips.cpp, border_style.cpp, calculator.cpp, change_parent.cpp, circular_form.cpp, console_clear.cpp, countries.cpp, date_time.cpp, date_time_add.cpp, date_time_add_days.cpp, date_time_add_hours.cpp, date_time_add_milliseconds.cpp, date_time_add_minutes.cpp, date_time_add_months.cpp, date_time_add_seconds.cpp, date_time_add_years.cpp, date_time_date.cpp, date_time_day_of_week.cpp, date_time_day_of_year.cpp, date_time_days_in_month.cpp, date_time_days_in_month2.cpp, date_time_max_value.cpp, date_time_min_value.cpp, date_time_now.cpp, date_time_now2.cpp, date_time_specify_kind.cpp, date_time_sprintf.cpp, date_time_subtract.cpp, date_time_ticks.cpp, date_time_ticks2.cpp, date_time_time_of_day.cpp, date_time_to_string_format.cpp, date_time_today.cpp, debug_message_box.cpp, default_trace_listener.cpp, drive_info.cpp, environment_exit_code.cpp, file_info.cpp, file_info_append_text.cpp, file_info_move_to.cpp, file_info_open.cpp, file_info_open_read.cpp, file_info_open_text.cpp, file_info_open_write.cpp, file_info_replace.cpp, form_and_main.cpp, form_background_image.cpp, form_show.cpp, horizontal_layout_panel.cpp, interlocked.cpp, interlocked_decrement.cpp, ip_address.cpp, lcd_label3.cpp, main.cpp, main1.cpp, main2.cpp, main3.cpp, main4.cpp, math.cpp, some_controls.cpp, startup.cpp, system_sound.cpp, system_sounds.cpp, target_default_namespace.cpp, test_console.cpp, test_forms.cpp, themes.cpp, trace_message_box.cpp, track_bar2.cpp, tutorial_application_icon.cpp, tutorial_button.cpp, tutorial_communicate.cpp, tutorial_simple_application.cpp, uri.cpp, version.cpp, version_os.cpp, and vertical_layout_panel.cpp.

◆ static_

#define static_   : xtd::static_object

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

This keyword is use to represent a static object. A static object can't be instantiated (constructors are deleted).

Namespace
xtd
Library
xtd.core
Examples
class foo static_ {
public:
static std::string to_string() {return "foo";}
};

◆ static_object_

#define static_object_   : xtd::static_object

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

This keyword is use to represent a static object. A static object can't be instantiated (constructors are deleted).

Namespace
xtd
Library
xtd.core
Examples
class foo static_object_ {
public:
static std::string to_string() {return "foo";}
};

◆ typeof_

#define typeof_   xtd::__s__::__typeof_

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

Used to obtain the type string for a type. A typeof_ expression takes the following form:

Namespace
xtd
Library
xtd.core
Examples
std::string type1 = typeof_<int32>();
int32 i = 42;
std::string type2 = typeof_(i);
Remarks
The typeof_ operator cannot be overloaded.
Examples:
boxed_info.cpp.

◆ unused_

#define unused_   xtd::unused

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

It may be used to suppress the "unused variable" or "unused local typedefs" compiler warnings when the variable or typedef can't be removed or commented out, e.g. when some blocks of the code are conditionally activated.

Namespace
xtd
Library
xtd_core
Parameters
argsvariables to suppress the unused warning
Examples
This example sho how to use Unused():

◆ using_

#define using_ (   ...)

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

Value:
for (bool __xtd_using__ = true; __xtd_using__; __xtd_using__ = false)\
for (__VA_ARGS__; __xtd_using__; __xtd_using__ = false)

The specified expression is cleared automatically when the scope is ended.

Namespace
xtd
Library
xtd.core
Examples
// values is released automatically after the end closure }.
using_(auto values = {1, 2, 3, 4, 5}) {
cout << ustring::join(", ", values) << endl;
}
same as :
using_(auto values = {1, 2, 3, 4, 5})
cout << ustring::join(", ", values) << endl;
same as :
{
auto values = {1, 2, 3, 4, 5};
cout << ustring::join(", ", values) << endl;
}
Remarks
same as block_scope_
Examples:
binary_reader.cpp, binary_reader2.cpp, file_info.cpp, file_info_append_text.cpp, file_info_open.cpp, file_info_open_read.cpp, file_info_open_text.cpp, file_info_open_write.cpp, process.cpp, and using.cpp.