Skip to content
Snippets Groups Projects
c-config-parser.h 670 B
Newer Older
  • Learn to ignore specific revisions
  • #pragma once
    
    /* class [configParser] static C++ wrapper for C interface */
    
    #ifdef __cplusplus
    extern "C" {  
    #endif  
    
        /* main run call */
        int config_run(const char* filename);
    
        /* check calls */
        int config_is_varname(const char* name);
    
        /* get calls */
        int config_get_int(const char* name, int* value);
        int config_get_float(const char* name, float* value);
        int config_get_double(const char* name, double* value);
    
        int config_get_string_len(const char* name);
        /*    --- unsafe call: assumes 'c_str' is allocated to [len] elements */
        int config_get_string_unsafe(const char* name, char* c_str);
    
    #ifdef __cplusplus
    }
    #endif