btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / types / SourceLocation.h
blobd224463b1e75489dc76f08ef55ecf45e218b1345
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef SOURCE_LOCATION_H
6 #define SOURCE_LOCATION_H
8 #include <SupportDefs.h>
11 class SourceLocation {
12 public:
13 SourceLocation(int32 line = 0, int32 column = 0)
15 fLine(line),
16 fColumn(column)
20 SourceLocation(const SourceLocation& other)
22 fLine(other.fLine),
23 fColumn(other.fColumn)
27 SourceLocation& operator=(const SourceLocation& other)
29 fLine = other.fLine;
30 fColumn = other.fColumn;
31 return *this;
34 bool operator==(const SourceLocation& other) const
36 return fLine == other.fLine && fColumn == other.fColumn;
39 bool operator!=(const SourceLocation& other) const
41 return !(*this == other);
44 bool operator<(const SourceLocation& other) const
46 return fLine < other.fLine
47 || (fLine == other.fLine && fColumn < other.fColumn);
50 bool operator<=(const SourceLocation& other) const
52 return fLine < other.fLine
53 || (fLine == other.fLine && fColumn <= other.fColumn);
56 int32 Line() const
58 return fLine;
61 int32 Column() const
63 return fColumn;
66 private:
67 int32 fLine;
68 int32 fColumn;
72 #endif // SOURCE_LOCATION_H