ApraLinuxUtils
1.0.0
C++ utility library for embedded Linux systems
Loading...
Searching...
No Matches
FileIO.cpp
Go to the documentation of this file.
1
/*
2
* FileIO.cpp
3
*
4
* Copyright (c) 2024 Apra Labs
5
*
6
* This file is part of ApraUtils.
7
*
8
* Licensed under the MIT License.
9
* See LICENSE file in the project root for full license information.
10
*/
11
12
#include "
utils/FileIO.h
"
13
#include <sys/stat.h>
14
15
using namespace
apra
;
16
17
FileIO::FileIO()
18
{
19
20
}
21
22
FileIO::~FileIO()
23
{
24
}
25
26
bool
FileIO::isFileExist
(
const
string
&path)
27
{
28
bool
returnValue;
29
struct
stat info;
30
if
(stat(path.c_str(), &info) != 0)
31
{
32
returnValue =
false
;
33
}
34
else
35
{
36
returnValue = S_ISREG(info.st_mode) != 0;
37
}
38
return
returnValue;
39
}
40
41
bool
FileIO::isDirectoryExist
(
const
string
&path)
42
{
43
bool
returnValue;
44
struct
stat info;
45
if
(stat(path.c_str(), &info) != 0)
46
{
47
returnValue =
false
;
48
}
49
else
50
{
51
returnValue = S_ISDIR(info.st_mode) != 0;
52
}
53
return
returnValue;
54
}
55
FileIO.h
apra::FileIO::isFileExist
static bool isFileExist(const string &path)
Definition
FileIO.cpp:26
apra::FileIO::isDirectoryExist
static bool isDirectoryExist(const string &path)
Definition
FileIO.cpp:41
apra
Definition
EventCallbacks.h:16
src
utils
FileIO.cpp
Generated by
1.9.8