https://github.com/nariakiiwatani/ofxWatchFile
automatically reload a file if it is modified
https://github.com/nariakiiwatani/ofxWatchFile
Last synced: 4 months ago
JSON representation
automatically reload a file if it is modified
- Host: GitHub
- URL: https://github.com/nariakiiwatani/ofxWatchFile
- Owner: nariakiiwatani
- License: mit
- Created: 2015-04-22T03:31:26.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T01:20:43.000Z (9 months ago)
- Last Synced: 2024-08-01T13:25:18.214Z (7 months ago)
- Language: C++
- Size: 110 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Attention
I prefer using [ofxWatcher](https://github.com/nariakiiwatani/ofxWatcher) now because it's more flexible and straightforward.
Please check it out!---
# ofxWatchFile
auto reload any file when it is modified
inspired by [ofxAutoReloadedShader](https://github.com/andreasmuller/ofxAutoReloadedShader)## usage
See example. Shortly, see below.There are 2 ways to receive the result,
- event listeners
```
ofxWatchFile file;
file.addListener(this, &MyClass::onFileChanged);
// MyClass::onFileChanged is called when the target file is changed
```- derived class
```
class MyClass : public ofxWatchFile {
bool reload(ofFile &file) override;
};
// MyClass::reload is called when the target file is changed
```## License
MIT License.