-
Notifications
You must be signed in to change notification settings - Fork 523
Expand file tree
/
Copy pathcodearea.h
More file actions
38 lines (31 loc) · 932 Bytes
/
codearea.h
File metadata and controls
38 lines (31 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef LOCATION_OPENLOCATIONCODE_CODEAREA_H_
#define LOCATION_OPENLOCATIONCODE_CODEAREA_H_
#include <cstdlib>
namespace openlocationcode {
struct LatLng {
double latitude;
double longitude;
};
class CodeArea {
public:
CodeArea(double latitude_lo, double longitude_lo, double latitude_hi,
double longitude_hi, size_t code_length);
double GetLatitudeLo() const;
double GetLongitudeLo() const;
double GetLatitudeHi() const;
double GetLongitudeHi() const;
size_t GetCodeLength() const;
LatLng GetCenter() const;
// Returns whether or not this area was a valid decode result.
bool IsValid() const;
// Returns an invalid CodeArea object.
static const CodeArea& InvalidCodeArea();
private:
double latitude_lo_;
double longitude_lo_;
double latitude_hi_;
double longitude_hi_;
size_t code_length_;
};
} // namespace openlocationcode
#endif // LOCATION_OPENLOCATIONCODE_CODEAREA_H_