-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcpputil.h
More file actions
41 lines (29 loc) · 1.38 KB
/
Copy pathcpputil.h
File metadata and controls
41 lines (29 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (C) 2022 Satya Das and CppParser contributors
// SPDX-License-Identifier: MIT
#ifndef FF2B85CA_C19B_482E_9B0F_5F098BF974A1
#define FF2B85CA_C19B_482E_9B0F_5F098BF974A1
#include <filesystem>
#include "cppast/cppast.h"
#include "cppconst.h"
namespace fs = std::filesystem;
using CppProgFileSelecter = std::function<bool(const std::string&)>;
void collectFiles(std::vector<std::string>& files, const fs::path& path, const CppProgFileSelecter& fileSelector);
inline std::vector<std::string> collectFiles(const std::string& folder, const CppProgFileSelecter& fileSelector)
{
std::vector<std::string> files;
collectFiles(files, folder, fileSelector);
return files;
}
inline cppast::CppAccessType defaultAccessType(cppast::CppCompoundType type)
{
return (type == cppast::CppCompoundType::CLASS) ? cppast::CppAccessType::PRIVATE : cppast::CppAccessType::PUBLIC;
}
inline cppast::CppAccessType effectiveAccessType(cppast::CppAccessType objAccessType, cppast::CppCompoundType ownerType)
{
return (objAccessType != cppast::CppAccessType::UNSPECIFIED) ? objAccessType : defaultAccessType(ownerType);
}
inline cppast::CppAccessType resolveInheritanceType(cppast::CppAccessType inheritanceType, cppast::CppCompoundType type)
{
return (inheritanceType != cppast::CppAccessType::UNSPECIFIED) ? inheritanceType : defaultAccessType(type);
}
#endif /* FF2B85CA_C19B_482E_9B0F_5F098BF974A1 */