From 9914559eacd064410da10823f147554e8a43d675 Mon Sep 17 00:00:00 2001 From: Gerald Schmidt Date: Sat, 18 Aug 2007 07:45:22 +0000 Subject: [PATCH] Fixed \r\n line endings in xmlcopyeditor.desktop, removed two unused header files. --- src/dos2unix.h | 9 -- src/wxMemoryMappedFile.h | 170 -------------------------------------- src/xmlcopyeditor.desktop | 22 ++--- 3 files changed, 11 insertions(+), 190 deletions(-) delete mode 100755 src/dos2unix.h delete mode 100755 src/wxMemoryMappedFile.h diff --git a/src/dos2unix.h b/src/dos2unix.h deleted file mode 100755 index c6f6207..0000000 --- a/src/dos2unix.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DOS2UNIX_H -#define DOS2UNIX_H -#include -class Dos2Unix -{ - public: - static void run(std::string& s); -}; -#endif diff --git a/src/wxMemoryMappedFile.h b/src/wxMemoryMappedFile.h deleted file mode 100755 index 8ba0b0b..0000000 --- a/src/wxMemoryMappedFile.h +++ /dev/null @@ -1,170 +0,0 @@ -/** -\class wxMemoryMappedFile -\author Blake Madden (blake.madden@oleandersolutions.com) -\date (C) 2006 -*/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the wxWidgets License. * - * * - ***************************************************************************/ - -/** \example wxMemoryMappedFile - try
- {
- wxMemoryMappedFile fileMap(_T("/home/bmadden/file.txt"), true);
- const char* fileText = (const char*)fileMap.GetStream();

- //now map another file (note that fileText will not be valid after this)
- fileMap.UnmapFile();
- fileMap.MapFile(_T("/home/bmadden/DifferentFile.txt"), false);
- char* writableFileText = (char*)fileMap.GetStream();

- //now write back to the file by simply writing to the pointer
- std::strncpy(writableFileText, "Hello, world!", 13);
- }
- catch(...)
- {
- //handle error here
- } - - \todo Currently only supports files under 2GBs. -*/ - -#ifndef __WXMEMMAPPEDFILE_H__ -#define __WXMEMMAPPEDFILE_H__ - -#define _UNICODE -#define UNICODE - -#ifdef __WXMSW__ - #include -#else - #include - #include - #include -#endif -#include -#include -#include - -///General exception that can be thrown when mapping a file. -class wxMemoryMappedFileException : public std::exception {}; -///Exception that can be thrown when mapping if the file is zero length. -class wxMemoryMappedFileEmptyException : public std::exception {}; -///Exception that can be thrown when mapping if the file can't be exclusively locked. -class wxMemoryMappedFileShareViolationException : public std::exception {}; -///Exception that can be thrown when mapping if the file isn't something that can be mapped. -class wxMemoryMappedInvalidFileType : public std::exception {}; -///Exception that can be thrown when mapping if the size of the file can't be determined. -class wxMemoryMappedInvalidFileSize : public std::exception {}; - -#ifdef __WXMSW__ - typedef HANDLE wxMemoryMappedFileHandleType; -#else - typedef int wxMemoryMappedFileHandleType; -#endif - -/**Class for mapping a file into your address space -(rather than having to buffer its contents)*/ -class wxMemoryMappedFile - { -public: - ///Default Constructor - wxMemoryMappedFile() : - #ifdef __WXMSW__ - m_hFile(INVALID_HANDLE_VALUE), - m_hsection(NULL), - #else - m_hFile(-1), - #endif - m_data(NULL), - m_mapSize(0), - m_open(false), - m_isReadOnly(false) - {} - - /** - \brief Constructor which will automatically map the file. - - \exception wxMemoryMappedInvalidFileSize - \exception wxMemoryMappedFileEmptyException - \exception wxMemoryMappedFileShareViolationException - \exception wxMemoryMappedInvalidFileType - \exception wxMemoryMappedInvalidFileSize - - \param filePath Path to the file to map. - \param readOnly Flag specifying whether to open the file as read only. - */ - wxMemoryMappedFile(const wxString& filePath, bool readOnly = true) : - #ifdef __WXMSW__ - m_hFile(INVALID_HANDLE_VALUE), - m_hsection(NULL), - #else - m_hFile(-1), - #endif - m_data(NULL), - m_mapSize(0), - m_open(false), - m_isReadOnly(readOnly) - { - MapFile(filePath, readOnly); - } - ///Destructor which implicitly unmaps the file - ~wxMemoryMappedFile() - { UnmapFile(); } - ///Indicates whether a file is currently (and successfully) mapped - bool IsOk() const { return m_open; } - ///Indicates whether the current file mapping is read only - bool IsReadOnly() const { return m_isReadOnly; } - /** - \brief Manually maps a new file. - \warning If this object is currently mapping another file then - you need to call UnmapFile() first. - - \exception wxMemoryMappedInvalidFileSize - \exception wxMemoryMappedFileEmptyException - \exception wxMemoryMappedFileShareViolationException - \exception wxMemoryMappedInvalidFileType - \exception wxMemoryMappedInvalidFileSize - - \param filePath Path to the file to map. - \param readOnly Flag specifying whether to open the file as read only. - - \return True if file mapping was successful. - */ - bool MapFile(const wxString& filePath, const bool readOnly = true); - ///Closes the handles and mappings - void UnmapFile(); - /**Returns the raw byte stream of the file - \warning Do not attempt to write to the returned pointer if you mapped the file as read only. - The read only status of the current mapping can be checked by calling IsReadOnly(). - */ - void* GetStream() - { return m_data; } - ///Returns the length of the mapped file - size_t GetMapSize() const - { return m_mapSize; } - ///Returns the path of the file currently mapped - wxString GetFilePath() const - { return m_filePath; } - - ///Returns the size of a large file (as an unsigned long long) - static wxULongLong GetFileSize64(const wxMemoryMappedFileHandleType hFile); - -private: - void Reset(); -#ifdef __WXMSW__ - HANDLE m_hFile; - HANDLE m_hsection; -#else - int m_hFile; -#endif - void* m_data; - size_t m_mapSize; - wxString m_filePath; - bool m_open; - bool m_isReadOnly; - }; - -#endif //__WXMEMMAPPEDFILE_H__ diff --git a/src/xmlcopyeditor.desktop b/src/xmlcopyeditor.desktop index cae7afd..607961e 100755 --- a/src/xmlcopyeditor.desktop +++ b/src/xmlcopyeditor.desktop @@ -1,11 +1,11 @@ -[Desktop Entry] -Type=Application -Encoding=UTF-8 -Name=XML Copy Editor -GenericName=XML Editor -Comment=Edit XML documents -Exec=xmlcopyeditor %U -Icon=xmlcopyeditor.png -Terminal=false -MimeType=text/xml; -Categories=Application;Development;TextEditor; +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=XML Copy Editor +GenericName=XML Editor +Comment=Edit XML documents +Exec=xmlcopyeditor %U +Icon=xmlcopyeditor.png +Terminal=false +MimeType=text/xml; +Categories=Application;Development;TextEditor;