src/rules.cc
/**
 * @name    loadFromUri
 * @brief   load rules from a give uri
 * @ingroup ModSecCore
 *
 * Load the rules from a given uri into memory into memory in
 * the format expected by ModSecurity core.
 *
 * @param uri Full path to the rules file.
 *
 * @return Number of rules loaded, -1 if failed.
 * @retval true  Rules where loaded successfully.
 * @retval false Problem loading the rules.
 *
 */
@name    loadFromUri
@brief   load rules from a give uri
@ingroup ModSecCore

Load the rules from a given uri into memory into memory in
the format expected by ModSecurity core.

@param uri Full path to the rules file.

@return Number of rules loaded, -1 if failed.
@retval true  Rules where loaded successfully.
@retval false Problem loading the rules.
@name loadFromUri @brief load rules from a give uri @ingroup ModSecCore Load the rules from a given uri into memory into memory in the format expected by ModSecurity core . @param uri Full path to the rules file . @return Number of rules loaded - 1 if failed . @retval true Rules where loaded successfully . @retval false Problem loading the rules .
int Rules::loadFromUri(const char *uri) {
    Driver *driver = new Driver();
    if (driver->parseFile(uri) == false) {
        m_parserError << driver->m_parserError.str();
        return -1;
    }
    int rules = this->merge(driver);
    delete driver;
    return rules;
}
int Rules :: loadFromUri ( const char * uri ) { Driver * driver = new Driver ( ) ; if ( driver -> parseFile ( uri ) == false ) { m_parserError << driver -> m_parserError . str ( ) ; return -1 ; } int rules = this -> merge ( driver ) ; delete driver ; return rules ; }
@name    loadFromUri
 @brief   load rules from a give uri
 @ingroup ModSecCore
@name loadFromUri @brief load rules from a give uri @ingroup ModSecCore