static void setSourceCodeFile(PDUI* uiFuncs, PDUISCInterface* sourceFuncs, SourceCodeData* data, const char* filename, uint32_t line) {
    if (strcmp(filename, data->filename)) {
        size_t size = 0;
        void* fileData = readFileFromDisk(filename, &size);

        printf("reading file to buffer %s\n", filename);

        PDUI_set_title(uiFuncs, filename);

        if (fileData) {
            PDUI_sc_send_command(sourceFuncs, SCI_CLEARALL, 0, 0);
            PDUI_sc_send_command(sourceFuncs, SCI_ADDTEXT, size, (intptr_t)fileData);
        }else {
            printf("Sourcecode_plugin: Unable to load %s\n", filename);
        }

        free(fileData);

        strncpy(data->filename, filename, sizeof(data->filename));
        data->filename[sizeof(data->filename) - 1] = 0;
    }

    PDUI_sc_send_command(sourceFuncs, SCI_GOTOLINE, (uintptr_t)line, 0);

    data->line = (int)line;
}
Exemple #2
0
void ClsFESystemBuilder::readSystemFileFromDisk(string _strSystemFileName) {
#ifdef DEBUG_CLSFESYSTEMBUILDER
    cout << "ClsFESystemBuilder::readSystemFileFromDisk(string _strSystemFileName)" << ENDL;
    cout << "_strSystemFileName: " << _strSystemFileName << ENDL;
#endif
    strSystemFileCont = readFileFromDisk(_strSystemFileName);
};
Exemple #3
0
void ClsFESystemBuilder::importProcess(string _strFileName, bool bEmitSignals, bool bLink){
#ifdef DEBUG_CLSFESYSTEMBUILDER
    cout << "ClsFESystemBuilder::importProcess(string _strFileName)" << endl;
#endif
    string strProcessCont = readFileFromDisk(_strFileName);
    importFragment(strProcessCont, false, bEmitSignals, (bLink ? _strFileName : ""));
    
}