aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/command_line_interface.h
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 07:03:06 +0000
commit5f12164f54a12500d2d8276937b7ed4fec408b99 (patch)
tree5cce5fcecb4a3104ca33fd67e1d37f788b719576 /src/google/protobuf/compiler/command_line_interface.h
parent46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 (diff)
Refactor the way output is handled in CommandLineInterface -- now it will be stored in-memory until all code generators have completed, then dumped to disk all at once. While this means that protoc uses more memory, the code is much simpler, and handles insertions much faster. Also, this made it easier to implement a useful feature: insertions will be indented to match the insertion point line. Therefore, when inserting into Python code, you don't have to figure out how much to indent your inserted code. The refactoring should also make it easier to implement output-to-jar at some point.
Diffstat (limited to 'src/google/protobuf/compiler/command_line_interface.h')
-rw-r--r--src/google/protobuf/compiler/command_line_interface.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/command_line_interface.h b/src/google/protobuf/compiler/command_line_interface.h
index 1070a83b..1a75ec85 100644
--- a/src/google/protobuf/compiler/command_line_interface.h
+++ b/src/google/protobuf/compiler/command_line_interface.h
@@ -174,9 +174,9 @@ class LIBPROTOC_EXPORT CommandLineInterface {
// -----------------------------------------------------------------
class ErrorPrinter;
- class DiskOutputDirectory;
- class ErrorReportingFileOutput;
- class InsertionOutputStream;
+ class MemoryOutputDirectory;
+ class SubOutputDirectory;
+ class MemoryOutputStream;
// Clear state from previous Run().
void Clear();
@@ -212,7 +212,8 @@ class LIBPROTOC_EXPORT CommandLineInterface {
// Generate the given output file from the given input.
struct OutputDirective; // see below
bool GenerateOutput(const vector<const FileDescriptor*>& parsed_files,
- const OutputDirective& output_directive);
+ const OutputDirective& output_directive,
+ OutputDirectory* parent_output_directory);
bool GeneratePluginOutput(const vector<const FileDescriptor*>& parsed_files,
const string& plugin_name,
const string& parameter,