1 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #ifndef TENSORFLOW_CORE_PLATFORM_FILE_SYSTEM_HELPER_H_ 17 #define TENSORFLOW_CORE_PLATFORM_FILE_SYSTEM_HELPER_H_ 18 19 #include <string> 20 #include <vector> 21 22 #include "tensorflow/core/platform/status.h" 23 24 namespace tensorflow { 25 26 class FileSystem; 27 class Env; 28 29 namespace internal { 30 31 // Given a pattern, stores in 'results' the set of paths (in the given file 32 // system) that match that pattern. 33 // 34 // This helper may be used by implementations of FileSystem::GetMatchingPaths() 35 // in order to provide parallel scanning of subdirectories (except on iOS). 36 // 37 // Arguments: 38 // fs: may not be null and will be used to identify directories and list 39 // their contents. 40 // env: may not be null and will be used to check if a match has been found. 41 // pattern: see FileSystem::GetMatchingPaths() for details. 42 // results: will be cleared and may not be null. 43 // 44 // Returns an error status if any call to 'fs' failed. 45 Status GetMatchingPaths(FileSystem* fs, Env* env, const string& pattern, 46 std::vector<string>* results); 47 48 } // namespace internal 49 } // namespace tensorflow 50 51 #endif // TENSORFLOW_CORE_PLATFORM_FILE_SYSTEM_HELPER_H_ 52