x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
config_file.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\test\utils\runtime\file\config_file.hpp
旋转
特效
属性
历史版本
// (C) Copyright Gennadiy Rozental 2005-2007. // Use, modification, and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 43798 $ // // Description : defines models configuration file, it's parameter and parameter namespaces // *************************************************************************** #ifndef BOOST_RT_FILE_CONFIG_FILE_HPP_010105GER #define BOOST_RT_FILE_CONFIG_FILE_HPP_010105GER // Boost.Runtime.Parameter #include
#include
// Boost.Test #include
#include
// Boost #include
// STL #include
namespace boost { namespace BOOST_RT_PARAM_NAMESPACE { namespace file { // ************************************************************************** // // ************** runtime::file::parameter ************** // // ************************************************************************** // class param_namespace; class parameter { public: // Constructor parameter( cstring name, cstring value, param_namespace const& parent ); BOOST_READONLY_PROPERTY( dstring, (parameter)) p_name; BOOST_READONLY_PROPERTY( dstring, (parameter)) p_value; friend std::ostream& operator<<( std::ostream& os, parameter const& ); private: // Data members param_namespace const& m_parent; }; // ************************************************************************** // // ************** runtime::file::modifiers ************** // // ************************************************************************** // namespace { nfp::typed_keyword
value_marker; nfp::typed_keyword
value_delimeter; nfp::typed_keyword
namespace_delimeter; } // local namespace // ************************************************************************** // // ************** runtime::file::param_namespace ************** // // ************************************************************************** // class param_namespace { public: typedef std::list
::iterator iterator; typedef std::list
::const_iterator const_iterator; typedef std::list
::iterator sub_ns_iterator; typedef std::list
::const_iterator sub_ns_const_iterator; // Public properties BOOST_READONLY_PROPERTY( dstring, (param_namespace)) p_name; unit_test::readonly_property
p_parent; void load( config_file_iterator cf_it ) { load( cf_it, nfp::no_params ); } template
void load( config_file_iterator cf_it, Modifier const& m ) { cstring vm = m.has( value_marker ) ? m[value_marker] : BOOST_RT_PARAM_CSTRING_LITERAL( "\"" ); cstring vd = m.has( value_delimeter ) ? m[value_delimeter] : BOOST_RT_PARAM_CSTRING_LITERAL( "= \t\n\r" ); cstring nd = m.has( namespace_delimeter ) ? m[namespace_delimeter] : BOOST_RT_PARAM_CSTRING_LITERAL( "::" ); load_impl( cf_it, vm, vd, nd ); } void load( cstring file_name ) { load( file_name, nfp::no_params ); } template
void load( cstring file_name, Modifier const& m ) { config_file_iterator cfi( file_name, m ); load( cfi, m ); } void insert_param( cstring param_name, cstring param_value ); param_namespace& subnamespace( cstring namespace_name ); // find and insert if not present void clear(); iterator begin() { return m_parameters.begin(); } const_iterator begin() const { return m_parameters.begin(); } iterator end() { return m_parameters.end(); } const_iterator end() const { return m_parameters.end(); } sub_ns_iterator sub_ns_begin() { return m_subnamespaces.begin(); } sub_ns_const_iterator sub_ns_begin() const { return m_subnamespaces.begin(); } sub_ns_iterator sub_ns_end() { return m_subnamespaces.end(); } sub_ns_const_iterator sub_ns_end() const { return m_subnamespaces.end(); } void print_full_name( std::ostream& os ) const; protected: explicit param_namespace( cstring name, param_namespace const* parent = 0 ); private: void load_impl( config_file_iterator cf_it, cstring value_marker_, cstring value_delimeter_, cstring namespace_delimeter_ ); // Data members std::list
m_parameters; std::list
m_subnamespaces; }; //____________________________________________________________________________// boost::optional
get_param_value( param_namespace const& where_from, cstring name_part1, cstring name_part2 = cstring(), cstring name_part3 = cstring(), cstring name_part4 = cstring(), cstring name_part5 = cstring() ); //____________________________________________________________________________// cstring get_requ_param_value( param_namespace const& where_from, cstring name_part1, cstring name_part2 = cstring(), cstring name_part3 = cstring(), cstring name_part4 = cstring(), cstring name_part5 = cstring() ); //____________________________________________________________________________// param_namespace const* get_param_subns( param_namespace const& where_from, cstring namespace_name ); //____________________________________________________________________________// // ************************************************************************** // // ************** runtime::file::config_file ************** // // ************************************************************************** // class config_file : public param_namespace { public: // Constructor config_file(); config_file( cstring file_name ); }; } // namespace file } // namespace BOOST_RT_PARAM_NAMESPACE } // namespace boost #endif // BOOST_RT_FILE_CONFIG_FILE_HPP_010105GER
config_file.hpp
网页地址
文件地址
上一页
2/4
下一页
下载
( 7 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.