]> git.saurik.com Git - wxWidgets.git/commitdiff
s/NB:/@note; revised wxFFile
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 30 Mar 2008 23:34:30 +0000 (23:34 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 30 Mar 2008 23:34:30 +0000 (23:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/artprov.h
interface/ffile.h
interface/grid.h
interface/mimetype.h
interface/xml/xml.h

index a54889c17d84598217cfec529b10c63f5872c2aa..e6e13df2656fc448c0cd58f5270abff3c35c593a 100644 (file)
@@ -47,7 +47,7 @@
     wxArtProvider::GetIcon.
 
     @todo IS THIS NB TRUE?
     wxArtProvider::GetIcon.
 
     @todo IS THIS NB TRUE?
-    (NB: this is not yet really possible as of wxWidgets 2.3.3, the set of wxArtProvider
+    (@note this is not yet really possible as of wxWidgets 2.3.3, the set of wxArtProvider
      bitmaps is too small).
 
     @section wxartprovider_identify Identifying art resources
      bitmaps is too small).
 
     @section wxartprovider_identify Identifying art resources
index 4f97fa6aea8e95173d35cbbfaa2bafe49539d52b..da0722860e5371e75733794adcd108c6ee5479ff 100644 (file)
@@ -6,15 +6,43 @@
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+
+
+/**
+    Values used for both wxFile and wxFFile.
+
+    @todo make the value names uppercase
+*/
+enum wxSeekMode
+{
+  wxFromStart,
+  wxFromCurrent,
+  wxFromEnd
+};
+
+/**
+    See wxFFile::GetKind().
+*/
+enum wxFileKind
+{
+  wxFILE_KIND_UNKNOWN,
+  wxFILE_KIND_DISK,     /**< A file supporting seeking to arbitrary offsets. */
+  wxFILE_KIND_TERMINAL, /**< A terminal. */
+  wxFILE_KIND_PIPE      /**< A pipe. */
+};
+
+
 /**
     @class wxFFile
     @wxheader{ffile.h}
 
 /**
     @class wxFFile
     @wxheader{ffile.h}
 
-    wxFFile implements buffered file I/O. This is a very small class designed to
-    minimize the overhead of using it - in fact, there is hardly any overhead at
-    all, but using it brings you automatic error checking and hides differences
-    between platforms and compilers. It wraps inside it a @c FILE * handle used
-    by standard C IO library (also known as @c stdio).
+    wxFFile implements buffered file I/O.
+
+    This is a very small class designed to minimize the overhead of using it - in fact,
+    there is hardly any overhead at all, but using it brings you automatic error checking
+    and hides differences between platforms and compilers.
+
+    It wraps inside it a @c FILE * handle used by standard C IO library (also known as @c stdio).
 
     @library{wxbase}
     @category{file}
 
     @library{wxbase}
     @category{file}
 class wxFFile
 {
 public:
 class wxFFile
 {
 public:
-    //@{
+    wxFFile();
+
     /**
         Opens a file with the given file pointer, which has already been opened.
 
     /**
         Opens a file with the given file pointer, which has already been opened.
 
+        @param fp
+            An existing file descriptor, such as stderr.
+    */
+    wxFFile(FILE* fp);
+
+    /**
+        Opens a file with the given mode.
+        As there is no way to return whether the operation was successful or not from
+        the constructor you should test the return value of IsOpened() to check that it
+        didn't fail.
+
         @param filename
             The filename.
         @param mode
         @param filename
             The filename.
         @param mode
@@ -35,24 +75,21 @@ public:
             Note that you should use "b" flag if you use binary files under Windows
             or the results might be unexpected due to automatic newline conversion done
             for the text files.
             Note that you should use "b" flag if you use binary files under Windows
             or the results might be unexpected due to automatic newline conversion done
             for the text files.
-        @param fp
-            An existing file descriptor, such as stderr.
     */
     */
-    wxFFile();
     wxFFile(const wxString& filename, const wxString& mode = "r");
     wxFFile(const wxString& filename, const wxString& mode = "r");
-    wxFFile(FILE* fp);
-    //@}
+
 
     /**
         Destructor will close the file.
 
     /**
         Destructor will close the file.
-        NB: it is not virtual so you should @e not derive from wxFFile!
+
+        @note it is not virtual so you should @e not derive from wxFFile!
     */
     ~wxFFile();
 
     /**
         Attaches an existing file pointer to the wxFFile object.
     */
     ~wxFFile();
 
     /**
         Attaches an existing file pointer to the wxFFile object.
-        The descriptor should be already opened and it will be closed by wxFFile
-        object.
+
+        The descriptor should be already opened and it will be closed by wxFFile object.
     */
     void Attach(FILE* fp);
 
     */
     void Attach(FILE* fp);
 
@@ -63,21 +100,24 @@ public:
 
     /**
         Get back a file pointer from wxFFile object -- the caller is responsible for
 
     /**
         Get back a file pointer from wxFFile object -- the caller is responsible for
-        closing the file if this
-        descriptor is opened. IsOpened() will return @false after call to Detach().
+        closing the file if this descriptor is opened.
+
+        IsOpened() will return @false after call to Detach().
     */
     void Detach();
 
     /**
         Returns @true if the an attempt has been made to read @e past
         the end of the file.
     */
     void Detach();
 
     /**
         Returns @true if the an attempt has been made to read @e past
         the end of the file.
-        Note that the behaviour of the file descriptor based class
-        wxFile is different as wxFile::Eof
-        will return @true here as soon as the last byte of the file has been
-        read.
+
+        Note that the behaviour of the file descriptor based class  wxFile is different as
+        wxFile::Eof() will return @true here as soon as the last byte of the file has been read.
+
         Also note that this method may only be called for opened files and may crash if
         the file is not opened.
 
         Also note that this method may only be called for opened files and may crash if
         the file is not opened.
 
+        @todo THIS METHOD MAY CRASH? DOESN'T SOUND GOOD
+
         @see IsOpened()
     */
     bool Eof() const;
         @see IsOpened()
     */
     bool Eof() const;
@@ -85,12 +125,15 @@ public:
     /**
         Returns @true if an error has occurred on this file, similar to the standard
         @c ferror() function.
     /**
         Returns @true if an error has occurred on this file, similar to the standard
         @c ferror() function.
+
         Please note that this method may only be called for opened files and may crash
         if the file is not opened.
 
         Please note that this method may only be called for opened files and may crash
         if the file is not opened.
 
+        @todo THIS METHOD MAY CRASH? DOESN'T SOUND GOOD
+
         @see IsOpened()
     */
         @see IsOpened()
     */
-
+    bool Error() const;
 
     /**
         Flushes the file and returns @true on success.
 
     /**
         Flushes the file and returns @true on success.
@@ -98,14 +141,16 @@ public:
     bool Flush();
 
     /**
     bool Flush();
 
     /**
-        Returns the type of the file. Possible return values are:
+        Returns the type of the file.
+
+        @see wxFileKind
     */
     wxFileKind GetKind() const;
 
     /**
     */
     wxFileKind GetKind() const;
 
     /**
-        Returns @true if the file is opened. Most of the methods of this class may
-        only
-        be used for an opened file.
+        Returns @true if the file is opened.
+
+        Most of the methods of this class may only be used for an opened file.
     */
     bool IsOpened() const;
 
     */
     bool IsOpened() const;
 
@@ -125,8 +170,7 @@ public:
     bool Open(const wxString& filename, const wxString& mode = "r");
 
     /**
     bool Open(const wxString& filename, const wxString& mode = "r");
 
     /**
-        Reads the specified number of bytes into a buffer, returning the actual number
-        read.
+        Reads the specified number of bytes into a buffer, returning the actual number read.
 
         @param buffer
             A buffer to receive the data.
 
         @param buffer
             A buffer to receive the data.
@@ -138,7 +182,6 @@ public:
     size_t Read(void* buffer, size_t count);
 
     /**
     size_t Read(void* buffer, size_t count);
 
     /**
-        )
         Reads the entire contents of the file into a string.
 
         @param str
         Reads the entire contents of the file into a string.
 
         @param str
@@ -149,7 +192,7 @@ public:
 
         @returns @true if file was read successfully, @false otherwise.
     */
 
         @returns @true if file was read successfully, @false otherwise.
     */
-    bool ReadAll(wxString* str);
+    bool ReadAll(wxString* str, const wxMBConv& conv = wxConvAuto());
 
     /**
         Seeks to the specified position and returns @true on success.
 
     /**
         Seeks to the specified position and returns @true on success.
@@ -163,8 +206,7 @@ public:
 
     /**
         Moves the file pointer to the specified number of bytes before the end of the
 
     /**
         Moves the file pointer to the specified number of bytes before the end of the
-        file
-        and returns @true on success.
+        file and returns @true on success.
 
         @param ofs
             Number of bytes before the end of the file.
 
         @param ofs
             Number of bytes before the end of the file.
@@ -177,12 +219,24 @@ public:
     wxFileOffset Tell() const;
 
     /**
     wxFileOffset Tell() const;
 
     /**
-        )
         Writes the contents of the string to the file, returns @true on success.
         Writes the contents of the string to the file, returns @true on success.
+
         The second argument is only meaningful in Unicode build of wxWidgets when
         The second argument is only meaningful in Unicode build of wxWidgets when
-        @e conv is used to convert @a s to multibyte representation.
+        @a conv is used to convert @a str to multibyte representation.
+    */
+    bool Write(const wxString& str, const wxMBConv& conv = wxConvAuto());
+
+    /**
+        Writes the specified number of bytes from a buffer.
+
+        @param buffer
+            A buffer containing the data.
+        @param count
+            The number of bytes to write.
+
+        @returns The number of bytes written.
     */
     */
-    bool Write(const wxString& s);
+    size_t Write(const void* buffer, size_t count);
 
     /**
         Returns the file pointer associated with the file.
 
     /**
         Returns the file pointer associated with the file.
index b4d63210e0c7e5770e3152884ee2c0b00bfe91c5..9d1eeb0ebc151d242ffd95da581696f5b8870ace 100644 (file)
@@ -1960,7 +1960,7 @@ public:
     void InitColWidths();
 
     /**
     void InitColWidths();
 
     /**
-        NB: @e never access m_row/col arrays directly because they are created
+        @note @e never access m_row/col arrays directly because they are created
         on demand, @e always use accessor functions instead!
         Init the m_rowHeights/Bottoms arrays with default values.
     */
         on demand, @e always use accessor functions instead!
         Init the m_rowHeights/Bottoms arrays with default values.
     */
index 8e64ad271977338be351a78cf904826a181eed1f..3e753b05f0cf9b526c8ddb0ba8579c68af23eb0c 100644 (file)
@@ -32,7 +32,7 @@
     If GNOME or KDE desktop environment is installed, then wxMimeTypesManager
     gathers MIME information from respective files (e.g. .kdelnk files under KDE).
 
     If GNOME or KDE desktop environment is installed, then wxMimeTypesManager
     gathers MIME information from respective files (e.g. .kdelnk files under KDE).
 
-    NB: Currently, wxMimeTypesManager is limited to reading MIME type information
+    @note Currently, wxMimeTypesManager is limited to reading MIME type information
     but it will support modifying it as well in future versions.
 
     @library{wxbase}
     but it will support modifying it as well in future versions.
 
     @library{wxbase}
@@ -63,7 +63,7 @@ public:
     void AddFallbacks(const wxFileTypeInfo* fallbacks);
 
     /**
     void AddFallbacks(const wxFileTypeInfo* fallbacks);
 
     /**
-        NB: You won't normally need to use more than one wxMimeTypesManager object in a
+        @note You won't normally need to use more than one wxMimeTypesManager object in a
         program.
         @ref ctor() wxMimeTypesManager
 
         program.
         @ref ctor() wxMimeTypesManager
 
index 604daaa0cab2a6b675a427530a3527a96f4ecc5b..bc26ffb32fbbdb4cbc1b0edf43cdc10a311ea53d 100644 (file)
@@ -440,7 +440,7 @@ public:
     /**
         Returns encoding of in-memory representation of the document
         (same as passed to Load() or constructor, defaults to UTF-8).
     /**
         Returns encoding of in-memory representation of the document
         (same as passed to Load() or constructor, defaults to UTF-8).
-        NB: this is meaningless in Unicode build where data are stored as @c wchar_t*.
+        @note this is meaningless in Unicode build where data are stored as @c wchar_t*.
     */
     wxString GetEncoding() const;
 
     */
     wxString GetEncoding() const;