Author: wyoung
Date: Thu Mar 29 16:03:43 2007
New Revision: 1477
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1477&view=rev
Log:
Whitespace change
Modified:
trunk/examples/vstudio/mfc/mfc_dlg.cpp
Modified: trunk/examples/vstudio/mfc/mfc_dlg.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/mfc/mfc_dlg.cpp?rev=1477&r1=1476&r2=1477&view=diff
==============================================================================
--- trunk/examples/vstudio/mfc/mfc_dlg.cpp (original)
+++ trunk/examples/vstudio/mfc/mfc_dlg.cpp Thu Mar 29 16:03:43 2007
@@ -89,19 +89,19 @@
}
-//// LoadSetting ///////////////////////////////////////////////////////
-// Loads up the value of the named registry value underneath the given
-// key and returns it in pcValue.
-
-bool
-CExampleDlg::LoadSetting(HKEY key, LPCTSTR pcName, LPTSTR pcValue,
- DWORD nValueSize)
-{
- return RegQueryValueEx(key, pcName, 0, 0, LPBYTE(pcValue),
- &nValueSize) == ERROR_SUCCESS;
-}
-
-
+//// LoadSetting ///////////////////////////////////////////////////////
+// Loads up the value of the named registry value underneath the given
+// key and returns it in pcValue.
+
+bool
+CExampleDlg::LoadSetting(HKEY key, LPCTSTR pcName, LPTSTR pcValue,
+ DWORD nValueSize)
+{
+ return RegQueryValueEx(key, pcName, 0, 0, LPBYTE(pcValue),
+ &nValueSize) == ERROR_SUCCESS;
+}
+
+
//// OnBnClickedConnectButton //////////////////////////////////////////
// This is essentially the same thing as examples/simple1.cpp
@@ -166,100 +166,100 @@
}
-//// OpenSettingsRegistryKey ///////////////////////////////////////////
-
-HKEY
-CExampleDlg::OpenSettingsRegistryKey()
-{
- HKEY key1, key2;
- if ((RegOpenKey(HKEY_CURRENT_USER, _T("Software"), &key1) ==
- ERROR_SUCCESS) && (RegCreateKey(key1,
- _T("MySQL++ Examples"), &key2) == ERROR_SUCCESS)) {
- RegCloseKey(key1);
- return key2;
- }
- else {
- return 0;
- }
-}
-
-
-//// SaveInputs ////////////////////////////////////////////////////////
-// Save the given strings to the registry so future runs and other
-// examples can use them.
-
-bool
-CExampleDlg::SaveInputs(LPCTSTR pcServerAddress, LPCTSTR pcUserName)
-{
- HKEY key = OpenSettingsRegistryKey();
- if (key) {
- SaveSetting(key, _T("user"), pcUserName);
- SaveSetting(key, _T("server"), pcServerAddress);
- RegCloseKey(key);
- return true;
- }
- else {
- return false;
- }
-}
-
-
-//// SaveSetting ///////////////////////////////////////////////////////
-// Saves the given value as a named entry under the given registry key.
-
-bool
-CExampleDlg::SaveSetting(HKEY key, LPCTSTR pcName, LPCTSTR pcValue)
-{
- DWORD nBytes = DWORD(sizeof(TCHAR) * (_tcslen(pcValue) + 1));
- return RegSetValueEx(key, pcName, 0, REG_SZ, LPBYTE(pcValue),
- nBytes) == ERROR_SUCCESS;
-}
-
-
-//// ToUCS2 ////////////////////////////////////////////////////////////
-// Convert a C string in UTF-8 format to UCS-2 format.
-
-bool
-CExampleDlg::ToUCS2(LPTSTR pcOut, int nOutLen, const char* kpcIn)
-{
- if (strlen(kpcIn) > 0) {
- // Do the conversion normally
- return MultiByteToWideChar(CP_UTF8, 0, kpcIn, -1, pcOut,
- nOutLen) > 0;
- }
- else if (nOutLen > 1) {
- // Can't distinguish no bytes copied from an error, so handle
- // an empty input string as a special case.
- _tccpy(pcOut, _T(""));
- return true;
- }
- else {
- // Not enough room to do anything!
- return false;
- }
-}
-
-
-//// ToUTF8 ////////////////////////////////////////////////////////////
-// Convert a UCS-2 multibyte string to the UTF-8 format required by
-// MySQL, and thus MySQL++.
-
-bool
-CExampleDlg::ToUTF8(char* pcOut, int nOutLen, LPCWSTR kpcIn)
-{
- if (_tcslen(kpcIn) > 0) {
- // Do the conversion normally
- return WideCharToMultiByte(CP_UTF8, 0, kpcIn, -1, pcOut,
- nOutLen, 0, 0) > 0;
- }
- else if (nOutLen > 0) {
- // Can't distinguish no bytes copied from an error, so handle
- // an empty input string as a special case.
- *pcOut = '\0';
- return true;
- }
- else {
- // Not enough room to do anything!
- return false;
- }
-}
+//// OpenSettingsRegistryKey ///////////////////////////////////////////
+
+HKEY
+CExampleDlg::OpenSettingsRegistryKey()
+{
+ HKEY key1, key2;
+ if ((RegOpenKey(HKEY_CURRENT_USER, _T("Software"), &key1) ==
+ ERROR_SUCCESS) && (RegCreateKey(key1,
+ _T("MySQL++ Examples"), &key2) == ERROR_SUCCESS)) {
+ RegCloseKey(key1);
+ return key2;
+ }
+ else {
+ return 0;
+ }
+}
+
+
+//// SaveInputs ////////////////////////////////////////////////////////
+// Save the given strings to the registry so future runs and other
+// examples can use them.
+
+bool
+CExampleDlg::SaveInputs(LPCTSTR pcServerAddress, LPCTSTR pcUserName)
+{
+ HKEY key = OpenSettingsRegistryKey();
+ if (key) {
+ SaveSetting(key, _T("user"), pcUserName);
+ SaveSetting(key, _T("server"), pcServerAddress);
+ RegCloseKey(key);
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+
+//// SaveSetting ///////////////////////////////////////////////////////
+// Saves the given value as a named entry under the given registry key.
+
+bool
+CExampleDlg::SaveSetting(HKEY key, LPCTSTR pcName, LPCTSTR pcValue)
+{
+ DWORD nBytes = DWORD(sizeof(TCHAR) * (_tcslen(pcValue) + 1));
+ return RegSetValueEx(key, pcName, 0, REG_SZ, LPBYTE(pcValue),
+ nBytes) == ERROR_SUCCESS;
+}
+
+
+//// ToUCS2 ////////////////////////////////////////////////////////////
+// Convert a C string in UTF-8 format to UCS-2 format.
+
+bool
+CExampleDlg::ToUCS2(LPTSTR pcOut, int nOutLen, const char* kpcIn)
+{
+ if (strlen(kpcIn) > 0) {
+ // Do the conversion normally
+ return MultiByteToWideChar(CP_UTF8, 0, kpcIn, -1, pcOut,
+ nOutLen) > 0;
+ }
+ else if (nOutLen > 1) {
+ // Can't distinguish no bytes copied from an error, so handle
+ // an empty input string as a special case.
+ _tccpy(pcOut, _T(""));
+ return true;
+ }
+ else {
+ // Not enough room to do anything!
+ return false;
+ }
+}
+
+
+//// ToUTF8 ////////////////////////////////////////////////////////////
+// Convert a UCS-2 multibyte string to the UTF-8 format required by
+// MySQL, and thus MySQL++.
+
+bool
+CExampleDlg::ToUTF8(char* pcOut, int nOutLen, LPCWSTR kpcIn)
+{
+ if (_tcslen(kpcIn) > 0) {
+ // Do the conversion normally
+ return WideCharToMultiByte(CP_UTF8, 0, kpcIn, -1, pcOut,
+ nOutLen, 0, 0) > 0;
+ }
+ else if (nOutLen > 0) {
+ // Can't distinguish no bytes copied from an error, so handle
+ // an empty input string as a special case.
+ *pcOut = '\0';
+ return true;
+ }
+ else {
+ // Not enough room to do anything!
+ return false;
+ }
+}
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits