Initial source commit

This commit is contained in:
Tony Bark 2025-10-03 02:19:59 -04:00
commit f1384c11ee
335 changed files with 52715 additions and 0 deletions

View file

@ -0,0 +1,73 @@
/*
* Modification History
*
* 2004-January-4 Jason Rohrer
* Created.
*/
/**
* A test program for the various child file functions in File.h
*
* @author Jason Rohrer.
*/
#include "minorGems/io/file/File.h"
int main( int inNumArgs, char **inArgs ) {
char *fileName = "linux";
if( inNumArgs > 1 ) {
fileName = inArgs[1];
}
File *testFile = new File( NULL, fileName );
int numChildren;
File **childFiles = testFile->getChildFiles( &numChildren );
printf( "child files:\n" );
for( int i=0; i<numChildren; i++ ) {
char *fullName = childFiles[i]->getFullFileName();
printf( " %s\n", fullName );
delete [] fullName;
delete childFiles[i];
}
delete [] childFiles;
childFiles = testFile->getChildFilesRecursive( 10, &numChildren );
printf( "recursive child files:\n" );
for( int i=0; i<numChildren; i++ ) {
char *fullName = childFiles[i]->getFullFileName();
printf( " %s\n", fullName );
delete [] fullName;
delete childFiles[i];
}
delete [] childFiles;
delete testFile;
return 0;
}

View file

@ -0,0 +1,39 @@
/*
* Modification History
*
* 2002-August-1 Jason Rohrer
* Created.
*/
#include "Path.h"
#include <stdio.h>
int main() {
char *pathString = "/test/this/thing";
printf( "using path string = %s\n", pathString );
printf( "Constructing path.\n" );
Path *path = new Path( pathString );
printf( "Extracting path string.\n" );
char *extractedPathString = path->getPathStringTerminated();
printf( "extracted path string = %s\n", extractedPathString );
delete [] extractedPathString;
delete path;
return 1;
}