| Index: third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.h
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.h
|
| similarity index 64%
|
| copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h
|
| copy to third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.h
|
| index 1c1caf1f900824eec0f2f59e257a134effd519e5..4cd49bda20fe869b7faadc6506b02b27e3c0a790 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_extension.h
|
| +++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_extension_lite.h
|
| @@ -28,59 +28,49 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Author: kenton@google.com (Kenton Varda)
|
| -// Based on original Protocol Buffers design by
|
| -// Sanjay Ghemawat, Jeff Dean, and others.
|
| -
|
| -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_EXTENSION_H__
|
| -#define GOOGLE_PROTOBUF_COMPILER_CPP_EXTENSION_H__
|
| +#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__
|
| +#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__
|
|
|
| +#include <map>
|
| #include <string>
|
| +
|
| #include <google/protobuf/stubs/common.h>
|
| -#include <google/protobuf/compiler/cpp/cpp_options.h>
|
| +#include <google/protobuf/compiler/java/java_extension.h>
|
|
|
| namespace google {
|
| namespace protobuf {
|
| - class FieldDescriptor; // descriptor.h
|
| - namespace io {
|
| - class Printer; // printer.h
|
| - }
|
| -}
|
| -
|
| -namespace protobuf {
|
| namespace compiler {
|
| -namespace cpp {
|
| +namespace java {
|
|
|
| -// Generates code for an extension, which may be within the scope of some
|
| +// Generates code for a lite extension, which may be within the scope of some
|
| // message or may be at file scope. This is much simpler than FieldGenerator
|
| // since extensions are just simple identifiers with interesting types.
|
| -class ExtensionGenerator {
|
| +class ImmutableExtensionLiteGenerator : public ExtensionGenerator {
|
| public:
|
| - // See generator.cc for the meaning of dllexport_decl.
|
| - explicit ExtensionGenerator(const FieldDescriptor* descriptor,
|
| - const Options& options);
|
| - ~ExtensionGenerator();
|
| + explicit ImmutableExtensionLiteGenerator(const FieldDescriptor* descriptor,
|
| + Context* context);
|
| + virtual ~ImmutableExtensionLiteGenerator();
|
|
|
| - // Header stuff.
|
| - void GenerateDeclaration(io::Printer* printer);
|
| + virtual void Generate(io::Printer* printer);
|
|
|
| - // Source file stuff.
|
| - void GenerateDefinition(io::Printer* printer);
|
| + // Returns an estimate of the number of bytes the printed code will compile to
|
| + virtual int GenerateNonNestedInitializationCode(io::Printer* printer);
|
|
|
| - // Generate code to register the extension.
|
| - void GenerateRegistration(io::Printer* printer);
|
| + // Returns an estimate of the number of bytes the printed code will compile to
|
| + virtual int GenerateRegistrationCode(io::Printer* printer);
|
|
|
| private:
|
| const FieldDescriptor* descriptor_;
|
| - string type_traits_;
|
| - Options options_;
|
| + Context* context_;
|
| + ClassNameResolver* name_resolver_;
|
| + string scope_;
|
|
|
| - GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
|
| + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableExtensionLiteGenerator);
|
| };
|
|
|
| -} // namespace cpp
|
| +} // namespace java
|
| } // namespace compiler
|
| } // namespace protobuf
|
|
|
| } // namespace google
|
| -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_H__
|
| +#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_LITE_H__
|
|
|