/**
 *
 * @author    seagle
 * @date      2025-3-21
 * @Description 
 *   Replace old SC
 */  
#include"TcPch.h"
#pragma hdrstop
#include"public.h"
#include"debug.h"
const char* CSC::getStringValue(const char* name,const char* defaultValue){
    char  *find =  (char *)stringConfig.get(name);
    if (find == NULL) {
        if (defaultValue == NULL) {
            return NULL;
        }
        static char buffer[MAX_NAME_LEN];
        strcpy(buffer, defaultValue);
        stringConfig.set(name, buffer,__FILE__,__LINE__);
        return (char*)stringConfig.get(name);
    }
    return find;
}
PMCBOOL CSC::getBoolValue(const char* name,PMCBOOL defaultValue){
    PMCBOOL* find = boolConfig.get(name);
    if (find == NULL) {
        return defaultValue;
    }
    return *find;
}
void CSC::setStringValue(const char* name, const char* value) {
    static char buffer[MAX_NAME_LEN];
    strcpy(buffer, value);
    stringConfig.set(name, buffer,__FILE__,__LINE__);
}
void CSC::setBoolValue(const char * name,PMCBOOL value){
    boolConfig.set(name,value,__FILE__,__LINE__);
} 
CSC *SC;
