Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 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 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TF_DECODE_DATA_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TF_DECODE_DATA_H__
0010 
0011 #include <cstddef>
0012 #include <cstdint>
0013 #include <string>
0014 #include <utility>
0015 #include <vector>
0016 
0017 // Must be included last
0018 #include "google/protobuf/port_def.inc"
0019 
0020 namespace google {
0021 namespace protobuf {
0022 namespace compiler {
0023 namespace objectivec {
0024 
0025 // TODO: PROTOC_EXPORT is only used to allow the CMake build to
0026 // find/link these in the unittest, this is not public api.
0027 
0028 // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
0029 // the input into the expected output.
0030 class PROTOC_EXPORT TextFormatDecodeData {
0031  public:
0032   TextFormatDecodeData() = default;
0033   ~TextFormatDecodeData() = default;
0034 
0035   TextFormatDecodeData(const TextFormatDecodeData&) = delete;
0036   TextFormatDecodeData& operator=(const TextFormatDecodeData&) = delete;
0037 
0038   void AddString(int32_t key, const std::string& input_for_decode,
0039                  const std::string& desired_output);
0040   size_t num_entries() const { return entries_.size(); }
0041   std::string Data() const;
0042 
0043   static std::string DecodeDataForString(const std::string& input_for_decode,
0044                                          const std::string& desired_output);
0045 
0046  private:
0047   typedef std::pair<int32_t, std::string> DataEntry;
0048   std::vector<DataEntry> entries_;
0049 };
0050 
0051 }  // namespace objectivec
0052 }  // namespace compiler
0053 }  // namespace protobuf
0054 }  // namespace google
0055 
0056 #include "google/protobuf/port_undef.inc"
0057 
0058 #endif  // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TF_DECODE_DATA_H__