⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winterconfig.cpp

📁 atmel usb 无线网卡驱动程序
💻 CPP
字号:
/* WinterConfig.cpp *//*******************************************************************************************	Copyright 2002-2003 ATMEL Corporation.	This file is part of ATMEL Wireless LAN Drivers.	ATMEL Wireless LAN Drivers is free software; you can redistribute it and/or modify	it under the terms of the GNU General Public License as published by	the Free Software Foundation; either version 2 of the License, or	(at your option) any later version.	ATMEL Wireless LAN Drivers 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 General Public License for more details.	You should have received a copy of the GNU General Public License	along with ATMEL Wireless LAN Drivers; if not, write to the Free Software	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*******************************************************************************************/#include "WinterConfig.h"#include <wx/filename.h>#include <wx/config.h>#include <wx/fileconf.h>// CWinterConfig class implementation//====================================CWinterConfig::CWinterConfig( ){	mLanguage = wxT( "" );	mStartupProfile = wxT( "" );}CWinterConfig::~CWinterConfig( ){}wxString CWinterConfig::GetLangName( ){	return mLanguage;}int CWinterConfig::GetLangCode( ){}wxString CWinterConfig::GetStartupProfile( ){	return mStartupProfile;}void CWinterConfig::SetStartupProfile( const wxString &startup_profile ){	mStartupProfile = startup_profile;	return;}void CWinterConfig::SetLangName( const wxString &language ){	mLanguage = language;	return;}bool CWinterConfig::Load( const wxString &str_filename ){	wxFileName filename;	// If no filename is specified, use the default.	if( str_filename == wxT( "" ) )	{		filename.Assign( wxGetHomeDir( ) + wxT( "/.winter/" ), wxT( "winterrc" ) );		if( wxFileName::DirExists( wxGetHomeDir( ) + wxT( "/.winter/" ) ) == false )		{			wxFileName::Mkdir( wxGetHomeDir( ) + wxT( "/.winter/" ), 0700 );		}	}	else	{		filename = str_filename;	}	wxConfigBase *config = new wxFileConfig( wxT( "" ), wxT( "" ), filename.GetFullPath( ), filename.GetFullPath( ) );	config->Read( wxT( "Language" ), &mLanguage, wxT( "" ) );	config->Read( wxT( "StartupProfile" ), &mStartupProfile, wxT( "" ) );	delete config;	return true;}bool CWinterConfig::Save( const wxString &str_filename ){	wxFileName filename;	// If no filename is specified, use the default.	if( str_filename == wxT( "" ) )	{		filename.Assign( wxGetHomeDir( ) + wxT( "/.winter/" ), wxT( "winterrc" ) );		if( wxFileName::DirExists( wxGetHomeDir( ) + wxT( "/.winter/" ) ) == false )		{			wxFileName::Mkdir( wxGetHomeDir( ) + wxT( "/.winter/" ), 0700 );		}	}	else	{		filename = str_filename;	}	::wxRemoveFile( filename.GetFullPath( ) );	wxConfigBase *config = new wxFileConfig( wxT( "" ), wxT( "" ), filename.GetFullPath( ), filename.GetFullPath( ) );	config->Write( wxT( "Language" ), mLanguage );	config->Write( wxT( "StartupProfile" ), mStartupProfile );	config->Flush( );	delete config;	return true;}// CWinterConfigSingleton class implementation//=============================================CWinterConfig *CWinterConfigSingleton::mConfig = NULL;CWinterConfigSingleton::CWinterConfigSingleton( ){}CWinterConfigSingleton::~CWinterConfigSingleton( ){}CWinterConfig *CWinterConfigSingleton::Get( ){	if( mConfig == NULL )	{		mConfig = new CWinterConfig( );	}	return mConfig;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -