summaryrefslogtreecommitdiff
path: root/registry/workben
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-06-02 16:12:08 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-06-02 16:48:34 -0500
commitacb7bd175abe6c7f793cc673feaab46c90b9a260 (patch)
tree206be73ecd4a2af07310e8efe348f9647382d331 /registry/workben
parentd29d9399d48f85989cc8040f5ba334c38b40a544 (diff)
targeted string re-work
Change-Id: I145731d9f28faf0065f5960f2c5a32f27d8c8620
Diffstat (limited to 'registry/workben')
-rw-r--r--registry/workben/regspeed.cxx20
-rw-r--r--registry/workben/regtest.cxx64
2 files changed, 42 insertions, 42 deletions
diff --git a/registry/workben/regspeed.cxx b/registry/workben/regspeed.cxx
index b6c3f42f29d4..51d39bbba72a 100644
--- a/registry/workben/regspeed.cxx
+++ b/registry/workben/regspeed.cxx
@@ -108,9 +108,9 @@ int _cdecl main( int argc, char * argv[] )
{
RegHandle hReg;
RegKeyHandle hRootKey, hKey, hSubKey, hSubSubKey;
- OUString sName1(RTL_CONSTASCII_USTRINGPARAM("regkey"));
- OUString sName2(RTL_CONSTASCII_USTRINGPARAM("regSubkey"));
- OUString sName3(RTL_CONSTASCII_USTRINGPARAM("regSubSubkey"));
+ OUString sName1("regkey");
+ OUString sName2("regSubkey");
+ OUString sName3("regSubSubkey");
OUString keyName1;
OUString keyName2;
OUString keyName3;
@@ -129,7 +129,7 @@ int _cdecl main( int argc, char * argv[] )
S2 = atoi(argv[2]);
S3 = atoi(argv[3]);
- OUString speedReg( RTL_CONSTASCII_USTRINGPARAM("speed.reg"));
+ OUString speedReg( "speed.reg");
if (reg_createRegistry(speedReg.pData, &hReg))
{
cout << "creating registry \"test.reg\" failed\n";
@@ -189,7 +189,7 @@ int _cdecl main( int argc, char * argv[] )
for (sal_Int32 i=0; i < S1; i++)
{
- keyName1 = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName1 = OUString("/");
keyName1 += sName1;
keyName1 += OUString().valueOf(i);
if (reg_openKey(hRootKey, keyName1.pData, &hKey))
@@ -198,10 +198,10 @@ int _cdecl main( int argc, char * argv[] )
for (sal_Int32 j=0; j < S2; j++)
{
- keyName2 = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName2 = OUString("/");
keyName2 += sName1;
keyName2 += OUString().valueOf(i);
- keyName2 += OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName2 += OUString("/");
keyName2 += sName2;
keyName2 += OUString().valueOf(j);
if (reg_openKey(hRootKey, keyName2.pData, &hSubKey))
@@ -210,13 +210,13 @@ int _cdecl main( int argc, char * argv[] )
for (sal_Int32 n=0; n < S3; n++)
{
- keyName3 = OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName3 = OUString("/");
keyName3 += sName1;
keyName3 += OUString().valueOf(i);
- keyName3 += OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName3 += OUString("/");
keyName3 += sName2;
keyName3 += OUString().valueOf(j);
- keyName3 += OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ keyName3 += OUString("/");
keyName3 += sName3;
keyName3 += OUString().valueOf(n);
if (reg_openKey(hRootKey, keyName3.pData, &hSubSubKey))
diff --git a/registry/workben/regtest.cxx b/registry/workben/regtest.cxx
index 4307992c2e4d..7c8a393b3733 100644
--- a/registry/workben/regtest.cxx
+++ b/registry/workben/regtest.cxx
@@ -50,7 +50,7 @@ int _cdecl main()
cout << "\n Simple Registry Test !!! \n\n";
- if (reg_createRegistry(OUString(RTL_CONSTASCII_USTRINGPARAM("test4.rdb")).pData, &hReg))
+ if (reg_createRegistry(OUString("test4.rdb").pData, &hReg))
cout << "\t0. creating registry \"test4.rdb\" failed\n";
else
cout << "0. registry test4.rdb is created\n";
@@ -60,23 +60,23 @@ int _cdecl main()
else
cout << "1. root key of \"test4.rdb\" is opened\n";
- if (reg_createKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myFirstKey")).pData, &hKey1))
+ if (reg_createKey(hRootKey, OUString("myFirstKey").pData, &hKey1))
cout << "\t2. creating key \"myFirstKey\" failed\n";
else
cout << "2. key \"myFirstKey\" is created\n";
- if (reg_createKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondKey")).pData, &hKey2))
+ if (reg_createKey(hRootKey, OUString("mySecondKey").pData, &hKey2))
cout << "\t3. creating key \"mySecondKey\" failed\n";
else
cout << "3. key \"mySecondKey\" is created\n";
- if (reg_createKey(hKey1, OUString(RTL_CONSTASCII_USTRINGPARAM("myFirstSubKey")).pData, &hKey3))
+ if (reg_createKey(hKey1, OUString("myFirstSubKey").pData, &hKey3))
cout << "\t4. creating subkey \"myFirstSubKey\" failed\n";
else
cout << "4. subkey \"myFirstSubKey\" is created\n";
- if (reg_createKey(hKey1, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondSubKey")).pData, &hKey4))
+ if (reg_createKey(hKey1, OUString("mySecondSubKey").pData, &hKey4))
cout << "\t5. creating subkey \"mySecondSubKey\" failed\n";
else
cout << "5. subkey \"mySecondSubKey\" is created\n";
- if (reg_createKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myThirdKey")).pData, &hKey5))
+ if (reg_createKey(hRootKey, OUString("myThirdKey").pData, &hKey5))
cout << "\t6. creating key \"myThirdKey\" is created\n\n";
else
cout << "6. key \"myThirdKey\" is created\n\n";
@@ -84,7 +84,7 @@ int _cdecl main()
RegKeyHandle* phSubKeys;
sal_uInt32 nSubKeys;
- if (reg_openSubKeys(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myFirstKey")).pData, &phSubKeys, &nSubKeys))
+ if (reg_openSubKeys(hRootKey, OUString("myFirstKey").pData, &phSubKeys, &nSubKeys))
cout << "\t7. open subkeys of \"myfirstKey\" failed\n";
else
cout << "7. open " << nSubKeys << "subkeys of \"myfirstKey\"\n";
@@ -102,7 +102,7 @@ int _cdecl main()
char* Value=(char*)"Mein erster Value";
- if (reg_setValue(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondKey")).pData, RG_VALUETYPE_STRING, Value, 18))
+ if (reg_setValue(hRootKey, OUString("mySecondKey").pData, RG_VALUETYPE_STRING, Value, 18))
cout << "\t9. setValue of key \"mySecondKey\" failed\n";
else
cout << "9. setValue (string Value) of key \"mySecondKey\"\n";
@@ -110,7 +110,7 @@ int _cdecl main()
RegValueType valueType;
sal_uInt32 valueSize;
sal_Char* readValue;
- if (reg_getValueInfo(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondKey")).pData, &valueType, &valueSize))
+ if (reg_getValueInfo(hRootKey, OUString("mySecondKey").pData, &valueType, &valueSize))
cout << "\t10. getValueInfo of key \"mySecondKey\" failed\n";
else
cout << "10. getValueInfo of key \"mySecondKey\"\n";
@@ -135,7 +135,7 @@ int _cdecl main()
else
cout << "12. keys \"myFirstKey\" \"myfistSubKey\" \"mySecondSubKey\" are closed\n";
- if (reg_deleteKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myFirstKey")).pData))
+ if (reg_deleteKey(hRootKey, OUString("myFirstKey").pData))
cout << "13.\t delete key \"myFirstKey\" failed\n";
else
cout << "13. key \"myFirstKey\" is deleted\n";
@@ -145,7 +145,7 @@ int _cdecl main()
else
cout << "14. key \"mySecondKey\" is closed\n";
- if (reg_openKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondKey")).pData, &hKey2))
+ if (reg_openKey(hRootKey, OUString("mySecondKey").pData, &hKey2))
cout << "\n15. open key \"mySecondKey\" failed\n";
else
cout << "15. key \"mySecondKey\" is opended\n";
@@ -154,12 +154,12 @@ int _cdecl main()
cout << "\t15. closing key \"myThirdSubKey\" failed\n";
else
cout << "15. key \"myThirdSubKey\" is closed\n";
- if (reg_deleteKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myThirdKey")).pData))
+ if (reg_deleteKey(hRootKey, OUString("myThirdKey").pData))
cout << "\t16. delete key \"myThirdKey\" failed\n";
else
cout << "16. key \"myThirdKey\" is deleted\n";
- if (reg_openKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("myThirdKey")).pData, &hKey5))
+ if (reg_openKey(hRootKey, OUString("myThirdKey").pData, &hKey5))
cout << "\t17. open key \"myThirdKey\" failed\n";
else
cout << "17. key \"myThirdKey\" is opened\n";
@@ -187,7 +187,7 @@ int _cdecl main()
RegHandle hReg2;
RegKeyHandle hRootKey2, h2Key1, h2Key2, h2Key3, h2Key4, h2Key5;
- if (reg_createRegistry(OUString(RTL_CONSTASCII_USTRINGPARAM("test5.rdb")).pData, &hReg2))
+ if (reg_createRegistry(OUString("test5.rdb").pData, &hReg2))
cout << "\t21. creating registry \"test5.rdb\" failed\n";
else
cout << "21. registry \"test5.rdb\" is created\n";
@@ -197,23 +197,23 @@ int _cdecl main()
else
cout << "22. root key of \"test5.rdb\" is opened\n";
- if (reg_createKey(hRootKey2, OUString(RTL_CONSTASCII_USTRINGPARAM("reg2FirstKey")).pData, &h2Key1))
+ if (reg_createKey(hRootKey2, OUString("reg2FirstKey").pData, &h2Key1))
cout << "\t23. creating key \"reg2FirstKey\" failed\n";
else
cout << "23. key \"reg2FirstKey\" is created\n";
- if (reg_createKey(hRootKey2, OUString(RTL_CONSTASCII_USTRINGPARAM("reg2SecondKey")).pData, &h2Key2))
+ if (reg_createKey(hRootKey2, OUString("reg2SecondKey").pData, &h2Key2))
cout << "\t24. creating key \"reg2SecondKey\" failed\n";
else
cout << "24. key \"reg2SecondKey\" is created\n";
- if (reg_createKey(h2Key1, OUString(RTL_CONSTASCII_USTRINGPARAM("reg2FirstSubKey")).pData, &h2Key3))
+ if (reg_createKey(h2Key1, OUString("reg2FirstSubKey").pData, &h2Key3))
cout << "\t25. creating key \"reg2FirstSubKey\" failed\n";
else
cout << "25. key \"reg2FirstSubKey\" is created\n";
- if (reg_createKey(h2Key1, OUString(RTL_CONSTASCII_USTRINGPARAM("reg2SecondSubKey")).pData, &h2Key4))
+ if (reg_createKey(h2Key1, OUString("reg2SecondSubKey").pData, &h2Key4))
cout << "\26. creating key \"reg2SecondSubKey\" failed\n";
else
cout << "26. key \"reg2SecondSubKey\" is created\n";
- if (reg_createKey(hRootKey2, OUString(RTL_CONSTASCII_USTRINGPARAM("reg2ThirdKey")).pData, &h2Key5))
+ if (reg_createKey(hRootKey2, OUString("reg2ThirdKey").pData, &h2Key5))
cout << "\n27. creating key \"reg2ThirdKey\" failed\n";
else
cout << "27. key \"reg2ThirdKey\" is created\n";
@@ -243,7 +243,7 @@ int _cdecl main()
else
cout << "30. registry test5.rdb is closed\n";
- if (reg_openRegistry(OUString(RTL_CONSTASCII_USTRINGPARAM("test4.rdb")).pData, &hReg, REG_READWRITE))
+ if (reg_openRegistry(OUString("test4.rdb").pData, &hReg, REG_READWRITE))
cout << "\t31. registry test4.rdb is opened\n";
else
cout << "31. registry test4.rdb is opened\n";
@@ -253,34 +253,34 @@ int _cdecl main()
else
cout << "32. root key of \"test4.rdb\" is opened\n";
- if (reg_loadKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("allFromTest2")).pData,
- OUString(RTL_CONSTASCII_USTRINGPARAM("test5.rdb")).pData))
+ if (reg_loadKey(hRootKey, OUString("allFromTest2").pData,
+ OUString("test5.rdb").pData))
cout << "\n\t33. load all keys from \"test5.rdb\" under key \"allFromTest2\" failed\n";
else
cout << "\n33. load all keys from test5.rdb under key \"allFromTest2\"\n";
- if (reg_saveKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("allFromTest2")).pData,
- OUString(RTL_CONSTASCII_USTRINGPARAM("test6.rdb")).pData))
+ if (reg_saveKey(hRootKey, OUString("allFromTest2").pData,
+ OUString("test6.rdb").pData))
cout << "\n\t34. save all keys under \"allFromTest2\" in test6.rdb\n";
else
cout << "\n34. save all keys under \"allFromTest2\" in test6.rdb\n";
- if (reg_createKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("allFromTest3")).pData, &hKey1))
+ if (reg_createKey(hRootKey, OUString("allFromTest3").pData, &hKey1))
cout << "\t35. creating key \"allFromTest3\" failed\n";
else
cout << "36. key \"allFromTest3\" is created\n";
- if (reg_createKey(hKey1, OUString(RTL_CONSTASCII_USTRINGPARAM("myFirstKey2")).pData, &hKey2))
+ if (reg_createKey(hKey1, OUString("myFirstKey2").pData, &hKey2))
cout << "\t37. creating key \"myFirstKey2\" failed\n";
else
cout << "37. key \"myFirstKey2\" is created\n";
- if (reg_createKey(hKey1, OUString(RTL_CONSTASCII_USTRINGPARAM("mySecondKey2")).pData, &hKey3))
+ if (reg_createKey(hKey1, OUString("mySecondKey2").pData, &hKey3))
cout << "\t38. creating key \"mySecondKey2\" failed\n";
else
cout << "38. key \"mySecondKey2\" is created\n";
- if (reg_mergeKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("allFromTest3")).pData,
- OUString(RTL_CONSTASCII_USTRINGPARAM("test6.rdb")).pData, sal_False, sal_False))
+ if (reg_mergeKey(hRootKey, OUString("allFromTest3").pData,
+ OUString("test6.rdb").pData, sal_False, sal_False))
cout << "\n\t39. merge all keys under \"allFromTest2\" with all in test6.rdb\n";
else
cout << "\n39. merge all keys under \"allFromTest2\" with all in test6.rdb\n";
@@ -299,18 +299,18 @@ int _cdecl main()
cout << "\n42. closing key \"mySecondKey2\" of \"test5.rdb\"\n";
- if (reg_deleteKey(hRootKey, OUString(RTL_CONSTASCII_USTRINGPARAM("/allFromTest3/reg2FirstKey/reg2FirstSubKey")).pData))
+ if (reg_deleteKey(hRootKey, OUString("/allFromTest3/reg2FirstKey/reg2FirstSubKey").pData))
cout << "\n\t43. delete key \"/allFromTest3/reg2FirstKey/reg2FirstSubKey\" failed\n";
else
cout << "\n43. key \"/allFromTest3/reg2FirstKey/reg2FirstSubKey\" is deleted\n";
- if (reg_openRegistry(OUString(RTL_CONSTASCII_USTRINGPARAM("test4.rdb")).pData, &hReg2, REG_READONLY))
+ if (reg_openRegistry(OUString("test4.rdb").pData, &hReg2, REG_READONLY))
cout << "\n\t44. registry test4.rdb is opened for read only\n";
else
cout << "\n44. registry test4.rdb is opened for read only\n";
RegHandle hReg3;
- if (reg_openRegistry(OUString(RTL_CONSTASCII_USTRINGPARAM("test4.rdb")).pData, &hReg3, REG_READONLY))
+ if (reg_openRegistry(OUString("test4.rdb").pData, &hReg3, REG_READONLY))
cout << "\n\t44.a). registry test4.rdb is opened for read only\n";
else
cout << "\n44.a). registry test4.rdb is opened for read only\n";