Change some SplitStringUsing calls to Split.

This is done to match an internal Google change necessary to deprecate an old internal API.  Nothing needs to change here, however making the change allows the internal code to continue to match the Github code, which is desirable.
This commit is contained in:
Andy Getz 2020-08-07 22:10:08 -04:00 committed by Adam Cozzette
parent 36d39a0266
commit bd7d87269f
2 changed files with 8 additions and 4 deletions

View File

@ -29,12 +29,12 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <iostream>
#include <string>
#include <google/protobuf/compiler/objectivec/objectivec_generator.h>
#include <google/protobuf/compiler/objectivec/objectivec_file.h>
#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
namespace google {
namespace protobuf {
@ -93,8 +93,11 @@ bool ObjectiveCGenerator::GenerateAll(const std::vector<const FileDescriptor*>&
// A semicolon delimited string that lists the paths of .proto files to
// exclude from the package prefix validations (expected_prefixes_path).
// This is provided as an "out", to skip some files being checked.
SplitStringUsing(options[i].second, ";",
&generation_options.expected_prefixes_suppressions);
for (StringPiece split_piece : Split(
options[i].second, ";", true)) {
generation_options.expected_prefixes_suppressions.push_back(
std::string(split_piece));
}
} else if (options[i].first == "generate_for_named_framework") {
// The name of the framework that protos are being generated for. This
// will cause the #import statements to be framework based using this

View File

@ -78,7 +78,8 @@ Options::Options() {
}
const char* suppressions = getenv("GPB_OBJC_EXPECTED_PACKAGE_PREFIXES_SUPPRESSIONS");
if (suppressions) {
SplitStringUsing(suppressions, ";", &expected_prefixes_suppressions);
expected_prefixes_suppressions =
Split(suppressions, ";", true);
}
}