39 #ifndef _PLT_MEDIA_CACHE_H_ 40 #define _PLT_MEDIA_CACHE_H_ 54 template <
typename T,
typename U>
64 NPT_Result Put(
const char* root,
const char* key, T& value,
U* tag = NULL);
65 NPT_Result Get(
const char* root,
const char* key, T& value,
U* tag = NULL);
66 NPT_Result Clear(
const char* root,
const char* key);
67 NPT_Result Clear(
const char* root = NULL);
71 NPT_String GenerateKey(
const char* root,
const char* key);
83 template <
typename T,
typename U>
98 template <
typename T,
typename U>
109 if (fullkey.GetLength() == 0)
return NPT_ERROR_INVALID_PARAMETERS;
111 m_Items.Erase(fullkey);
112 NPT_CHECK(m_Items.Put(fullkey, value));
114 if (tag) NPT_CHECK(m_Tags.Put(fullkey, *tag));
122 template <
typename T,
typename U>
133 if (fullkey.GetLength() == 0)
return NPT_ERROR_INVALID_PARAMETERS;
136 NPT_CHECK(m_Items.Get(fullkey, _value));
140 m_Tags.Get(fullkey, _tag);
141 if (_tag) *tag = *_tag;
151 template <
typename T,
typename U>
159 if (fullkey.GetLength() == 0)
return NPT_ERROR_INVALID_PARAMETERS;
165 if ((*entry)->GetKey() == (fullkey)) {
166 m_Items.Erase(fullkey);
167 m_Tags.Erase(fullkey);
172 return NPT_ERROR_NO_SUCH_ITEM;
178 template <
typename T,
typename U>
185 if (!root || root[0]==
'\0')
186 return m_Items.Clear();
194 if (entry_key.StartsWith(key)) {
195 m_Items.Erase(entry_key);
196 m_Tags.Erase(entry_key);
Definition: NptThreads.h:76
Definition: NptThreads.h:93
#define U(j)
uj for division
Definition: bigint.c:73
Definition: NptStrings.h:57