File.h

Go to the documentation of this file.
00001 #ifndef JAVA_IO_FILE_H
00002 #define JAVA_IO_FILE_H 1
00003 
00004 #ifndef JAVA_LANG_OBJECT_H
00005 #include <java_lang/Object.h>
00006 #endif /* JAVA_LANG_OBJECT_H */
00007 #ifndef JAVA_IO_FILENAMEFILTER_H
00008 #include <java_io/FilenameFilter.h>
00009 #endif /* JAVA_IO_FILENAMEFILTER_H */
00010 
00011 namespace java {
00012   namespace io {
00013 
00082     class JAVA_IO_SPEC File : virtual public Object, virtual public Comparable {
00083 
00084     public:
00085 
00092       static const jchar separatorChar;
00093 
00099       static const jbyte* separator;
00100 
00109       static const jchar pathSeparatorChar;
00110 
00116       static const jbyte* pathSeparator;
00117 
00122       static const jbyte* lineSeparator;
00123 
00133       File(const String& pathname = nilCString);
00134 
00135       /* Note: The two-argument File constructors do not interpret an empty
00136          parent abstract pathname as the current user directory.  An empty parent
00137          instead causes the child to be resolved against the system-dependent
00138          directory defined by the FileSystem.getDefaultParent method.  On Unix
00139          this default is "/", while on Win32 it is "\\".  This is required for
00140          compatibility with the original behavior of this class. */
00141 
00167       File(const String& parent, const String& child);
00168 
00194       File(const File& parent, const String& child);
00195 
00206       String getName() const;
00207 
00221       String getParent() const;
00222 
00239       File getParentFile() const;
00240 
00248       String getPath() const;
00249 
00260       jboolean isAbsolute() const;
00261 
00285       String getAbsolutePath() const;
00286 
00299       File getAbsoluteFile() const;
00300 
00335       String getCanonicalPath() const;
00336 
00354       File getCanonicalFile() const;
00355 
00369       jboolean canRead() const;
00370 
00385       jboolean canWrite() const;
00386 
00398       jboolean exists() const;
00399 
00413       jboolean isDirectory() const;
00414 
00430       jboolean isFile() const;
00431 
00450       jboolean isHidden() const;
00451 
00466       jlong lastModified() const;
00467 
00480       jlong length() const;
00481 
00506       jboolean createNewFile();
00507 
00521       jboolean remove();
00522 
00541       void removeOnExit();
00542 
00569       Array<String> list(const Ref<FilenameFilter>& filter = 0) const;
00570 
00598       Array<File> listFiles(const Ref<FilenameFilter>& filter = 0) const;
00599 
00611       jboolean mkdir();
00612 
00629       jboolean mkdirs();
00630 
00647       jboolean renameTo(const File& dest);
00648 
00675       jboolean setLastModified(jlong time);
00676 
00694       jboolean setReadOnly();
00695 
00738       static Array<File> listRoots();
00739 
00757       jint compareTo(const File& file) const;
00758 
00782       jint compareTo(const Object& obj) const;
00783 
00798       jboolean equals(const Object& obj) const;
00799 
00811       jint hashCode() const;
00812 
00819       String toString() const;
00820 
00821     private:
00822   
00828       String path;
00829 
00834       String apath;
00835 
00836       REGISTER_MEMBERS;
00837     
00838     };
00839 
00840   } // namespace io
00841 } // namespace java
00842 
00843 #endif /* JAVA_IO_FILE_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3