better error-handling, importing entire packages. Cache now keyed by FQName
diff --git a/FQName.cpp b/FQName.cpp
index 0b241d6..bb45376 100644
--- a/FQName.cpp
+++ b/FQName.cpp
@@ -23,10 +23,24 @@
setTo(s);
}
+FQName::FQName(
+ const std::string &package,
+ const std::string &version,
+ const std::string &name)
+ : mValid(true),
+ mPackage(package),
+ mVersion(version),
+ mName(name) {
+}
+
bool FQName::isValid() const {
return mValid;
}
+bool FQName::isFullyQualified() const {
+ return !mPackage.empty() && !mVersion.empty() && !mName.empty();
+}
+
bool FQName::setTo(const std::string &s) {
mPackage.clear();
mVersion.clear();
@@ -84,7 +98,7 @@
}
}
-std::string FQName::debugString() const {
+std::string FQName::string() const {
CHECK(mValid);
std::string out;
@@ -106,7 +120,11 @@
return;
}
- LOG(INFO) << debugString();
+ LOG(INFO) << string();
+}
+
+bool FQName::operator<(const FQName &other) const {
+ return string() < other.string();
}
} // namespace android