as2js: as2js::rc_t Class Reference

#include <rc.h>

Collaboration diagram for as2js::rc_t:
Public Member Functions  rc_t ()  Initialize the resources with defaults. More...
  String const & get_db () const   String const & get_scripts () const   String const & get_temporary_variable_name () const   void init_rc (bool const accept_if_missing)  Find the resource file. More...
  void reset ()  Reset the resources to internal defaults. More...
  Static Public Member Functions static String const & get_home ()   Private Attributes String f_db = String()   String f_scripts = String()   String f_temporary_variable_name = String()   Detailed Description

Definition at line 44 of file rc.h.

Constructor & Destructor Documentation
as2js::rc_t::rc_t ( )

The constructor calls the reset() function to initialize the variable resource parameters to internal defaults.

Definition at line 76 of file rc.cpp.

References reset().

Member Function Documentation
String const & as2js::rc_t::get_db ( ) const

Definition at line 228 of file rc.cpp.

References f_db.

Referenced by as2js::Compiler::internal_imports().

String const & as2js::rc_t::get_home ( ) static
String const & as2js::rc_t::get_scripts ( ) const

Definition at line 222 of file rc.cpp.

References f_scripts.

Referenced by as2js::Compiler::load_internal_packages(), and as2js::Compiler::load_module().

String const & as2js::rc_t::get_temporary_variable_name ( ) const

Definition at line 234 of file rc.cpp.

References f_temporary_variable_name.

void as2js::rc_t::init_rc ( bool const  accept_if_missing)

This function tries to find a resource file.

The resource file defines two paths where we can find the system definitions and user imports.

Parameters
[in]accept_if_missingWhether an error is generated (false) if the file cannot be found.

Definition at line 117 of file rc.cpp.

References as2js::AS_ERR_INSTALLATION, as2js::AS_ERR_UNEXPECTED_RC, f_db, f_scripts, f_temporary_variable_name, as2js::String::from_utf8(), as2js::anonymous_namespace{rc.cpp}::g_rc_directories, get_home(), as2js::JSON::JSONValue::JSON_TYPE_NULL, as2js::JSON::JSONValue::JSON_TYPE_OBJECT, as2js::JSON::JSONValue::JSON_TYPE_STRING, as2js::MESSAGE_LEVEL_FATAL, and reset().

Referenced by as2js::Compiler::internal_imports().

void as2js::rc_t::reset ( )

This function resets all the rc_t variables to internal defaults:

  • scripts – "as2js/scripts"
  • db – "/tmp/as2js_packages.db"
  • temporary_variable_name – "@temp"

This function is called on construction and when calling init_rc().

Note that does not reset the home parameter which has no internal default and is managed differently.

Definition at line 98 of file rc.cpp.

References f_db, f_scripts, and f_temporary_variable_name.

Referenced by init_rc(), and rc_t().

Member Data Documentation
String as2js::rc_t::f_db = String() private

Definition at line 60 of file rc.h.

Referenced by get_db(), init_rc(), and reset().

String as2js::rc_t::f_scripts = String() private

Definition at line 59 of file rc.h.

Referenced by get_scripts(), init_rc(), and reset().

String as2js::rc_t::f_temporary_variable_name = String() private

Definition at line 61 of file rc.h.

Referenced by get_temporary_variable_name(), init_rc(), and reset().


The documentation for this class was generated from the following files:
  • /home/snapwebsites/snapcpp/contrib/as2js/lib/rc.h
  • /home/snapwebsites/snapcpp/contrib/as2js/lib/rc.cpp

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly