@@ -112,10 +112,10 @@ class PrefixModeStorage {
112112 public:
113113 PrefixModeStorage ();
114114
115- const std::string prefix_to_proto_package_mappings_path () const { return prefix_to_proto_package_mappings_path_ ; }
116- void set_prefix_to_proto_package_mappings_path (const std::string& path) {
117- prefix_to_proto_package_mappings_path_ = path;
118- prefix_to_proto_package_map_ .clear ();
115+ const std::string package_to_prefix_mappings_path () const { return package_to_prefix_mappings_path_ ; }
116+ void set_package_to_prefix_mappings_path (const std::string& path) {
117+ package_to_prefix_mappings_path_ = path;
118+ package_to_prefix_map_ .clear ();
119119 }
120120
121121 std::string prefix_from_proto_package_mappings (const FileDescriptor* file);
@@ -137,8 +137,8 @@ class PrefixModeStorage {
137137
138138 private:
139139 bool use_package_name_;
140- std::map<std::string, std::string> prefix_to_proto_package_map_ ;
141- std::string prefix_to_proto_package_mappings_path_ ;
140+ std::map<std::string, std::string> package_to_prefix_map_ ;
141+ std::string package_to_prefix_mappings_path_ ;
142142 std::string exception_path_;
143143 std::string forced_prefix_;
144144 std::unordered_set<std::string> exceptions_;
@@ -168,20 +168,20 @@ std::string PrefixModeStorage::prefix_from_proto_package_mappings(const FileDesc
168168 return " " ;
169169 }
170170
171- if (prefix_to_proto_package_map_ .empty () && !prefix_to_proto_package_mappings_path_ .empty ()) {
171+ if (package_to_prefix_map_ .empty () && !package_to_prefix_mappings_path_ .empty ()) {
172172 std::string error_str;
173173 // Re use the same collector as we use for expected_prefixes_path since the file
174174 // format is the same.
175- PackageToPrefixesCollector collector (" Package to prefixes" , &prefix_to_proto_package_map_ );
176- if (!ParseSimpleFile (prefix_to_proto_package_mappings_path_ , &collector, &error_str)) {
175+ PackageToPrefixesCollector collector (" Package to prefixes" , &package_to_prefix_map_ );
176+ if (!ParseSimpleFile (package_to_prefix_mappings_path_ , &collector, &error_str)) {
177177 if (error_str.empty ()) {
178178 error_str = std::string (" protoc:0: warning: Failed to parse" )
179179 + std::string (" prefix to proto package mappings file: " )
180- + prefix_to_proto_package_mappings_path_ ;
180+ + package_to_prefix_mappings_path_ ;
181181 }
182182 std::cerr << error_str << std::endl;
183183 std::cerr.flush ();
184- prefix_to_proto_package_map_ .clear ();
184+ package_to_prefix_map_ .clear ();
185185 }
186186 }
187187
@@ -192,9 +192,9 @@ std::string PrefixModeStorage::prefix_from_proto_package_mappings(const FileDesc
192192 const std::string lookup_key = package.empty () ? no_package_prefix + file->name () : package;
193193
194194 std::map<std::string, std::string>::const_iterator prefix_lookup =
195- prefix_to_proto_package_map_ .find (lookup_key);
195+ package_to_prefix_map_ .find (lookup_key);
196196
197- if (prefix_lookup != prefix_to_proto_package_map_ .end ()) {
197+ if (prefix_lookup != package_to_prefix_map_ .end ()) {
198198 return prefix_lookup->second ;
199199 }
200200
@@ -230,12 +230,12 @@ PrefixModeStorage g_prefix_mode;
230230
231231} // namespace
232232
233- std::string GetPrefixToProtoPackageMappingsPath () {
234- return g_prefix_mode.prefix_to_proto_package_mappings_path ();
233+ std::string GetPackageToPrefixMappingsPath () {
234+ return g_prefix_mode.package_to_prefix_mappings_path ();
235235}
236236
237- void SetPrefixToProtoPackageMappingsPath (const std::string& file_path) {
238- g_prefix_mode.set_prefix_to_proto_package_mappings_path (file_path);
237+ void SetPackageToPrefixMappingsPath (const std::string& file_path) {
238+ g_prefix_mode.set_package_to_prefix_mappings_path (file_path);
239239}
240240
241241bool UseProtoPackageAsDefaultPrefix () {
0 commit comments