aboutsummaryrefslogtreecommitdiff
path: root/Coordinator.h
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-09-25 18:41:45 -0700
committerSteven Moreland <smoreland@google.com>2017-09-26 13:02:49 -0700
commitf78c44db648a1f7dd38fed110b8e53cc04f96516 (patch)
tree25eddc5852e9980d0aee9ec867af381bcec5f764 /Coordinator.h
parent2f4ee8e8d5b4315646189b128e913e830c9803a8 (diff)
downloadhidl-f78c44db648a1f7dd38fed110b8e53cc04f96516.tar.gz
Coordinator add getFormatter.
This way Coordinator can keep track of the files that are used and we can consolidate the code that builds paths to output files. Test: all host tests Bug: 65738957 Change-Id: Iaf1b00e130be892ef1bb620017032c29140ee5b6
Diffstat (limited to 'Coordinator.h')
-rw-r--r--Coordinator.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Coordinator.h b/Coordinator.h
index 21106f87..5b4958b7 100644
--- a/Coordinator.h
+++ b/Coordinator.h
@@ -20,10 +20,11 @@
#include <android-base/macros.h>
#include <hidl-util/FQName.h>
+#include <hidl-util/Formatter.h>
+#include <utils/Errors.h>
#include <map>
#include <set>
#include <string>
-#include <utils/Errors.h>
#include <vector>
namespace android {
@@ -42,6 +43,19 @@ struct Coordinator {
// adds path if it hasn't already been added
void addDefaultPackagePath(const std::string& root, const std::string& path);
+ enum class Location {
+ DIRECT, // outputPath + file name
+ PACKAGE_ROOT, // e.x. hal or other files within package root
+ GEN_OUTPUT, // e.x. android/hardware/foo/1.0/*.cpp
+ GEN_SANITIZED, // e.x. android/hardware/foo/V1_0/*.cpp
+ };
+
+ std::string getFilepath(const std::string& outputPath, const FQName& fqName, Location location,
+ const std::string& fileName) const;
+
+ Formatter getFormatter(const std::string& outputPath, const FQName& fqName, Location location,
+ const std::string& fileName) const;
+
enum class Enforce {
FULL, // default
NO_HASH, // only for use with -Lhash