blob: dec47dd758b88f0e405fc6b559a202ac67c3f2cd [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
14 bool isValid() const;
15 bool setTo(const std::string &s);
16
17 void applyDefaults(
18 const std::string &defaultPackage,
19 const std::string &defaultVersion);
20
21 std::string package() const;
22 std::string version() const;
23 std::string name() const;
24
Andreas Huberda51b8e2016-07-28 16:00:57 -070025 void print() const;
Andreas Huber84f89de2016-07-28 15:39:51 -070026 std::string debugString() const;
27
28private:
29 bool mValid;
30 std::string mPackage;
31 std::string mVersion;
32 std::string mName;
33
34 DISALLOW_COPY_AND_ASSIGN(FQName);
35};
36
37} // namespace android
38
39#endif // FQNAME_H_