x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
environment.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\test\utils\runtime\env\environment.hpp
Girar
Efecto
Propiedad
Historial
// (C) Copyright Gennadiy Rozental 2005-2007. // Distributed under 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 and implements inline model of program environment // *************************************************************************** #ifndef BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER #define BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER // Boost.Runtime.Parameter #include
#include
#include
#include
#include
#include
#include
// Boost.Test #include
// Boost #include
namespace boost { namespace BOOST_RT_PARAM_NAMESPACE { // ************************************************************************** // // ************** runtime::environment implementation ************** // // ************************************************************************** // namespace environment { namespace rt_env_detail { template
variable_data& init_new_var( cstring var_name, Modifiers m = nfp::no_params ) { rt_env_detail::variable_data& new_vd = new_var_record( var_name ); cstring str_value = sys_read_var( new_vd.m_var_name ); if( !str_value.is_empty() ) { try { boost::optional
value; if( m.has( interpreter ) ) m[interpreter]( str_value, value ); else interpret_argument_value( str_value, value, 0 ); if( !!value ) { new_vd.m_value.reset( new typed_argument
( new_vd ) ); arg_value
( *new_vd.m_value ) = *value; } } catch( ... ) { // !! could we do that // !! should we report an error? } } if( !new_vd.m_value && m.has( default_value ) ) { new_vd.m_value.reset( new typed_argument
( new_vd ) ); nfp::optionally_assign( arg_value
( *new_vd.m_value ), m[default_value] ); } nfp::optionally_assign( new_vd.m_global_id, m, global_id ); return new_vd; } //____________________________________________________________________________// } // namespace rt_env_detail } // namespace environment // ************************************************************************** // // ************** runtime::environment ************** // // ************************************************************************** // namespace environment { // variable access variable_base var( cstring var_name ); //________________________________________________________________________// template
inline variable
var( cstring var_name ) { rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name ); return environment::variable
( !vd ? rt_env_detail::init_new_var
( var_name, nfp::no_params ) : *vd ); } //________________________________________________________________________// template
inline variable
var( cstring var_name, Modifiers const& m ) { rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name ); return environment::variable
( !vd ? rt_env_detail::init_new_var
( var_name, m ) : *vd ); } //________________________________________________________________________// // direct variable value access inline cstring get( cstring var_name ) { return environment::var
( var_name ).value(); } //________________________________________________________________________// template
inline T const& get( cstring var_name ) { return environment::var
( var_name ).value(); } //________________________________________________________________________// template
inline void get( cstring var_name, boost::optional
& res ) { variable
const& v = environment::var
( var_name ); v.value( res ); } //________________________________________________________________________// } // namespace environment namespace env = environment; } // namespace BOOST_RT_PARAM_NAMESPACE } // namespace boost #ifndef BOOST_RT_PARAM_OFFLINE #define BOOST_RT_PARAM_INLINE inline #include
#endif #endif // BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
environment.hpp
Dirección de la página
Dirección del archivo
Anterior
2/6
Siguiente
Descargar
( 4 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.