Example #1
0
void wbFile_atExit(void) {
    int ii;

    for (ii = 0; ii < wbFile_maxCount; ii++) {
        if (wbFile_handles[ii] != NULL) {
            wbFile_delete(wbFile_handles[ii]);
        }
    }
}
Example #2
0
static inline void wbImportCSV_setFile(wbImportCSV_t csv, const char * path) {
    if (csv != NULL) {
        if (wbImportCSV_getFile(csv) != NULL) {
            wbFile_delete(wbImportCSV_getFile(csv));
        }
        if (path != NULL) {
            wbImportCSV_getFile(csv) = wbFile_open(path, "r");
        } else {
            wbImportCSV_getFile(csv) = NULL;
        }
    }

    return ;
}
Example #3
0
static inline void wbImportRaw_setFile(wbImportRaw_t raw, const char * path) {
    if (raw != NULL) {
        if (wbImportRaw_getFile(raw) != NULL) {
            wbFile_delete(wbImportRaw_getFile(raw));
        }
        if (path != NULL) {
            wbImportRaw_getFile(raw) = wbFile_open(path, "r");
        } else {
            wbImportRaw_getFile(raw) = NULL;
        }
    }

    return ;
}
Example #4
0
static inline void wbExportRaw_setFile(wbExportRaw_t raw,
                                       const char *path) {
  if (raw != nullptr) {
    if (wbExportRaw_getFile(raw) != nullptr) {
      wbFile_delete(wbExportRaw_getFile(raw));
    }
    if (path != nullptr) {
      wbExportRaw_getFile(raw) = wbFile_open(path, "w+");
    } else {
      wbExportRaw_getFile(raw) = nullptr;
    }
  }

  return;
}
Example #5
0
static inline void wbExportText_setFile(wbExportText_t text,
                                        const char *path) {
  if (text != nullptr) {
    if (wbExportText_getFile(text) != nullptr) {
      wbFile_delete(wbExportText_getFile(text));
    }
    if (path != nullptr) {
      wbExportText_getFile(text) = wbFile_open(path, "w+");
    } else {
      wbExportText_getFile(text) = nullptr;
    }
  }

  return;
}
Example #6
0
static inline void wbExportCSV_setFile(wbExportCSV_t csv,
                                       const char *path) {
  if (csv != nullptr) {
    if (wbExportCSV_getFile(csv) != nullptr) {
      wbFile_delete(wbExportCSV_getFile(csv));
    }
    if (path != nullptr) {
      wbExportCSV_getFile(csv) = wbFile_open(path, "w+");
    } else {
      wbExportCSV_getFile(csv) = nullptr;
    }
  }

  return;
}
Example #7
0
void wbFile_close(wbFile_t file) {
    wbFile_delete(file);
}