MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / UploadFiles

Function UploadFiles

DEVELOPER/core/SimulationInformation.cpp:589–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587//
588
589int
590UploadFiles(const char *cookie, int projID, int expID, int trialID, File *theFile, const char *path, int basePath)
591{
592 int res =0;
593
594 if (theFile == 0)
595 return 0;
596
597
598
599 const char *fileName = theFile->getName();
600
601 if (theFile->isDir() == true) {
602
603 res = neesADD_TrialAnalysisDir(cookie, projID, expID, trialID, &path[basePath], fileName);
604
605 FileIter theDirFiles = theFile->getFiles();
606 File *theDirFile;
607
608 if (res < 0) {
609 opserr << "ERROR: SimulationInformation.cpp - uploadFiles() - failed to add directory: " << fileName
610 << " to path: " << &path[basePath] << endln;
611 return res;
612 }
613
614 while ((theDirFile = theDirFiles()) != 0) {
615 res = UploadFiles(cookie, projID, expID, trialID, theDirFile, theFile->getDescription(), basePath);
616 if (res < 0)
617 return res;
618 }
619
620 } else {
621
622 res = neesADD_TrialAnalysisFile(cookie,
623 projID,
624 expID,
625 trialID,
626 path,
627 basePath,
628 theFile->getName(),
629 theFile->getDescription());
630
631 if (res < 0) {
632 opserr << "ERROR: SimulationInformation.cpp - uploadFiles() - failed to add file: " << fileName
633 << " to path: " << &path[basePath] << endln;
634 return res;
635 }
636 }
637
638 return 0;
639}
640
641#endif
642

Callers 1

neesUploadMethod · 0.85

Calls 4

getNameMethod · 0.45
isDirMethod · 0.45
getFilesMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected