commit | fdeb0f4b96b6c39b1b9ed3358634f180f9e6df06 | [log] [tgz] |
---|---|---|
author | Christopher Wiley <wiley@google.com> | Fri Sep 11 15:38:22 2015 -0700 |
committer | Christopher Wiley <wiley@google.com> | Mon Sep 14 09:45:19 2015 -0700 |
tree | b172914bb01c7d82d18b0d57bf050a4cfa056518 | |
parent | 038485e9c8a4d7c0d47720e5bb1b1086b7550de7 [diff] |
Abstract away file IO when writing generated code This allows us to write unittests of Java/Cpp AST elements without doing file I/O each time. Introduce a CodeWriter class which may write to either a string or a file dependening on the contect. While here, mark the write methods as const. Test: Compiles, unittests pass, added new unittest demonstrating usage. Bug: 23598995 Change-Id: I240ede41f0f9c04c0d14d1a3680ce5ab332babbc