Otawa
0.10
|
#include <otawa/hard/Platform.h>
Public Member Functions | |
Identification (const elm::String &name) | |
Build a platform identifier from a string. More... | |
Identification (const elm::String &arch, const elm::String &abi, const elm::String &mach=ANY) | |
Build an explicit platform identifier. More... | |
const elm::String & | name (void) const |
Get the full name of the identification. More... | |
const elm::String & | architecture (void) const |
Get the architecture component of the platform identifier. More... | |
const elm::String & | abi (void) const |
Get the ABI component of the platform identifier. More... | |
const elm::String & | machine (void) const |
Get the machine component of the platform identifier. More... | |
bool | matches (const Identification &id) |
Check if the current identification matches the given one. More... | |
Identification & | operator= (const Identification &id) |
Copy the given identification in the current one. More... | |
void | print (io::Output &out) const |
Display the identification. More... | |
Private Member Functions | |
void | split (void) |
Split the platform name into its components. More... | |
Private Attributes | |
elm::String | _name |
elm::String | _arch |
elm::String | _abi |
elm::String | _mach |
This class represents a platform identification that is composed by:
Each component may be datailed by one or many sub-components separated by '/' slashes. For example, a full description of a classic executable environment on Linux may be: 'x86/i586-elf/linux/libc2.4-pcat'.
otawa::hard::Platform::Identification::Identification | ( | const elm::String & | name | ) |
otawa::hard::Platform::Identification::Identification | ( | const elm::String & | arch, |
const elm::String & | abi, | ||
const elm::String & | mach = ANY |
||
) |
Build an explicit platform identifier.
arch | Archietcture. |
abi | ABI. |
mach | Machine. |
|
inline |
Get the ABI component of the platform identifier.
Referenced by otawa::hard::Platform::accept().
|
inline |
Get the architecture component of the platform identifier.
References _arch.
Referenced by otawa::hard::Platform::accept().
|
inline |
Get the machine component of the platform identifier.
Referenced by otawa::hard::Platform::accept().
bool otawa::hard::Platform::Identification::matches | ( | const Identification & | id | ) |
Check if the current identification matches the given one.
Note that the "*" "any" identity is used only by the current identification. Matching is also performed by prefix. For example, an identification "xxx" in the current identification matches a "xxx/yyy" in the given identification.
References otawa::hard::Platform::ANY.
|
inline |
Get the full name of the identification.
Platform::Identification & otawa::hard::Platform::Identification::operator= | ( | const Identification & | id | ) |
Copy the given identification in the current one.
id | Copied identification. |
References _name.
void otawa::hard::Platform::Identification::print | ( | io::Output & | out | ) | const |
|
private |
Split the platform name into its components.
References _abi, _arch, _mach, _name, otawa::hard::Platform::ANY, elm::String::indexOf(), elm::String::length(), and elm::String::substring().
Referenced by Identification().
|
private |
Referenced by split().
|
private |
Referenced by architecture(), and split().
|
private |
Referenced by split().
|
private |
Referenced by operator=(), and split().