Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:11:56

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2024 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 // An RAII type for printing a namespace.
0009 //
0010 // Example:
0011 // {
0012 //   Printer printer(output_stream.get(), '$');
0013 //   const NamespacePrinter namespace_printer(&printer, {"a", "b", "c"});
0014 //   // namespace opening will be opened here
0015 //   ...
0016 //   // namespace closing will be emitted here
0017 // }
0018 //
0019 // By default, the filename will be converted to a macro by substituting '/' and
0020 // '.' characters with '_'.  If a different transformation is required, an
0021 // optional transformation function can be provided.
0022 
0023 #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_NAMESPACE_PRINTER_H__
0024 #define GOOGLE_PROTOBUF_COMPILER_CPP_NAMESPACE_PRINTER_H__
0025 
0026 #include <string>
0027 #include <vector>
0028 
0029 #include "google/protobuf/io/printer.h"
0030 
0031 // Must be included last.
0032 #include "google/protobuf/port_def.inc"
0033 
0034 namespace google {
0035 namespace protobuf {
0036 namespace compiler {
0037 namespace cpp {
0038 
0039 // An RAII type for printing a namespace.
0040 class PROTOC_EXPORT NamespacePrinter final {
0041  public:
0042   explicit NamespacePrinter(google::protobuf::io::Printer* p,
0043                             std::vector<std::string> namespace_components);
0044   ~NamespacePrinter();
0045 
0046  private:
0047   google::protobuf::io::Printer* const p_;
0048   const std::vector<std::string> namespace_components_;
0049 };
0050 
0051 #include "google/protobuf/port_undef.inc"
0052 
0053 }  // namespace cpp
0054 }  // namespace compiler
0055 }  // namespace protobuf
0056 }  // namespace google
0057 
0058 #endif  // GOOGLE_PROTOBUF_COMPILER_CPP_NAMESPACE_PRINTER_H__