Added request am29544 (nvault_touch)
This commit is contained in:
@ -8,6 +8,12 @@
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
/**
|
||||
* :TODO: This beast calls strcpy()/new() way too much by creating new strings on the stack.
|
||||
* That's easily remedied and it should be fixed?
|
||||
* ---bail
|
||||
*/
|
||||
|
||||
template <>
|
||||
int HashFunction<String>(const String & k)
|
||||
{
|
||||
@ -284,6 +290,18 @@ size_t NVault::Prune(time_t start, time_t end)
|
||||
return m_Hash.Prune(start, end);
|
||||
}
|
||||
|
||||
void NVault::Touch(const char *key, time_t stamp)
|
||||
{
|
||||
String sKey(key);
|
||||
|
||||
if (!m_Hash.Exists(sKey))
|
||||
{
|
||||
SetValue(key, "", time(NULL));
|
||||
}
|
||||
|
||||
m_Hash.Touch(key, stamp);
|
||||
}
|
||||
|
||||
bool NVault::GetValue(const char *key, time_t &stamp, char buffer[], size_t len)
|
||||
{
|
||||
String sKey(key);
|
||||
|
Reference in New Issue
Block a user