ApraLinuxUtils
1.0.0
C++ utility library for embedded Linux systems
Loading...
Searching...
No Matches
StorageType.cpp
Go to the documentation of this file.
1
/*
2
* StorageType.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 <
constants/StorageType.h
>
13
14
namespace
apra
15
{
16
17
std::string
STORAGE_TYPE_STRING::getString
(
STORAGE_TYPE
type)
18
{
19
switch
(type)
20
{
21
case
FAT32
:
22
return
"vfat"
;
23
case
NTFS
:
24
return
"ntfs"
;
25
case
EXT4
:
26
return
"ext4"
;
27
case
UNSUPPORTED
:
28
return
""
;
29
default
:
30
return
""
;
31
}
32
}
33
34
STORAGE_TYPE
STORAGE_TYPE_STRING::getEnum
(std::string typeStr)
35
{
36
if
(typeStr ==
getString
(
NTFS
))
37
{
38
return
NTFS
;
39
}
40
else
if
(typeStr ==
getString
(
EXT4
))
41
{
42
return
EXT4
;
43
}
44
else
if
(typeStr ==
getString
(
FAT32
))
45
{
46
return
FAT32
;
47
}
48
else
49
{
50
return
UNSUPPORTED
;
51
}
52
}
53
54
}
/* namespace apra */
StorageType.h
apra::STORAGE_TYPE_STRING::getEnum
static STORAGE_TYPE getEnum(std::string typeStr)
Definition
StorageType.cpp:34
apra::STORAGE_TYPE_STRING::getString
static std::string getString(STORAGE_TYPE type)
Definition
StorageType.cpp:17
apra
Definition
EventCallbacks.h:16
apra::STORAGE_TYPE
STORAGE_TYPE
Definition
StorageType.h:19
apra::NTFS
@ NTFS
Definition
StorageType.h:20
apra::UNSUPPORTED
@ UNSUPPORTED
Definition
StorageType.h:20
apra::EXT4
@ EXT4
Definition
StorageType.h:20
apra::FAT32
@ FAT32
Definition
StorageType.h:20
src
constants
StorageType.cpp
Generated by
1.9.8