mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-12 20:01:25 +01:00
submodule update
This commit is contained in:
parent
a4b05fc229
commit
2ca31fe44c
3 changed files with 23 additions and 8 deletions
|
@ -2,9 +2,7 @@ package com.vectron.fcl;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
// import com.vectron.forthcalc.domain.ports.FileStore;
|
|
||||||
import com.vectron.fcl.types.Obj;
|
import com.vectron.fcl.types.Obj;
|
||||||
import com.vectron.fcl.FclTypeAdapter;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -77,8 +75,6 @@ public class FclStack {
|
||||||
Collections.reverse(stack);
|
Collections.reverse(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
public void load(FileStore fileStore, String id) {
|
public void load(FileStore fileStore, String id) {
|
||||||
FileInputStream stream = null;
|
FileInputStream stream = null;
|
||||||
try {
|
try {
|
||||||
|
@ -107,5 +103,4 @@ public class FclStack {
|
||||||
private String fileName(String id) {
|
private String fileName(String id) {
|
||||||
return String.format("stack%s.json", id);
|
return String.format("stack%s.json", id);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
23
src/main/java/com/vectron/fcl/FileStore.java
Normal file
23
src/main/java/com/vectron/fcl/FileStore.java
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
package com.vectron.fcl;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface FileStore {
|
||||||
|
void save(byte[] raw, String fileName);
|
||||||
|
|
||||||
|
List<String> list();
|
||||||
|
|
||||||
|
List<String> list(Predicate<String> p);
|
||||||
|
|
||||||
|
String read(String fileName);
|
||||||
|
|
||||||
|
FileInputStream open(String fileName) throws FileNotFoundException;
|
||||||
|
|
||||||
|
boolean delete(String fileName);
|
||||||
|
|
||||||
|
interface Predicate<T> {
|
||||||
|
boolean isTrue(T v);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,5 @@
|
||||||
package com.vectron.fcl;
|
package com.vectron.fcl;
|
||||||
|
|
||||||
import com.vectron.fcl.Fcl;
|
|
||||||
import com.vectron.fcl.FclStack;
|
|
||||||
import com.vectron.fcl.RamTranscript;
|
|
||||||
import com.vectron.fcl.exceptions.Aborted;
|
import com.vectron.fcl.exceptions.Aborted;
|
||||||
import com.vectron.fcl.exceptions.NotUnderstood;
|
import com.vectron.fcl.exceptions.NotUnderstood;
|
||||||
import com.vectron.fcl.exceptions.TypeMismatched;
|
import com.vectron.fcl.exceptions.TypeMismatched;
|
||||||
|
|
Loading…
Reference in a new issue