IFS/src/include/IFS/Host/Util.h
Go to the documentation of this file.
1 /****
2  * Util.h
3  * Internal shared utility stuff for dealing with Host filing API
4  *
5  * Created on: 1 December 2020
6  *
7  * Copyright 2019 mikee47 <mike@sillyhouse.net>
8  *
9  * This file is part of the IFS Library
10  *
11  * This library is free software: you can redistribute it and/or modify it under the terms of the
12  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along with this library.
19  * If not, see <https://www.gnu.org/licenses/>.
20  *
21  ****/
22 
23 #pragma once
24 
25 #include "../Error.h"
26 #include "../OpenFlags.h"
27 #include <errno.h>
28 #include <WString.h>
29 
30 struct stat;
31 
32 namespace IFS
33 {
34 namespace Host
35 {
39 inline int syserr()
40 {
41  return Error::fromSystem(-errno);
42 }
43 
47 int mapFlags(OpenFlags flags);
48 
50 
51 } // namespace Host
52 } // namespace IFS
Manage a set of bit values using enumeration.
Definition: BitSet.h:45
The String class.
Definition: WString.h:137
int fromSystem(int syscode)
Translate system error code into IFS error code.
Definition: Components/IFS/src/include/IFS/Error.h:115
Definition: Streams.h:25
int mapFlags(OpenFlags flags)
Get corresponding host flags for given IFS flags.
String getErrorString(int err)
int syserr()
Get IFS error code for the current system errno.
Definition: IFS/src/include/IFS/Host/Util.h:39
Definition: DirectoryTemplate.h:37