Beispiel #1
0
void Tpresets::listRegKeys(strings &l)
{
    l.clear();

    HKEY hKey;
    char_t rkey[MAX_PATH];
    tsnprintf_s(rkey, countof(rkey), _TRUNCATE, FFDSHOW_REG_PARENT _l("\\%s"), reg_child);
    RegOpenKeyEx(HKEY_CURRENT_USER,rkey,0,KEY_READ,&hKey);
    for (int i=0,retCode=ERROR_SUCCESS; retCode==ERROR_SUCCESS; i++) {
        char_t keyName[256];
        DWORD keyNameSize=255;
        FILETIME ftLastWriteTime;
        retCode = RegEnumKeyEx(hKey,
                               i,
                               keyName,
                               &keyNameSize,
                               NULL,
                               NULL,
                               NULL,
                               &ftLastWriteTime
                              );
        if (retCode==ERROR_SUCCESS) {
            l.push_back(ffstring(keyName));
        } else {
            break;
        }
    }
    RegCloseKey(hKey);
}
Beispiel #2
0
 const strings
 split (strings&           se,
        const std::string& s,
        char               delimiter,
        bool               strip_quotes,
        bool               strip_whitespace,
        bool               empty)
 {
   std::stringstream ss(s);
   std::string       e;
   se.clear ();
   while (std::getline (ss, e, delimiter))
   {
     if (strip_whitespace)
       e = trim (e);
     if (strip_quotes)
       e = dequote (e);
     if (empty || !e.empty ())
     {
       se.push_back (e);
     }
   }
   return se;
 }