|
|
@ -36,10 +36,6 @@ |
|
|
|
#include "google/protobuf/io/tokenizer.h" |
|
|
|
#include "google/protobuf/io/tokenizer.h" |
|
|
|
#include "google/protobuf/io/zero_copy_stream_impl.h" |
|
|
|
#include "google/protobuf/io/zero_copy_stream_impl.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
|
|
|
|
#include <ctype.h> |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace google { |
|
|
|
namespace google { |
|
|
|
namespace protobuf { |
|
|
|
namespace protobuf { |
|
|
|
namespace compiler { |
|
|
|
namespace compiler { |
|
|
@ -51,12 +47,16 @@ using google::protobuf::io::win32::access; |
|
|
|
using google::protobuf::io::win32::open; |
|
|
|
using google::protobuf::io::win32::open; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(_WIN32) || defined(__CYGWIN__) |
|
|
|
|
|
|
|
#include "absl/strings/ascii.h" |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Returns true if the text looks like a Windows-style absolute path, starting
|
|
|
|
// Returns true if the text looks like a Windows-style absolute path, starting
|
|
|
|
// with a drive letter. Example: "C:\foo". TODO: Share this with
|
|
|
|
// with a drive letter. Example: "C:\foo". TODO: Share this with
|
|
|
|
// copy in command_line_interface.cc?
|
|
|
|
// copy in command_line_interface.cc?
|
|
|
|
static bool IsWindowsAbsolutePath(absl::string_view text) { |
|
|
|
static bool IsWindowsAbsolutePath(absl::string_view text) { |
|
|
|
#if defined(_WIN32) || defined(__CYGWIN__) |
|
|
|
#if defined(_WIN32) || defined(__CYGWIN__) |
|
|
|
return text.size() >= 3 && text[1] == ':' && isalpha(text[0]) && |
|
|
|
return text.size() >= 3 && text[1] == ':' && absl::ascii_isalpha(text[0]) && |
|
|
|
(text[2] == '/' || text[2] == '\\') && text.find_last_of(':') == 1; |
|
|
|
(text[2] == '/' || text[2] == '\\') && text.find_last_of(':') == 1; |
|
|
|
#else |
|
|
|
#else |
|
|
|
return false; |
|
|
|
return false; |
|
|
|