summaryrefslogtreecommitdiffstats
path: root/aidl_language.h
diff options
context:
space:
mode:
authorCasey Dahlin <sadmac@google.com>2015-09-29 16:50:40 -0700
committerCasey Dahlin <sadmac@google.com>2015-09-30 11:53:37 -0700
commitc378c9946ac42e225be4fe37d3b97e1b88a97304 (patch)
tree040ed1a894f1815ed94e58d67f0143843070eef1 /aidl_language.h
parent0c732dbae2e6b33cde9a266ea091e1459742f1f1 (diff)
downloadandroid_system_tools_aidl-c378c9946ac42e225be4fe37d3b97e1b88a97304.tar.gz
android_system_tools_aidl-c378c9946ac42e225be4fe37d3b97e1b88a97304.tar.bz2
android_system_tools_aidl-c378c9946ac42e225be4fe37d3b97e1b88a97304.zip
Stop storing the direction buffer
We pull the information out of the direction buffer_type immediately and pack it safely in to privates where it can be accessed with sane accessors. Test: unit tests Bug: 24410295 Change-Id: I84e4cf50aad9202210fc9c3db5dd78858991ecd7 Signed-off-by: Casey Dahlin <sadmac@google.com>
Diffstat (limited to 'aidl_language.h')
-rw-r--r--aidl_language.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/aidl_language.h b/aidl_language.h
index be6e4a2..362f9ea 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -56,14 +56,22 @@ class AidlNode {
class AidlArgument : public AidlNode {
public:
+ enum Direction { IN_DIR = 1, OUT_DIR = 2, INOUT_DIR = 3 };
+
AidlArgument(buffer_type direction, type_type type, buffer_type name);
virtual ~AidlArgument() = default;
- buffer_type direction;
+ Direction GetDirection() const { return direction_; }
+ bool DirectionWasSpecified() const { return direction_specified_; }
+ std::string ToString() const;
+
buffer_type name;
type_type type;
private:
+ Direction direction_;
+ bool direction_specified_;
+
DISALLOW_COPY_AND_ASSIGN(AidlArgument);
};
@@ -123,13 +131,6 @@ struct interface_type {
extern "C" {
#endif
-// in, out or inout
-enum {
- IN_PARAMETER = 1,
- OUT_PARAMETER = 2,
- INOUT_PARAMETER = 3
-};
-
// callbacks from within the parser
// these functions all take ownership of the strings
struct ParserCallbacks {