-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmodels_dev_paths.hpp
More file actions
21 lines (17 loc) · 943 Bytes
/
Copy pathmodels_dev_paths.hpp
File metadata and controls
21 lines (17 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include <optional>
#include <string>
namespace acecode {
// Locate the bundled models.dev seed directory containing api.json / MANIFEST.json /
// LICENSE. Search order matches the spec: ACECODE_MODELS_DEV_DIR env var first,
// then the portable <executable_dir>/share/acecode/models_dev layout, then the
// macOS app bundle <executable_dir>/../Resources/share/acecode/models_dev layout,
// then the installed <executable_dir>/../share/acecode/models_dev layout, then
// /usr/share/acecode/models_dev. Returns nullopt when none of the candidates point
// at an existing directory (caller should log a single WARN and continue).
//
// argv0_dir lets unit tests inject a synthetic install layout. Production callers
// pass the runtime executable directory; pass an empty string to skip the
// install-relative candidate.
std::optional<std::string> find_models_dev_dir(const std::string& argv0_dir = "");
} // namespace acecode