MCPcopy Create free account
hub / github.com/Tencent/MMKV / pyArgsToConfig

Function pyArgsToConfig

Python/libmmkv_python.cpp:35–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33namespace py = pybind11;
34
35static MMKVConfig pyArgsToConfig(MMKVMode mode, const string &cryptKey, const MMKVPath_t &rootDir,
36 size_t expectedCapacity, bool aes256, std::optional<bool> enableKeyExpire,
37 uint32_t expiredInSeconds, bool enableCompareBeforeSet,
38 std::optional<MMKVRecoverStrategic> recover, uint32_t itemSizeLimit) {
39 MMKVConfig config;
40 config.mode = mode;
41 config.aes256 = aes256;
42 config.cryptKey = (cryptKey.length() > 0) ? (string *) &cryptKey : nullptr;
43 config.rootPath = (rootDir.length() > 0) ? (MMKVPath_t *) &rootDir : nullptr;
44 config.expectedCapacity = expectedCapacity;
45 config.enableKeyExpire = enableKeyExpire;
46 config.expiredInSeconds = expiredInSeconds;
47 config.enableCompareBeforeSet = enableCompareBeforeSet;
48 config.recover = recover;
49 config.itemSizeLimit = itemSizeLimit;
50 return config;
51}
52
53static MMBuffer pyBytes2MMBuffer(const py::bytes &bytes) {
54 char *buffer = nullptr;

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected