| 300 | } |
| 301 | |
| 302 | std::int64_t Depth(std::string_view path) { |
| 303 | // The last slash is not counted towards depth because it represents a |
| 304 | // directory. |
| 305 | bool has_trailing_slash = !path.empty() && path.back() == '/'; |
| 306 | return std::count(path.begin(), path.end(), fs::internal::kSep) - has_trailing_slash; |
| 307 | } |
| 308 | |
| 309 | // Change the default upload buffer size. In general, sending larger buffers is more |
| 310 | // efficient with GCS, as each buffer requires a roundtrip to the service. With formatted |