LibPkg
filesystem.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 //
3 // Copyright 2003-2020 Graham Shaw
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef LIBPKG_FILESYSTEM
18 #define LIBPKG_FILESYSTEM
19 
20 #include <string>
21 
22 namespace pkg {
23 
24 using std::string;
25 
30 string canonicalise(const string& pathname);
31 
39 void force_delete(const string& pathname);
40 
47 void soft_delete(const string& pathname);
48 
63 void force_move(const string& src_pathname,const string& dst_pathname,
64  bool overwrite=false);
65 
70 void copy_object(const string& src_pathname,const string& dst_pathname);
71 
75 void create_directory(const string& pathname);
76 
85 void write_file_info(const string& pathname,unsigned int loadaddr,
86  unsigned int execaddr,unsigned int attr);
87 
92 void write_filetype(const string& pathname,unsigned int filetype);
93 
98 unsigned int object_type(const string& pathname);
99 
104 unsigned int object_length(const string& pathname);
105 
110 std::string boot_drive_relative(const string& pathname);
111 
112 }; /* namespace pkg */
113 
114 #endif
unsigned int object_length(const string &pathname)
Get object length.
Definition: filesystem.cc:155
void write_filetype(const string &pathname, unsigned int filetype)
Write filetype.
Definition: filesystem.cc:141
unsigned int object_type(const string &pathname)
Get object type.
Definition: filesystem.cc:147
void copy_object(const string &src_pathname, const string &dst_pathname)
Recursively copy object.
Definition: filesystem.cc:119
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
std::string boot_drive_relative(const string &pathname)
Get version of pathname made relative the the boot drive.
Definition: filesystem.cc:163
void write_file_info(const string &pathname, unsigned int loadaddr, unsigned int execaddr, unsigned int attr)
Write file information.
Definition: filesystem.cc:132
void force_delete(const string &pathname)
Delete file without regard for file attributes.
Definition: filesystem.cc:40
void force_move(const string &src_pathname, const string &dst_pathname, bool overwrite)
Move file without regard for file attributes.
Definition: filesystem.cc:73
void create_directory(const string &pathname)
Create directory.
Definition: filesystem.cc:126
const char * dst_pathname
Definition: path_table.cc:32
void soft_delete(const string &pathname)
Delete file without changing file attributes It is not an error if the file does not exist...
Definition: filesystem.cc:58
const char * src_pathname
Definition: path_table.cc:31
string canonicalise(const string &pathname)
Canonicalise pathname.
Definition: filesystem.cc:24

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)