xtd 0.2.0
Loading...
Searching...
No Matches
xtd::target_type Class Reference
Inheritance diagram for xtd::target_type:
xtd::object

Definition

Represents information about target type, such as the target identifier. This class cannot be inherited.

Namespace
xtd
Library
xtd.core
Remarks
This class is used by xtd::environment::target_type method.

Public Constructors

 target_type (xtd::target_id target_id)
 Initialise a new xtd::target_type class.
 

Public Properties

bool is_console_application () const noexcept
 Gets target id is console application.
 
bool is_guid_application () const noexcept
 Gets target id is gui application.
 
bool is_test_application () const noexcept
 Gets target id is test application.
 
bool is_shared_library () const noexcept
 Gets target id is shared library.
 
bool is_static_library () const noexcept
 Gets target id is static library.
 
string name () const noexcept
 Gets target id name.
 
xtd::target_id target_id () const noexcept
 Gets target id value.
 

Public Methods

string to_string () const noexcept override
 Returns a xtd::string that represents the current object.
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ target_type()

xtd::target_type::target_type ( xtd::target_id  target_id)

Initialise a new xtd::target_type class.

Parameters
target_idOne of xtd::target_id values.

Member Function Documentation

◆ is_console_application()

bool xtd::target_type::is_console_application ( ) const
noexcept

Gets target id is console application.

Returns
true if target id is console application; otherwise false.

◆ is_guid_application()

bool xtd::target_type::is_guid_application ( ) const
noexcept

Gets target id is gui application.

Returns
true if target id is gui application; otherwise false.

◆ is_test_application()

bool xtd::target_type::is_test_application ( ) const
noexcept

Gets target id is test application.

Returns
true if target id is test application; otherwise false.

◆ is_shared_library()

bool xtd::target_type::is_shared_library ( ) const
noexcept

Gets target id is shared library.

Returns
true if target id is shared library; otherwise false.

◆ is_static_library()

bool xtd::target_type::is_static_library ( ) const
noexcept

Gets target id is static library.

Returns
true if target id is static library; otherwise false.

◆ name()

string xtd::target_type::name ( ) const
noexcept

Gets target id name.

Returns
The target id name.

◆ target_id()

xtd::target_id xtd::target_type::target_id ( ) const
noexcept

Gets target id value.

Returns
One of xtd::target_id values.

◆ to_string()

string xtd::target_type::to_string ( ) const
overridevirtualnoexcept

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

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

Reimplemented from xtd::object.


The documentation for this class was generated from the following file: