Shaka Player Embedded
file_system_win.cc
Go to the documentation of this file.
1 // Copyright 2017 Google LLC
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 // https://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 #include <Shlwapi.h>
16 #include <glog/logging.h>
17 
18 #include "src/util/file_system.h"
19 
20 namespace shaka {
21 namespace util {
22 
23 // static
24 std::string FileSystem::PathJoin(const std::string& a, const std::string& b) {
25  std::string ret(MAX_PATH, '\0');
26  if (!PathCombineA(ret.c_str(), a.c_str(), b.c_str()))
27  return "";
28  ret.resize(strlen(ret.c_str()));
29  return ret;
30 }
31 
32 // static
33 std::string FileSystem::DirName(const std::string& path) {
34 #error "Not implemented for Windows"
35 }
36 
37 bool FileSystem::FileExists(const std::string& path) const {
38  // Cannot use fstream for this since it allows opening directories.
39  return PathFileExists(path.c_str());
40 }
41 
42 bool FileSystem::DirectoryExists(const std::string& path) const {
43  return PathIsDirectory(path.c_str());
44 }
45 
46 bool FileSystem::ListFiles(const std::string& path,
47  std::vector<std::string>* files) const {
48  files->clear();
49 
50 #error "Not implemented for Windows"
51 
52  return true;
53 }
54 
55 } // namespace util
56 } // namespace shaka
static std::string DirName(const std::string &path)
virtual bool FileExists(const std::string &path) const
virtual bool DirectoryExists(const std::string &path) const
static std::string PathJoin(const std::string &a, const std::string &b)
virtual MUST_USE_RESULT bool ListFiles(const std::string &path, std::vector< std::string > *files) const