Home | History | Annotate | Download | only in hidl

Lines Matching refs:FQName

81     FQName package = FQName(root, "0.0", "");
102 Formatter Coordinator::getFormatter(const FQName& fqName, Location location,
109 status_t err = getFilepath(fqName, location, fileName, &filepath);
131 status_t Coordinator::getFilepath(const FQName& fqName, Location location,
142 err = getPackagePath(fqName, false /* relative */, false /* sanitized */, &packagePath);
148 err = convertPackageRootToPath(fqName, &packageRootPath);
150 err = getPackagePath(fqName, true /* relative */, false /* sanitized */, &packagePath);
156 err = convertPackageRootToPath(fqName, &packageRootPath);
158 err = getPackagePath(fqName, true /* relative */, true /* sanitized */, &packagePath);
171 // This is a global list. It's not cleared when a second fqname is processed for
209 AST* Coordinator::parse(const FQName& fqName, std::set<AST*>* parsedASTs,
212 status_t err = parseOptional(fqName, &ret, parsedASTs, enforcement);
221 status_t Coordinator::parseOptional(const FQName& fqName, AST** ast, std::set<AST*>* parsedASTs,
223 CHECK(fqName.isFullyQualified());
225 auto it = mCache.find(fqName);
242 mCache[fqName] = nullptr;
246 if (fqName.name() != "types") {
248 FQName typesName = fqName.getTypesForPackage();
258 getPackagePath(fqName, false /* relative */, false /* sanitized */, &packagePath);
261 const std::string path = makeAbsolute(packagePath + fqName.name() + ".hal");
274 mCache.erase(fqName); // nullptr in cache is used to find circular imports
289 if ((*ast)->package().package() != fqName.package() ||
290 (*ast)->package().version() != fqName.version()) {
299 if (fqName.name() == "types") {
306 } else if ((*ast)->getInterface()->localName() != fqName.name()) {
311 fqName.name().c_str());
315 } else if (fqName.name() != "types") {
320 fqName.name().c_str());
344 // parse fqName.
345 mCache[fqName] = *ast;
348 err = enforceRestrictionsOnPackage(fqName, enforcement);
350 mCache[fqName] = nullptr;
359 const Coordinator::PackageRoot* Coordinator::findPackageRoot(const FQName& fqName) const {
360 CHECK(!fqName.package().empty());
362 // Find the right package prefix and path for this FQName. For
363 // example, if FQName is "android.hardware.nfc@1.0::INfc", and the
371 if (!fqName.inPackage(it->root.package())) {
376 std::cerr << "ERROR: Multiple package roots found for " << fqName.string() << " ("
385 std::cerr << "ERROR: Package root not specified for " << fqName.string() << "\n";
400 status_t Coordinator::getPackageRoot(const FQName& fqName, std::string* root) const {
401 const PackageRoot* packageRoot = findPackageRoot(fqName);
409 status_t Coordinator::getPackageRootPath(const FQName& fqName, std::string* path) const {
410 const PackageRoot* packageRoot = findPackageRoot(fqName);
418 status_t Coordinator::getPackagePath(const FQName& fqName, bool relative, bool sanitized,
420 const PackageRoot* packageRoot = findPackageRoot(fqName);
423 // Given FQName of "android.hardware.nfc.test@1.0::IFoo" and a prefix
425 std::string suffix = StringHelper::LTrim(fqName.package(), packageRoot->root.package());
436 components.push_back(sanitized ? fqName.sanitizedVersion() : fqName.version());
443 const FQName &package,
497 const FQName &package,
498 std::vector<FQName> *packageInterfaces) const {
509 FQName subFQName(package.package(), package.version(), fileName);
516 FQName& fqName, std::string* path) const {
518 status_t err = getPackageRoot(fqName, &packageRoot);
531 status_t Coordinator::isTypesOnlyPackage(const FQName& package, bool* result) const {
532 std::vector<FQName> packageInterfaces;
545 status_t Coordinator::addUnreferencedTypes(const std::vector<FQName>& packageInterfaces,
546 std::set<FQName>* unreferencedDefinitions,
547 std::set<FQName>* unreferencedImports) const {
551 std::set<FQName> packageDefinedTypes;
552 std::set<FQName> packageReferencedTypes;
553 std::set<FQName> packageImportedTypes;
554 std::set<FQName> typesDefinedTypes; // only types.hal types
556 for (const auto& fqName : packageInterfaces) {
557 AST* ast = parse(fqName);
559 std::cerr << "ERROR: Could not parse " << fqName.string() << ". Aborting." << std::endl;
568 if (fqName.name() == "types") {
574 for (const auto &fqName : packageDefinedTypes) {
575 std::cout << "VERBOSE: DEFINED " << fqName.string() << std::endl;
578 for (const auto &fqName : packageImportedTypes) {
579 std::cout << "VERBOSE: IMPORTED " << fqName.string() << std::endl;
582 for (const auto &fqName : packageReferencedTypes) {
583 std::cout << "VERBOSE: REFERENCED " << fqName.string() << std::endl;
586 for (const auto &fqName : typesDefinedTypes) {
587 std::cout << "VERBOSE: DEFINED in types.hal " << fqName.string() << std::endl;
591 for (const auto& fqName : packageReferencedTypes) {
592 packageDefinedTypes.erase(fqName);
593 packageImportedTypes.erase(fqName);
597 for (const auto& fqName : typesDefinedTypes) {
598 packageImportedTypes.erase(fqName);
608 status_t Coordinator::enforceRestrictionsOnPackage(const FQName& fqName,
613 // need fqName to be something like android.hardware.foo@1.0.
615 if (fqName.package().empty() || fqName.version().empty()) {
616 std::cerr << "ERROR: Cannot enforce restrictions on package " << fqName.string()
625 FQName package = fqName.getPackageAndVersion();
651 status_t Coordinator::enforceMinorVersionUprevs(const FQName& currentPackage,
664 FQName prevPackage = currentPackage;
700 std::vector<FQName> packageInterfaces;
707 for (const FQName &currentFQName : packageInterfaces) {
737 FQName lastFQName(prevPackage.package(), prevPackage.version(),
756 if (iface->superType()->fqName() != lastFQName) {
758 << currentPackage.string() << ": " << iface->fqName().string() << " extends "
759 << iface->superType()->fqName().string()
789 Coordinator::HashStatus Coordinator::checkHash(const FQName& fqName) const {
790 AST* ast = parse(fqName);
794 status_t err = getPackageRootPath(fqName, &rootPath);
801 Hash::lookupHash(hashPath, fqName.string(), &error, &fileExists);
820 std::cerr << "ERROR: " << fqName.string() << " has hash " << currentHash
829 status_t Coordinator::getUnfrozenDependencies(const FQName& fqName,
830 std::set<FQName>* result) const {
833 AST* ast = parse(fqName);
836 std::set<FQName> imported;
841 for (const FQName& importedPackage : imported) {
842 std::vector<FQName> packageInterfaces;
848 for (const FQName& importedName : packageInterfaces) {
860 status_t Coordinator::enforceHashes(const FQName& currentPackage) const {
861 std::vector<FQName> packageInterfaces;
867 for (const FQName& currentFQName : packageInterfaces) {
875 std::set<FQName> unfrozenDependencies;
882 for (const FQName& name : unfrozenDependencies) {