registrytool.cpp revision ed52004f81b8195b81a4db8f1625d4330463ae03
/*
* Inkscape Registry Tool
*
* Authors:
* Bob Jamison
*
* Copyright (C) 2005-2008 Bob Jamison
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <windows.h>
#include <string>
#include <cstdio>
#include "registrytool.h"
typedef struct
{
int strlen;
const char *str;
{
};
{
bool ret = false;
//Trim out the root key if necessary
{
{
}
}
//printf("trimmed string: '%s'\n", keyName.c_str());
//Get or create the key
{
goto fail;
}
// Set the value
{
goto failkey;
}
ret = true;
fail:
return ret;
}
{
const int pathbuf = 2048;
path = "";
exeName = "";
{
}
return true;
}
bool RegistryTool::setPathInfo()
{
return false;
//printf("full:'%s' path:'%s' exe:'%s'\n",
// fullPath.c_str(), path.c_str(), exeName.c_str());
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\";
return false;
//add our subdirectories
valueName = "Path";
return false;
return true;
}
#ifdef TESTREG
/*
* Compile this file with
* g++ -DTESTREG registrytool.cpp -o registrytool
* to run these tests.
*/
void testReg()
{
char *key =
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\inkscape.exe";
char const *name = "";
char const *value = "c:\\inkscape\\inkscape.exe";
{
printf("Test failed\n");
}
else
{
printf("Test succeeded\n");
}
name = "Path";
value = "c:\\inkscape\\python";
{
printf("Test failed\n");
}
else
{
printf("Test succeeded\n");
}
}
void testPath()
{
rt.setPathInfo();
}
{
//testReg();
testPath();
return 0;
}
#endif /* TESTREG */
//########################################################################
//# E N D O F F I L E
//########################################################################