Skip to content

Commit a3c0bc5

Browse files
mlippautzCommit Bot
authored andcommitted
cppgc: Adds docs to SourceLocation
Bug: chromium:1056170 Change-Id: I89d0fbe6b73bf1b8765bb532fff58b1960fed09a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2235537 Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Anton Bikineev <bikineev@chromium.org> Auto-Submit: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Anton Bikineev <bikineev@chromium.org> Cr-Commit-Position: refs/heads/master@{#68236}
1 parent c9d7b23 commit a3c0bc5

1 file changed

Lines changed: 34 additions & 2 deletions

File tree

include/cppgc/source-location.h

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@
2323

2424
namespace cppgc {
2525

26-
// Encapsulates source location information. Mimics C++20's
27-
// std::source_location.
26+
/**
27+
* Encapsulates source location information. Mimics C++20's
28+
* std::source_location.
29+
*/
2830
class V8_EXPORT SourceLocation final {
2931
public:
32+
/**
33+
* Construct source location information corresponding to the location of the
34+
* call site.
35+
*/
3036
#if CPPGC_SUPPORTS_SOURCE_LOCATION
3137
static constexpr SourceLocation Current(
3238
const char* function = __builtin_FUNCTION(),
@@ -37,12 +43,38 @@ class V8_EXPORT SourceLocation final {
3743
static constexpr SourceLocation Current() { return SourceLocation(); }
3844
#endif // CPPGC_SUPPORTS_SOURCE_LOCATION
3945

46+
/**
47+
* Constructs unspecified source location information.
48+
*/
4049
constexpr SourceLocation() = default;
4150

51+
/**
52+
* Returns the name of the function associated with the position represented
53+
* by this object, if any.
54+
*
55+
* \returns the function name as cstring.
56+
*/
4257
constexpr const char* Function() const { return function_; }
58+
59+
/**
60+
* Returns the name of the current source file represented by this object.
61+
*
62+
* \returns the file name as cstring.
63+
*/
4364
constexpr const char* FileName() const { return file_; }
65+
66+
/**
67+
* Returns the line number represented by this object.
68+
*
69+
* \returns the line number.
70+
*/
4471
constexpr size_t Line() const { return line_; }
4572

73+
/**
74+
* Returns a human-readable string representing this object.
75+
*
76+
* \returns a human-readable string representing source location information.
77+
*/
4678
std::string ToString() const;
4779

4880
private:

0 commit comments

Comments
 (0)