blob: ba777d0b4c916b20150f6edd6bb121c3422ae985 [file] [log] [blame]
Andreas Huber84f89de2016-07-28 15:39:51 -07001#ifndef FQNAME_H_
2
3#define FQNAME_H_
4
5#include <android-base/macros.h>
6#include <string>
7
8namespace android {
9
10struct FQName {
Andreas Huberda51b8e2016-07-28 16:00:57 -070011 explicit FQName();
Andreas Huber84f89de2016-07-28 15:39:51 -070012 explicit FQName(const std::string &s);
13
Andreas Huber68f24592016-07-29 14:53:48 -070014 FQName(const std::string &package,
15 const std::string &version,
16 const std::string &name);
17
Andreas Huber84f89de2016-07-28 15:39:51 -070018 bool isValid() const;
19 bool setTo(const std::string &s);
20
21 void applyDefaults(
22 const std::string &defaultPackage,
23 const std::string &defaultVersion);
24
25 std::string package() const;
26 std::string version() const;
27 std::string name() const;
28
Andreas Huber68f24592016-07-29 14:53:48 -070029 bool isFullyQualified() const;
30
Andreas Huberda51b8e2016-07-28 16:00:57 -070031 void print() const;
Andreas Huber68f24592016-07-29 14:53:48 -070032 std::string string() const;
33
34 bool operator<(const FQName &other) const;
Andreas Huber84f89de2016-07-28 15:39:51 -070035
36private:
37 bool mValid;
38 std::string mPackage;
39 std::string mVersion;
40 std::string mName;
Andreas Huber84f89de2016-07-28 15:39:51 -070041};
42
43} // namespace android
44
45#endif // FQNAME_H_