# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # Open Bit Flags. # # # class FileSystemOpenFlags < Wx::Enum # Open for reading. # FS_READ = Wx::FileSystemOpenFlags.new(1) # Returned stream will be seekable. # FS_SEEKABLE = Wx::FileSystemOpenFlags.new(4) end # FileSystemOpenFlags # This class represents a single file opened by {Wx::FileSystem}. # It provides more information than wxWidgets' input streams (stream, filename, mime type, anchor). # Any pointer returned by a method of {Wx::FSFile} is valid only as long as the {Wx::FSFile} object exists. For example a call to {Wx::FSFile#get_stream} doesn't create the stream but only returns the pointer to it. In other words after 10 calls to {Wx::FSFile#get_stream} you will have obtained ten identical pointers. # # === # # Category: Virtual File System, File Handling # @see Wx::FileSystemHandler # @see Wx::FileSystem # @see wxFileSystem Overview # # class FSFile < Object # Constructor. # You probably won't use it. See the Note for details. # It is seldom used by the application programmer but you will need it if you are writing your own virtual FS. For example you may need something similar to {Wx::MemoryInputStream}, but because {Wx::MemoryInputStream} doesn't free the memory when destroyed and thus passing a memory stream pointer into {Wx::FSFile} constructor would lead to memory leaks, you can write your own class derived from {Wx::FSFile}: # # class wxMyFSFile : public wxFSFile # { # private: # void *m_Mem; # public: # wxMyFSFile(.....) # ~wxMyFSFile() {free(m_Mem);} # // of course dtor is virtual ;-) # }; # # If you are not sure of the meaning of these params, see the description of the GetXXXX() functions. # @param stream [IO] The input stream that will be used to access data # @param location [String] The full location (aka filename) of the file # @param mimetype [String] MIME type of this file. It may be left empty, in which case the type will be determined from file's extension (location must not be empty in this case). # @param anchor [String] Anchor. See {Wx::FSFile#get_anchor} for details. # @param modif [Wx::DateTime] Modification date and time for this file. # @return [FSFile] def initialize(stream, location, mimetype, anchor, modif) end # Detaches the stream from the {Wx::FSFile} object. # That is, the stream obtained with {Wx::FSFile#get_stream} will continue its existence after the {Wx::FSFile} object is deleted. # You will have to delete the stream yourself. # @return [Wx::InputStream] def detach_stream; end # Returns anchor (if present). # The term of anchor can be easily explained using few examples: # index.htm#anchor // 'anchor' is anchor # index/{Wx::001}.htm // NO anchor here! # archive/main.zip#zip:index.htm#global // 'global' # archive/main.zip#zip:index.htm // NO anchor here! # # Usually an anchor is presented only if the MIME type is 'text/html'. But it may have some meaning with other files; for example myanim.avi#200 may refer to position in animation or reality.wrl::MyView may refer to a predefined view in VRML. # @return [Wx::String] def get_anchor; end alias_method :anchor, :get_anchor # Returns full location of the file, including path and protocol. # Examples: http://www.{Wx::widgets}.org # http://www.ms.mff.cuni.cz/~vsla8348/{Wx::html}/archive.zip#zip:info.txt # file:/home/vasek/index.htm # relative-file.htm # @return [Wx::String] def get_location; end alias_method :location, :get_location # Returns the MIME type of the content of this file. # It is either extension-based (see {Wx::MimeTypesManager}) or extracted from HTTP protocol Content-Type header. # @return [Wx::String] def get_mime_type; end alias_method :mime_type, :get_mime_type # Returns time when this file was modified. # @return [Wx::DateTime] def get_modification_time; end alias_method :modification_time, :get_modification_time # Returns pointer to the stream. # You can use the returned stream to directly access data. You may suppose that the stream provide Seek and GetSize functionality (even in the case of the HTTP protocol which doesn't provide this by default. {Wx::HTML} uses local cache to work around this and to speed up the connection). # @return [Wx::InputStream] def get_stream; end alias_method :stream, :get_stream end # FSFile # This class is the base class of most stream related classes in wxWidgets. # It must not be used directly. # === # # Category: {Wx::Streams} # @see Wx::StreamBuffer # # class StreamBase < ::Object # Creates a dummy stream object. # It doesn't do anything. # @return [StreamBase] def initialize; end # This function returns the last error. # @return [Wx::StreamError] def get_last_error; end alias_method :last_error, :get_last_error # Returns the length of the stream in bytes. # If the length cannot be determined (this is always the case for socket streams for example), returns {Wx::InvalidOffset}. # @return [Wx::FileOffset] def get_length; end alias_method :length, :get_length # This function returns the size of the stream. # For example, for a file it is the size of the file. # There are streams which do not have size by definition, such as socket streams. In that cases, {Wx::StreamBase#get_size} returns 0 so you should always test its return value. # @return [Integer] def get_size; end alias_method :size, :get_size # Returns true if no error occurred on the stream. # # @see Wx::StreamBase#get_last_error # @return [true,false] def is_ok; end alias_method :ok?, :is_ok # Returns true if the stream supports seeking to arbitrary offsets. # @return [true,false] def is_seekable; end alias_method :seekable?, :is_seekable # Resets the stream state. # By default, resets the stream to good state, i.e. clears any errors. Since wxWidgets 2.9.3 can be also used to explicitly set the state to the specified error (the error argument didn't exist in the previous versions). # @see Wx::StreamBase#get_last_error # @param error [Wx::StreamError] # @return [void] def reset(error=Wx::STREAM_NO_ERROR) end end # StreamBase # {Wx::InputStream} is an abstract base class which may not be used directly. # It is the base class of all streams which provide a {Wx::InputStream#read} function, i.e. which can be used to read data from a source (e.g. a file, a socket, etc). # If you want to create your own input stream, you'll need to derive from this class and implement the protected {Wx::InputStream#on_sys_read} function only. # === # # Category: {Wx::Streams} # class InputStream < StreamBase # Creates a dummy input stream. # @return [InputStream] def initialize; end # Returns true if some data is available in the stream right now, so that calling {Wx::InputStream#read} wouldn't block. # @return [true,false] def can_read; end alias_method :can_read?, :can_read # Returns true after an attempt has been made to read past the end of the stream. # @return [true,false] def eof; end # Returns the first character in the input queue and removes it, blocking until it appears if necessary. # On success returns a value between 0 - 255; on end of file returns {Wx::EOF}. # @return [Integer] def get_c; end alias_method :c, :get_c # Returns the last number of bytes read. # @return [Integer] def last_read; end # Returns the first character in the input queue without removing it. # @return [Integer] def peek; end # Reads data from the input queue and stores it in the specified output stream. # The data is read until an error is raised by one of the two streams. # This function returns a reference on the current object, so the user can test any states of the stream right away. # @param stream_out [IO,Wx::OutputStream] # @return [Wx::InputStream] def read(stream_out) end # Changes the stream current position. # This operation in general is possible only for seekable streams (see {Wx::StreamBase#is_seekable}); non-seekable streams support only seeking positive amounts in mode {Wx::FromCurrent} (this is implemented by reading data and simply discarding it). # # The new stream position or {Wx::InvalidOffset} on error. # @param pos [Wx::FileOffset] Offset to seek to. # @param mode [Wx::SeekMode] One of {Wx::FromStart}, {Wx::FromEnd}, {Wx::FromCurrent}. # @return [Wx::FileOffset] def seek_i(pos, mode=Wx::FromStart) end # Returns the current stream position or {Wx::InvalidOffset} if it's not available (e.g. # socket streams do not have a size nor a current stream position). # @return [Wx::FileOffset] def tell_i; end # This function acts like the previous one except that it takes only one character: it is sometimes shorter to use than the generic function. # @param c [Integer] # @return [true,false] def ungetch(c) end end # InputStream # {Wx::OutputStream} is an abstract base class which may not be used directly. # It is the base class of all streams which provide a {Wx::OutputStream#write} function, i.e. which can be used to output data (e.g. to a file, to a socket, etc). # If you want to create your own output stream, you'll need to derive from this class and implement the protected {Wx::OutputStream#on_sys_write} function only. # === # # Category: {Wx::Streams} # class OutputStream < StreamBase # Creates a dummy {Wx::OutputStream} object. # @return [OutputStream] def initialize; end # Closes the stream, returning false if an error occurs. # The stream is closed implicitly in the destructor if {Wx::OutputStream#close} is not called explicitly. # If this stream wraps another stream or some other resource such as a file, then the underlying resource is closed too if it is owned by this stream, or left open otherwise. # @return [true,false] def close; end # Returns the number of bytes written during the last {Wx::OutputStream#write}. # It may return 0 even if there is no error on the stream if it is only temporarily impossible to write to it. # @return [Integer] def last_write; end # Puts the specified character in the output queue and increments the stream position. # @param c [Integer] # @return [void] def put_c(c) end # Changes the stream current position. # The new stream position or {Wx::InvalidOffset} on error. # @param pos [Wx::FileOffset] Offset to seek to. # @param mode [Wx::SeekMode] One of {Wx::FromStart}, {Wx::FromEnd}, {Wx::FromCurrent}. # @return [Wx::FileOffset] def seek_o(pos, mode=Wx::FromStart) end # Returns the current stream position. # @return [Wx::FileOffset] def tell_o; end end # OutputStream end