From 3d0e273ec340081a8e8c6d7bc4adbdd1f8135804 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 2 Nov 2020 16:03:38 +0000 Subject: [PATCH] Make doxygen happy. This CL adds some code comments to fixup doxygen warnings. Change-Id: I0d0f4b20a1023691141b2f49f82f4538ffe18614 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31600 Reviewed-by: Ben Clayton Commit-Queue: dan sinclair --- src/source.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/source.h b/src/source.h index 4f689f40a7..ffc873ba1b 100644 --- a/src/source.h +++ b/src/source.h @@ -30,19 +30,26 @@ class Source { class File { public: /// Constructs the File with the given file path and content. + /// @param file_path the path for this file + /// @param file_content the file contents File(const std::string& file_path, const std::string& file_content); ~File(); - const std::string path; /// file path (optional) - const std::string content; /// file content - const std::vector lines; /// |content| split by lines + /// file path (optional) + const std::string path; + /// file content + const std::string content; + /// |content| split by lines + const std::vector lines; }; /// Location holds a 1-based line and column index. /// 0's for |line| or |column| represent invalid values. class Location { public: + /// The line number, 1-based size_t line = 0; + /// The column number, 1-based size_t column = 0; }; @@ -53,28 +60,39 @@ class Source { inline Range() = default; /// Constructs a zero-length Range starting at |loc|. + /// @param loc the location to use to build the range inline explicit Range(const Location& loc) : begin(loc), end(loc) {} /// Constructs the Range beginning at |b| and ending at |e|. + /// @param b the beginning of the range + /// @param e the end of the range inline Range(const Location& b, const Location& e) : begin(b), end(e) {} - Location begin; /// The location of the first character in the range. - Location end; /// The location of one-past the last character in the range. + /// The location of the first character in the range. + Location begin; + /// The location of one-past the last character in the range. + Location end; }; /// Constructs the Source with an zero initialized Range and null File. inline Source() = default; /// Constructs the Source with the Range |rng| and a null File. + /// @param rng the range to assign to the source inline explicit Source(const Range& rng) : range(rng) {} /// Constructs the Source with the Range |loc| and a null File. + /// @param loc the location to assign to the source inline explicit Source(const Location& loc) : range(Range(loc)) {} /// Constructs the Source with the Range |rng| and File |f|. + /// @param rng the range for the source + /// @param f the file for the source inline Source(const Range& rng, File const* f) : range(rng), file(f) {} + /// Line/column range for this source Range range; + /// Source file File const* file = nullptr; };