summaryrefslogtreecommitdiff
path: root/chromium/v8/include/cppgc/source-location.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/include/cppgc/source-location.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/include/cppgc/source-location.h')
-rw-r--r--chromium/v8/include/cppgc/source-location.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/chromium/v8/include/cppgc/source-location.h b/chromium/v8/include/cppgc/source-location.h
index 8cc52d6a539..139c9d86c08 100644
--- a/chromium/v8/include/cppgc/source-location.h
+++ b/chromium/v8/include/cppgc/source-location.h
@@ -23,10 +23,16 @@
namespace cppgc {
-// Encapsulates source location information. Mimics C++20's
-// std::source_location.
+/**
+ * Encapsulates source location information. Mimics C++20's
+ * std::source_location.
+ */
class V8_EXPORT SourceLocation final {
public:
+ /**
+ * Construct source location information corresponding to the location of the
+ * call site.
+ */
#if CPPGC_SUPPORTS_SOURCE_LOCATION
static constexpr SourceLocation Current(
const char* function = __builtin_FUNCTION(),
@@ -37,12 +43,38 @@ class V8_EXPORT SourceLocation final {
static constexpr SourceLocation Current() { return SourceLocation(); }
#endif // CPPGC_SUPPORTS_SOURCE_LOCATION
+ /**
+ * Constructs unspecified source location information.
+ */
constexpr SourceLocation() = default;
+ /**
+ * Returns the name of the function associated with the position represented
+ * by this object, if any.
+ *
+ * \returns the function name as cstring.
+ */
constexpr const char* Function() const { return function_; }
+
+ /**
+ * Returns the name of the current source file represented by this object.
+ *
+ * \returns the file name as cstring.
+ */
constexpr const char* FileName() const { return file_; }
+
+ /**
+ * Returns the line number represented by this object.
+ *
+ * \returns the line number.
+ */
constexpr size_t Line() const { return line_; }
+ /**
+ * Returns a human-readable string representing this object.
+ *
+ * \returns a human-readable string representing source location information.
+ */
std::string ToString() const;
private: