From 991b574427c9b9acd26de12066caf6620c3144ab Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Thu, 4 Dec 2003 06:00:26 +0000 Subject: [PATCH] Added canCompile metod to all FileEntry objects. --- .../applecommander/storage/DosFileEntry.java | 7 +++++++ .../webcodepro/applecommander/storage/FileEntry.java | 10 ++++++++++ .../applecommander/storage/PascalFileEntry.java | 7 +++++++ .../applecommander/storage/ProdosFileEntry.java | 9 ++++++++- .../applecommander/storage/RdosFileEntry.java | 11 ++++++++++- 5 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/com/webcodepro/applecommander/storage/DosFileEntry.java b/src/com/webcodepro/applecommander/storage/DosFileEntry.java index a73e958..51686bd 100644 --- a/src/com/webcodepro/applecommander/storage/DosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/DosFileEntry.java @@ -449,4 +449,11 @@ public class DosFileEntry implements FileEntry { public void setAddress(int address) { // FIXME - need to implement } + + /** + * Indicates that this filetype can be compiled. + */ + public boolean canCompile() { + return isApplesoftBasicFile(); + } } diff --git a/src/com/webcodepro/applecommander/storage/FileEntry.java b/src/com/webcodepro/applecommander/storage/FileEntry.java index 174ba58..5e75653 100644 --- a/src/com/webcodepro/applecommander/storage/FileEntry.java +++ b/src/com/webcodepro/applecommander/storage/FileEntry.java @@ -130,4 +130,14 @@ public interface FileEntry { * Set the address that this file loads at. */ public abstract void setAddress(int address); + + /** + * Indicates that this filetype can be compiled. + * Compile is a somewhat arbitrary term, as the code may be + * assembled. + * NOTE: The current assumption is that the filetype is + * AppleSoft. This should be updated to include Integer BASIC, + * assembly, and potentially other languages. + */ + public abstract boolean canCompile(); } diff --git a/src/com/webcodepro/applecommander/storage/PascalFileEntry.java b/src/com/webcodepro/applecommander/storage/PascalFileEntry.java index efea1d7..0451306 100644 --- a/src/com/webcodepro/applecommander/storage/PascalFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/PascalFileEntry.java @@ -268,4 +268,11 @@ public class PascalFileEntry implements FileEntry { public void setAddress(int address) { // Does not apply. } + + /** + * Indicates that this filetype can be compiled. + */ + public boolean canCompile() { + return false; + } } diff --git a/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java b/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java index f4dd06d..8a2cc6d 100644 --- a/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java @@ -1,6 +1,6 @@ /* * AppleCommander - An Apple ][ image utility. - * Copyright (C) 2002 by Robert Greene + * Copyright (C) 2002-3 by Robert Greene * robgreene at users.sourceforge.net * * This program is free software; you can redistribute it and/or modify it @@ -486,4 +486,11 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry { setAuxiliaryType(fileEntry, address); writeFileEntry(fileEntry); } + + /** + * Indicates that this filetype can be compiled. + */ + public boolean canCompile() { + return getDisk().canCompile(getFiletype()); + } } diff --git a/src/com/webcodepro/applecommander/storage/RdosFileEntry.java b/src/com/webcodepro/applecommander/storage/RdosFileEntry.java index c27cebb..a67dc92 100644 --- a/src/com/webcodepro/applecommander/storage/RdosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/RdosFileEntry.java @@ -1,6 +1,6 @@ /* * AppleCommander - An Apple ][ image utility. - * Copyright (C) 2002 by Robert Greene + * Copyright (C) 2002-3 by Robert Greene * robgreene at users.sourceforge.net * * This program is free software; you can redistribute it and/or modify it @@ -307,4 +307,13 @@ public class RdosFileEntry implements FileEntry { public void setAddress(int address) { // FIXME - need to implement } + + /** + * Indicates that this filetype can be compiled. + * WARNING: RDOS programs most likely will not have the + * DOS routines handled by the compiler. + */ + public boolean canCompile() { + return isApplesoftBasicFile(); + } }