📄 datafarm_configure.cpp.svn-base
字号:
/* Copy Left/Right : OTHER ,Amfproject * * * * This program 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; version 2 of the License. * * * * This program 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 this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA* **************************************************************************** * Project: kdddatafarm * Programmer: lucy * Created On: Jan 24, 2009 ****************************************************************************//*-- Compiler Controls -----------------------------------------------------*//*-- Includes --------------------------------------------------------------*/#include <datafarm/datafarm_configure.hpp>#include <kdd/xmlutil.hpp>#include <iostream>#include <xercesc/sax2/Attributes.hpp>#include <boost/lexical_cast.hpp>/*-- Namespace Controller --------------------------------------------------*/namespace kdd{/*-- External function prototypes ------------------------------------------*//*-- Local function prototypes ---------------------------------------------*//*--------------------------------------------------------------------------*/void datafarm_configure_handler::startDocument(){ std::cout << "starting datafarm configure..." << std::endl;}void datafarm_configure_handler::endDocument(){ std::cout << "end datafarm configure..." << std::endl;}void datafarm_configure_handler::startElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, const Attributes& attrs){ text.clear();}void datafarm_configure_handler::endElement(const XMLCh * const uri, const XMLCh * const localname, const XMLCh * const qname){ static const xstring key_datafarm("datafarm"); static const xstring key_server("server"); static const xstring key_database("database"); static const xstring key_user("user"); static const xstring key_pass("pass"); static const xstring key_poolsize("poolsize"); if (!XMLString::compareString(localname, key_datafarm)) { return ; } else if (!XMLString::compareString(localname, key_server)) { conf.server=text.toNative(); } else if (!XMLString::compareString(localname, key_database)) { conf.database=text.toNative(); } else if (!XMLString::compareString(localname, key_user)) { conf.user=text.toNative(); } else if (!XMLString::compareString(localname, key_pass)) { conf.pass=text.toNative(); } else if (!XMLString::compareString(localname, key_poolsize)) { conf.PoolSize=boost::lexical_cast<size_t,std::string>(text.toNative()); } std::cout << text.toNative() << std::endl;}void datafarm_configure_handler::characters(const XMLCh* const chars, const unsigned int length){ text.append(chars, length);}/*-- Namespace Ender -------------------------------------------------------*/}/*--------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -