forked from DragonLi-Mi/JavaCallCSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.hpp
50 lines (39 loc) · 1.52 KB
/
utils.hpp
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
42
43
44
45
46
47
48
49
50
//#pragma once
#include <cstdlib>
#include <set>
#include <string>
#include <cstring>
// Prototype of the coreclr_initialize function from the libcoreclr.so
typedef int (coreclrInitializeFunction)(
const char* exePath,
const char* appDomainFriendlyName,
int propertyCount,
const char** propertyKeys,
const char** propertyValues,
void** hostHandle,
unsigned int* domainId);
// Prototype of the coreclr_shutdown function from the libcoreclr.so
typedef int (coreclrShutdownFunction)(
void* hostHandle,
unsigned int domainId);
// Prototype of the coreclr_execute_assembly function from the libcoreclr.so
typedef int (coreclrCreateDelegateFunction)(
void* hostHandle,
unsigned int domainId,
const char* entryPointAssemblyName,
const char* entryPointTypeName,
const char* entryPointMethodName,
void** delegate);
//#if not defined ( __GNUC__ ) || __GNUC__ < 5 || ( __GNUC__ == 5 && __GNUC_MINOR__ < 3 )
// #error THIS SOFTWARE CURRENTLY BUILDS ONLY ON GCC 5.3 OR NEWER!
//#endif
#include <experimental/filesystem>
namespace SCCH_fs = std::experimental::filesystem;
void AddFilesFromDirectoryToTpaList( std::string directory, std::string& tpaList ) {
for ( auto& dirent : SCCH_fs::directory_iterator(directory) ) {
std::string path = dirent.path();
if ( ! path.compare(path.length() - 4, 4, ".dll") ) {
tpaList.append(path + ":");
}
}
}