line_info information class is used to store current file, current line and current function information.
More...
#include <line_info.h>
line_info information class is used to store current file, current line and current function information.
- Examples
- The following example shows how to use the line_info
#include <xtd/xtd.tunit>
#include <iostream>
using namespace std;
using namespace xtd::tunit;
void trace_message(
const string& message,
const line_info& info) {
cout << "message: " << message << endl;
cout << "member name: " << info.member_name() << endl;
cout << "source file path: " << info.file_path() << endl;
cout << "source line number: " << info.line_number() << endl;
}
int main() {
}
◆ line_info() [1/3]
tunit::line_info::line_info |
( |
| ) |
|
|
defaultnoexcept |
Creates new instance of line info.
◆ line_info() [2/3]
tunit::line_info::line_info |
( |
const std::string & |
file_path, |
|
|
unsigned int |
line_number |
|
) |
| |
|
inlinenoexcept |
Creates new instance of line info with file path specified, and line number specified.
- Parameters
-
file_path | Contains the file path string. |
line_number | Contains the line number. |
◆ line_info() [3/3]
tunit::line_info::line_info |
( |
const std::string & |
member_name, |
|
|
const std::string & |
file_path, |
|
|
unsigned int |
line_number |
|
) |
| |
|
inlinenoexcept |
Creates new instance of line info with member name specified, file path specified, and line number specified.
- Parameters
-
member_name | Contains the member name string. |
file_path | Contains the file path string. |
line_number | Contains the line number. |
◆ empty()
Return an empty line info.
- Returns
- Empty line info.
◆ file_path()
const std::string& tunit::line_info::file_path |
( |
| ) |
const |
|
inlinenoexcept |
Gets the file path.
- Returns
- string file path
◆ line_number()
unsigned int tunit::line_info::line_number |
( |
| ) |
const |
|
inlinenoexcept |
Gets the line number.
- Returns
- int32 line number
◆ member_name()
const std::string& tunit::line_info::member_name |
( |
| ) |
const |
|
inlinenoexcept |
Gets the member name.
- Returns
- string member name
The documentation for this class was generated from the following file: