Permalink
Browse files

working on linux, should work on mac, no way it's going to work on wi…

…ndows
  • Loading branch information...
0 parents commit 0296dbf5bef6471f47f890fe33864152fbc94d4c @arturoc committed Nov 30, 2009
Showing with 3,283 additions and 0 deletions.
  1. +2,556 −0 .cproject
  2. +3 −0 .gitignore
  3. +82 −0 .project
  4. +21 −0 example/main.cpp
  5. +97 −0 example/testApp.cpp
  6. +30 −0 example/testApp.h
  7. +282 −0 src/ofxDir.cpp
  8. +52 −0 src/ofxDir.h
  9. +116 −0 src/ofxFile.cpp
  10. +44 −0 src/ofxFile.h
2,556 .cproject

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,3 @@
+Debug*/
+Release*/
+bin/
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ofxFileSystem</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/ofAddons/Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+ <value>clean</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+ <value>all</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,21 @@
+#include "ofMain.h"
+#include "testApp.h"
+
+
+
+
+ int main()
+ {
+ // this kicks off the running of my app
+ // can be OF_WINDOW or OF_FULLSCREEN
+ // pass in width and height too:
+ ofSetupOpenGL(320,200, OF_WINDOW); // <-------- setup the GL context
+
+ // this is my "app" :
+ testApp *APP = new testApp;;
+
+ ofRunApp(APP);
+
+ }
+
+
@@ -0,0 +1,97 @@
+#include "testApp.h"
+
+
+//--------------------------------------------------------------
+void testApp::setup(){
+ cout << "testing file copy" << endl;
+ file.openReadOnly("folder1/prueba.txt");
+ file.copyTo("folder2/copia.txt");
+ cout << endl;
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing file name and path" << endl;
+ cout << file.getName() << " - path: " << file.getPath() << endl;
+ cout << endl;
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing text file content" << endl;
+ cout << file.getTextContent()<< endl;
+ file.close();
+ cout << endl;
+
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing binary content" << endl;
+ file.openReadOnly("folder1/ofw-logo.gif");
+ vector<char> image = file.getContent();
+ cout << "size of read file: " << image.size() << endl;
+ file.close();
+ cout << endl;
+
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing dir listing" << endl;
+ dir.open("folder1");
+ cout << "directories:" << endl;
+ for(int i=0; i<dir.getNumDirs(); i++){
+ cout << dir.getDirName(i) << endl;
+ }
+ cout << endl;
+ cout << "files:" << endl;
+ for(int i=0; i<dir.getNumFiles(); i++){
+ cout << dir.getFileName(i) << endl;
+ }
+ cout << endl;
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing dir copy" << endl;
+ dir.copyTo("folder3");
+ dir.copyTo("folder4");
+ dir.close();
+
+ cout << "----------------------------------------------" << endl;
+ cout << "testing dir removing" << endl;
+ dir.open("folder4");
+ dir.remove();
+}
+
+//--------------------------------------------------------------
+void testApp::update(){
+
+}
+
+//--------------------------------------------------------------
+void testApp::draw(){
+
+
+}
+
+
+//--------------------------------------------------------------
+void testApp::keyPressed(int key){
+
+
+}
+
+//--------------------------------------------------------------
+void testApp::keyReleased(int key){
+
+}
+
+//--------------------------------------------------------------
+void testApp::mouseMoved(int x, int y ){
+}
+
+//--------------------------------------------------------------
+void testApp::mouseDragged(int x, int y, int button){
+}
+
+//--------------------------------------------------------------
+void testApp::mousePressed(int x, int y, int button){
+}
+
+//--------------------------------------------------------------
+void testApp::mouseReleased(){
+}
+
+
@@ -0,0 +1,30 @@
+#ifndef _TEST_APP
+#define _TEST_APP
+
+#include "ofMain.h"
+
+#include "ofxFile.h"
+#include "ofxDir.h"
+
+class testApp : public ofBaseApp{
+
+ public:
+
+ void setup();
+ void update();
+ void draw();
+
+ void keyPressed(int key);
+ void keyReleased(int key);
+ void mouseMoved(int x, int y );
+ void mouseDragged(int x, int y, int button);
+ void mousePressed(int x, int y, int button);
+ void mouseReleased();
+
+
+ ofxFile file;
+ ofxDir dir;
+};
+
+#endif
+
Oops, something went wrong.

0 comments on commit 0296dbf

Please sign in to comment.