diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:00:17 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:00:17 +0200 |
commit | fd0853d2623dd278b08288331ed42e3be59252fb (patch) | |
tree | a7645daeaef8bdbed064faf4eb88e72cee58726c | |
parent | 2.1 (diff) | |
download | FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.gz FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.tar.bz2 FreeFileSync-fd0853d2623dd278b08288331ed42e3be59252fb.zip |
2.2
239 files changed, 41158 insertions, 4549 deletions
diff --git a/Application.cpp b/Application.cpp index ca09f25a..c6439665 100644 --- a/Application.cpp +++ b/Application.cpp @@ -6,8 +6,7 @@ #include "application.h" #include "ui/mainDialog.h" -#include <wx/stdpaths.h> -#include "library/globalFunctions.h" +#include "shared/globalFunctions.h" #include <wx/msgdlg.h> #include "comparison.h" #include "algorithm.h" @@ -17,9 +16,16 @@ #include "ui/checkVersion.h" #include "library/filter.h" #include <wx/file.h> -#include <wx/filename.h> +#include "shared/xmlBase.h" +#include "library/resources.h" +#include "shared/standardPaths.h" +#include "shared/localization.h" -using FreeFileSync::FileError; +#ifdef FFS_LINUX +#include <gtk/gtk.h> +#endif + +using FreeFileSync::CustomLocale; IMPLEMENT_APP(Application); @@ -44,96 +50,83 @@ void Application::OnStartApplication(wxIdleEvent& event) //if appname is not set, the default is the executable's name! SetAppName(wxT("FreeFileSync")); +#ifdef FFS_LINUX + ::gtk_rc_parse("styles.rc"); //remove inner border from bitmap buttons +#endif + //test if FFS is to be started on UI with config file passed as commandline parameter -//#warning - //this needs to happen BEFORE the working directory is set! + //try to set config/batch-filename set by %1 parameter wxString cfgFilename; if (argc > 1) { - //resolve relative names to avoid problems after working directory is changed - wxFileName filename(argv[1]); - if (!filename.Normalize()) - { - wxMessageBox(wxString(_("Error retrieving full path:")) + wxT("\n\"") + argv[1] + wxT("\"")); - return; - } - const wxString fullFilename = filename.GetFullPath(); - - if (wxFileExists(fullFilename)) //load file specified by %1 parameter: - cfgFilename = fullFilename; - else if (wxFileExists(fullFilename + wxT(".ffs_batch"))) - cfgFilename = fullFilename + wxT(".ffs_batch"); - else if (wxFileExists(fullFilename + wxT(".ffs_gui"))) - cfgFilename = fullFilename + wxT(".ffs_gui"); + const wxString filename(argv[1]); + + if (wxFileExists(filename)) //load file specified by %1 parameter: + cfgFilename = filename; + else if (wxFileExists(filename + wxT(".ffs_batch"))) + cfgFilename = filename + wxT(".ffs_batch"); + else if (wxFileExists(filename + wxT(".ffs_gui"))) + cfgFilename = filename + wxT(".ffs_gui"); else { - wxMessageBox(wxString(_("File does not exist:")) + wxT(" \"") + fullFilename + wxT("\""), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\""), _("Error"), wxOK | wxICON_ERROR); return; } } - - //set working directory to current executable directory - const wxString workingDir = FreeFileSync::getInstallationDir(); - if (!wxSetWorkingDirectory(workingDir)) - { //show messagebox and quit program immediately - wxMessageBox(wxString(_("Could not set working directory:")) + wxT(" ") + workingDir, _("An exception occured!"), wxOK | wxICON_ERROR); - return; - } - GlobalResources::getInstance().load(); //loads bitmap resources on program startup - try //load global settings from XML: must be called AFTER working dir was set + try //load global settings from XML { - globalSettings = xmlAccess::readGlobalSettings(); + xmlAccess::readGlobalSettings(globalSettings); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { if (wxFileExists(FreeFileSync::getGlobalConfigFile())) - { //show messagebox and quit program immediately - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - return; + { //show messagebox and continue + SetExitOnFrameDelete(false); //prevent error messagebox from becoming top-level window + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + SetExitOnFrameDelete(true); } //else: globalSettings already has default values } -//set program language: needs to happen after working directory has been set! + //set program language SetExitOnFrameDelete(false); //prevent error messagebox from becoming top-level window - programLanguage.setLanguage(globalSettings.programLanguage); + CustomLocale::getInstance().setLanguage(globalSettings.programLanguage); SetExitOnFrameDelete(true); if (!cfgFilename.empty()) { //load file specified by %1 parameter: - xmlAccess::XmlType xmlConfigType = xmlAccess::getXmlType(cfgFilename); - if (xmlConfigType == xmlAccess::XML_GUI_CONFIG) //start in GUI mode (configuration file specified) - { - MainDialog* frame = new MainDialog(NULL, cfgFilename, &programLanguage, globalSettings); - frame->SetIcon(*GlobalResources::getInstance().programIcon); //set application icon - frame->Show(); - } - else if (xmlConfigType == xmlAccess::XML_BATCH_CONFIG) //start in commandline mode + const xmlAccess::XmlType xmlConfigType = xmlAccess::getXmlType(cfgFilename); + switch (xmlConfigType) { + case xmlAccess::XML_GUI_CONFIG: //start in GUI mode (configuration file specified) + runGuiMode(cfgFilename, globalSettings); + break; + + case xmlAccess::XML_BATCH_CONFIG: //start in commandline mode runBatchMode(cfgFilename, globalSettings); - if (wxApp::GetTopWindow() == NULL) //if no windows are shown program won't exit automatically + if (wxApp::GetTopWindow() == NULL) //if no windows are shown, program won't exit automatically ExitMainLoop(); - return; - } - else - { + break; + + case xmlAccess::XML_GLOBAL_SETTINGS: + case xmlAccess::XML_REAL_CONFIG: + case xmlAccess::XML_OTHER: wxMessageBox(wxString(_("The file does not contain a valid configuration:")) + wxT(" \"") + cfgFilename + wxT("\""), _("Error"), wxOK | wxICON_ERROR); - return; + break; } } else //start in GUI mode (standard) - { - MainDialog* frame = new MainDialog(NULL, FreeFileSync::getLastConfigFile(), &programLanguage, globalSettings); - frame->SetIcon(*GlobalResources::getInstance().programIcon); //set application icon - frame->Show(); - } + runGuiMode(wxEmptyString, globalSettings); } @@ -158,7 +151,7 @@ int Application::OnRun() wxMessageBox(e.show(), _("An exception occured!"), wxOK | wxICON_ERROR); return -8; } - catch (std::exception& e) //catch all STL exceptions + catch (const std::exception& e) //catch all STL exceptions { //unfortunately it's not always possible to display a message box in this erroneous situation, however (non-stream) file output always works! wxFile safeOutput(FreeFileSync::getLastErrorTxtFile(), wxFile::write); @@ -175,39 +168,47 @@ int Application::OnRun() int Application::OnExit() { //get program language - globalSettings.programLanguage = programLanguage.getLanguage(); + globalSettings.programLanguage = CustomLocale::getInstance().getLanguage(); try //save global settings to XML { xmlAccess::writeGlobalSettings(globalSettings); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); } return 0; } -void Application::runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSettings& globalSettings) +void Application::runGuiMode(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings& settings) +{ + MainDialog* frame = new MainDialog(NULL, cfgFileName, settings); + frame->SetIcon(*GlobalResources::getInstance().programIcon); //set application icon + frame->Show(); +} + + +void Application::runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSettings& globSettings) { //load XML settings xmlAccess::XmlBatchConfig batchCfg; //structure to receive gui settings try { - batchCfg = xmlAccess::readBatchConfig(filename); + xmlAccess::readBatchConfig(filename, batchCfg); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); return; } //all settings have been read successfully... //regular check for program updates if (!batchCfg.silent) - FreeFileSync::checkForUpdatePeriodically(globalSettings.lastUpdateCheck); + FreeFileSync::checkForUpdatePeriodically(globSettings.lastUpdateCheck); try //begin of synchronization process (all in one try-catch block) @@ -226,10 +227,10 @@ void Application::runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSet //COMPARE DIRECTORIES FreeFileSync::FolderComparison folderCmp; - FreeFileSync::CompareProcess comparison(globalSettings.traverseDirectorySymlinks, - globalSettings.fileTimeTolerance, - globalSettings.ignoreOneHourDiff, - globalSettings.warnings, + FreeFileSync::CompareProcess comparison(globSettings.traverseDirectorySymlinks, + globSettings.fileTimeTolerance, + globSettings.ignoreOneHourDiff, + globSettings.warnings, filterInstance.get(), statusHandler.get()); @@ -247,16 +248,19 @@ void Application::runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSet //START SYNCHRONIZATION FreeFileSync::SyncProcess synchronization( - batchCfg.mainCfg.useRecycleBin, - globalSettings.copyFileSymlinks, - globalSettings.traverseDirectorySymlinks, - globalSettings.warnings, + batchCfg.mainCfg.handleDeletion, + batchCfg.mainCfg.customDeletionDirectory, + globSettings.copyFileSymlinks, + globSettings.traverseDirectorySymlinks, + globSettings.warnings, statusHandler.get()); synchronization.startSynchronizationProcess(folderCmp); } catch (FreeFileSync::AbortThisProcess&) //exit used by statusHandler { + if (returnValue >= 0) + returnValue = -12; return; } } diff --git a/Application.h b/Application.h index cf6d6dd4..55d6e02d 100644 --- a/Application.h +++ b/Application.h @@ -9,7 +9,6 @@ #define FREEFILESYNCAPP_H #include <wx/app.h> -#include "library/localization.h" #include "library/processXml.h" @@ -23,12 +22,12 @@ public: void OnStartApplication(wxIdleEvent& event); private: - void runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSettings& globalSettings); + void runGuiMode(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings& settings); + void runBatchMode(const wxString& filename, xmlAccess::XmlGlobalSettings& globSettings); - FreeFileSync::CustomLocale programLanguage; + xmlAccess::XmlGlobalSettings globalSettings; //settings used by GUI, batch mode or both int returnValue; - xmlAccess::XmlGlobalSettings globalSettings; //settings used by GUI, batch mode or both }; #endif // FREEFILESYNCAPP_H diff --git a/BUILD/Changelog.txt b/BUILD/Changelog.txt index 18b836bb..fca7be5b 100644 --- a/BUILD/Changelog.txt +++ b/BUILD/Changelog.txt @@ -1,13 +1,41 @@ -FreeFileSync ------------- +-------------- +|FreeFileSync| +-------------- + +Changelog v2.2 +--------------- +New user-defined recycle bin directory +Possibility to create synchronization directories automatically (if not existing) +Support for relative directory names (e.g. \foo, ..\bar) respecting current working directory +New tooltip in middle grid showing detailed information (including conflicts) +Status feedback and new abort button for manual deletion +Options to add/remove folder pairs in batch dialog +Added tooltip showing progress for silent batchmode +New view filter buttons in synchronization preview +Revisioned handling of symbolic links (Linux/Windows) +GUI optimizations removing flicker +Possibility to create new folders via browse folder dialog +Open files with associated application by special command string +Improved warning/error handling +Auto-adjust columns automatically or manually with CTRL + '+' +New makros for double-click commandline: %name, %dir, %nameCo, %dirCo +Fixed runtime error when multiple folder pairs are used +New tool 'RealtimeSync': Watch directories for changes and start synchronization automatically +Improved XML parsing, fault tolerance and concept revisioned +More detailed statistics before start of synchronization +Removed superfluous border for bitmap buttons (Linux only) +Added Czech translation +Updated translation files + Changelog v2.1 ----------------- +-------------- Fixed bug that could cause FreeFileSync to crash after synchronization +Compiled with MS Visual C++ 2008 using static runtime library Changelog v2.0 ---------------- +-------------- Copy locked files using Windows Volume Shadow Copy Load file icons asynchronously for maximum display performance Handle include filter correctly when comparing diff --git a/BUILD/Languages/chinese_simple.lng b/BUILD/Languages/chinese_simple.lng index a4cf8017..a33f3904 100644 --- a/BUILD/Languages/chinese_simple.lng +++ b/BUILD/Languages/chinese_simple.lng @@ -1,5 +1,5 @@ MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE - + MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE Byte å—节 GB @@ -20,14 +20,16 @@ 分 sec 秒 -!= files are different\n -!= 文件ä¸åŒ\n +%x / %y objects deleted successfully +%x / %y 个对象被æˆåŠŸåˆ 除 +%x Percent +百分之%x %x directories %x 目录 %x files, %x 文件, %x is not a valid FreeFileSync batch file! -%x æ— æœ‰æ•ˆçš„ FreeFileSync 批处ç†æ–‡ä»¶ +%x ä¸æ˜¯æœ‰æ•ˆçš„ FreeFileSync 批处ç†æ–‡ä»¶ %x of %y rows in view %x of %y 横å‘视图 %x of 1 row in view @@ -41,13 +43,15 @@ &Apply 应用(&Y) &Cancel -撒消(&C) +å–消(&C) &Check for new version 检查更新(&C) &Create batch job 创建批处ç†ä½œä¸š(&C) &Default 默认(&D) +&Exit +退出(&E) &Export file list 导出文件列表(&E) &File @@ -65,35 +69,39 @@ &Load configuration åŠ è½½é…ç½®(&L) &No - +å¦ &OK 确定(&O) &Pause æš‚åœ(&P) &Quit 退出(&Q) +&Restore +æ¢å¤(&R) &Retry é‡è¯•(&R) &Save ä¿å˜(&S) &Yes - +是 , . -- do not copy\n - - conflict - +- å†²çª - conflict (same date, different size) - +- 冲çª(相åŒæ—¥æœŸ,ä¸åŒå¤§å°) - different - ä¸åŒ +- directory part only +- åªå¯¹ç›®å½•éƒ¨åˆ† - equal - ç›¸åŒ - exists left only - 仅左侧å˜åœ¨çš„ - exists right only - ä»…å³ä¾§å˜åœ¨çš„ +- full file or directory name +- 完整的文件å或目录å - left - 左侧 - left newer @@ -102,8 +110,10 @@ - å³ä¾§ - right newer - å³ä¾§è¾ƒæ–° --> copy to right side\n - +- sibling of %dir +- 与 %dir åŒçº§ +- sibling of %name +- 与 %name åŒçº§ -Open-Source file synchronization- -å¼€æºæ–‡ä»¶åŒæ¥å™¨- . @@ -117,29 +127,19 @@ 1. &Compare 1. 比较(&C) 1. Enter relative file or directory names separated by ';' or a new line. - +1. 输入相对文件或文件夹å称,用';'或空行分隔. 2. &Synchronize... 2. åŒæ¥(&S)... 2. Use wildcard characters '*' and '?'. -2. 使用通é…符"*"å’Œ"?". +2. 使用通é…符‘*’和‘?’. 3. Exclude files directly on main grid via context menu. -3. 直接通过上下文èœå•çš„主è¦ç½‘æ ¼æŽ’é™¤æ–‡ä»¶. -<- copy to left side\n - -<< left file is newer\n -<< 左侧文件较新\n +3. 通过å³é”®èœå•åœ¨ä¸»ç½‘æ ¼æŽ’é™¤æ–‡ä»¶. <Directory> <目录> <Last session> <最åŽä¼šè¯> <multiple selection> <多选> -<| file on left side only\n -<| 仅左侧文件\n -== files are equal\n - ->> right file is newer\n ->> å³ä¾§æ–‡ä»¶è¾ƒæ–°\n A newer version of FreeFileSync is available: FreeFileSync 有新版å¯ç”¨: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About 关于 Action 动作 +Add folder +æ·»åŠ æ–‡ä»¶å¤¹ Add folder pair æ·»åŠ æˆå¯¹æ–‡ä»¶å¤¹ All items have been synchronized! @@ -157,11 +159,13 @@ All items have been synchronized! An exception occured! å‘生异常! As a result the files are separated into the following categories: -ç”±è¯¥æ–‡ä»¶åˆ†ä¸ºä»¥ä¸‹å‡ ç±»: +å…¶ç»“æžœæ˜¯æ–‡ä»¶åˆ†ä¸ºä»¥ä¸‹å‡ ç±»: As the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller: -顾åæ€ä¹‰,这两个文件共享相åŒçš„åç§°è¢«æ ‡è®°ä¸ºç›¸åŒå½“且仅当它们具有相åŒçš„内容。\næ¤é€‰é¡¹æ˜¯æœ‰ç”¨çš„一致性检查,而ä¸æ˜¯å¤‡ä»½è¡ŒåŠ¨.å› æ¤,文件时间没有被考虑到. \n\n通过æ¤é€‰é¡¹ä½¿å†³ç–æ ‘è¾ƒå°: +顾åæ€ä¹‰,两个相åŒæ–‡ä»¶å的文件当且仅当它们具有相åŒçš„内容时会被认为是相åŒçš„。\næ¤é€‰é¡¹å¯¹äºŽä¸€è‡´æ€§æ£€æŸ¥æ¯”较有用,而ä¸æ˜¯å¤‡ä»½æ“作. å› æ¤,文件时间没有被考虑到. \n\n通过æ¤é€‰é¡¹ä½¿å†³ç–æ ‘è¾ƒå°: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. -装é…一个批处ç†æ–‡ä»¶è‡ªåŠ¨åŒæ¥.开始åªæ˜¯é€šè¿‡æ‰¹å¤„ç†æ¨¡å¼çš„文件的å称为FreeFileSyncå¯æ‰§è¡Œ:FreeFileSync.exe <batchfile> .这也å¯ä»¥å®‰æŽ’在您的æ“作系统的工作规划. +装é…一个批处ç†æ–‡ä»¶ç”¨äºŽè‡ªåŠ¨åŒæ¥. è¦å¼€å§‹æ‰¹å¤„ç†æ¨¡å¼åªéœ€ç®€å•åœ°å°†æ‰¹å¤„ç†æ–‡ä»¶åä¼ é€ç»™FreeFileSyncå¯æ‰§è¡Œæ–‡ä»¶:FreeFileSync.exe <batchfile>. 这个也å¯ä»¥å®‰æŽ’在您的æ“作系统的计划任务ä¸. +Auto-adjust columns +自动调整æ 宽 Batch execution 批处ç†æ‰§è¡Œ Batch file created successfully! @@ -177,17 +181,21 @@ Build: Cancel å–消 Change direction - +改å˜æ–¹å‘ Check all -检查所有 +全选 Choose to hide filtered files/directories from list -从列表ä¸é€‰æ‹©éšè—过滤文件/文件夹 +从列表ä¸é€‰æ‹©éšè—被过滤的文件/文件夹 Comma separated list 逗å·åˆ†éš”的列表 +Commandline +命令行 +Commandline is empty! +命令行为空! Compare - +比较 Compare both sides -两侧比较 +比较两侧 Compare by \"File content\" 通过文件内容比较 Compare by \"File size and date\" @@ -197,11 +205,13 @@ Compare by... Comparing content æ£åœ¨æ¯”较内容 Comparing content of files %x -æ£åœ¨æ¯”较档案内容的百分比 %x +æ£åœ¨æ¯”较文件内容的百分比 %x Comparing content... - +æ£åœ¨æ¯”较文件内容... Comparison Result - +比较结果 +Comparison settings +比较设置 Completed å®Œæˆ Configuration @@ -217,11 +227,11 @@ Configure filter Configure filter... 设置过滤... Configure your own synchronization rules. -é…置自己的åŒæ¥è§„则. +é…ç½®ä½ è‡ªå·±çš„åŒæ¥è§„则. Confirm 确认 Conflict detected: - +检测到冲çª: Continue ç»§ç» Conversion error: @@ -237,17 +247,19 @@ Copy from right to left overwriting Copy new or updated files to right folder. å¤åˆ¶æ–°çš„或修改过的文件到å³ä¾§æ–‡ä»¶å¤¹ Copy to clipboard\tCTRL+C -å¤åˆ¶åˆ°å‰ªè´´æ¿\t使用CTRL+Cé”® +å¤åˆ¶åˆ°å‰ªè´´æ¿\tCTRL+C Copying file %x to %y æ£å¤åˆ¶æ–‡ä»¶ %x 到 %y Copying file %x to %y overwriting target å¤åˆ¶æ–‡ä»¶ %x å¹¶è¦†ç›–åˆ°ç›®æ ‡ %y Could not determine volume name for file: +ä¸èƒ½ç¡®å®šæ¤æ–‡ä»¶çš„å·å称: +Could not initialize directory monitoring: +ä¸èƒ½åˆå§‹åŒ–目录监视: +Could not read values for the following XML nodes: -Could not set working directory: -æ— æ³•è®¾ç½®å·¥ä½œç›®å½•: Create a batch job -创建一个批工作 +创建一个批处ç†ä½œä¸š Creating folder %x æ£åˆ›å»ºæ–‡ä»¶å¤¹ %x Current operation: @@ -255,29 +267,43 @@ Current operation: Custom 自定义 Customize columns -自定义行 +自定义æ +Customize... +自定义... DECISION TREE 决ç–æ ‘ Data remaining: 剩余数æ®: Date 日期 +Delay +延时 +Delay between two invocations of the commandline +两个命令行调用之间的延时 Delete files/folders existing on left side only -仅从左侧ä¸åˆ 除文件/方件夹 +åˆ é™¤ä»…åœ¨å·¦ä¾§å˜åœ¨çš„文件/文件夹 Delete files/folders existing on right side only -仅从左侧ä¸åˆ 除文件/方件夹 +åˆ é™¤ä»…åœ¨å³ä¾§å˜åœ¨çš„文件/文件夹 Delete files\tDEL -åˆ é™¤æ–‡ä»¶\t使用DELé”® +åˆ é™¤æ–‡ä»¶\tDEL Delete on both sides -åˆ é™¤ä¸¤ä¾§ +ä»Žä¸¤ä¾§åˆ é™¤ Delete on both sides even if the file is selected on one side only -åˆ é™¤ä¸¤ä¾§(仅对在一侧已选择文件) +ä»Žä¸¤ä¾§åˆ é™¤(å³ä½¿ä»…在一侧选择文件) +Delete or overwrite files permanently. +æ°¸ä¹…æ€§åˆ é™¤æˆ–è¦†ç›–æ–‡ä»¶ã€‚ +Delete permanently +æ°¸ä¹…æ€§åˆ é™¤ Deleting file %x æ£åˆ 除文件 %x Deleting folder %x æ£åˆ 除文件夹 %x +Deletion handling +åˆ é™¤å¤„ç† Directories are dependent! Be careful when setting up synchronization rules: -目录有ä¾èµ–性ï¼æ³¨æ„设立åŒæ¥çš„规则: +目录有ä¾èµ–性ï¼åœ¨è®¾ç«‹åŒæ¥è§„则时请å°å¿ƒ: +Directories to watch +è¦ç›‘视的目录 Directory 目录 Directory does not exist: @@ -285,17 +311,17 @@ Directory does not exist: Do not display visual status information but write to a logfile instead ä¸æ˜¾ç¤ºè§†è§‰çŠ¶æ€ä¿¡æ¯,使用写入日志文件代替。 Do not show this dialog again - +ä¸è¦å†æ˜¾ç¤ºæ¤å¯¹è¯æ¡† Do nothing ä¿æŒä¸åŠ¨ Do you really want to delete the following objects(s)? -ä½ ç¡®å®šè¦åˆ 除下列项目å—? +ä½ ç¡®å®šè¦åˆ 除下列对象å—? Do you really want to move the following objects(s) to the Recycle Bin? -ä½ ç¡®å®šè¦ç§»åŠ¨ä¸‹åˆ—项目到回收站å—? +ä½ ç¡®å®šè¦ç§»åŠ¨ä¸‹åˆ—对象到回收站å—? Do you want FreeFileSync to automatically check for updates every week? è¦è®© FreeFileSync ä¿æŒæ¯å‘¨æ£€æŸ¥ä¸€æ¬¡æ›´æ–°å—?> Don't ask me again - +ä¸è¦å†é—®æˆ‘ Donate with PayPal 通过PayPalæèµ Download now? @@ -305,15 +331,17 @@ Drag && drop Email 邮箱 Enable filter to exclude files from synchronization -å¯ç”¨åŒæ¥æ—¶ä½¿ç”¨è¿‡æ»¤æŽ’除文件。 +åŒæ¥æ—¶ä½¿ç”¨è¿‡æ»¤æŽ’除文件。 +Endless loop when traversing directory: +éåŽ†ç›®å½•æ—¶å‡ºçŽ°æ— é™å¾ªçŽ¯: Error 错误 Error changing modification time: -修改时间出错: +改å˜ä¿®æ”¹æ—¶é—´æ—¶å‡ºé”™: Error copying file: å¤åˆ¶æ–‡ä»¶å‡ºé”™: Error copying locked file %x! - +å¤åˆ¶å·²é”定的文件时出错 %x! Error creating directory: 创建目录出错: Error deleting directory: @@ -324,48 +352,52 @@ Error handling é”™è¯¯å¤„ç† Error loading library function: åŠ è½½åº“å‡½æ•°å‡ºé”™: +Error moving directory: +移动目录时出错: +Error moving file: +移动文件时出错: Error moving to Recycle Bin: -移到到回收站出错: +移动到回收站出错: Error opening file: 打开文件出错: Error parsing configuration file: 分æžé…置文件出错: Error reading file attributes: -读文件属性出错: +读å–文件属性出错: Error reading file: 读å–文件出错: Error resolving symbolic link: -解决å—符链接出错: -Error retrieving full path: -获å–完整路径时出错: +解决符å·é“¾æŽ¥å‡ºé”™: Error starting Volume Shadow Copy Service! - +å¯åŠ¨å·å½±å¤åˆ¶æœåŠ¡æ—¶å‡ºé”™! Error traversing directory: é历目录出错: +Error when monitoring directories. +监视目录时出错. Error writing file attributes: 写文件属性出错: Error writing file: 写入文件出错: Error: Source directory does not exist anymore: -错误:æºç›®å½•æ ¹æœ¬ä¸å˜åœ¨: +错误:æºç›®å½•å·²ç»ä¸å˜åœ¨: Example 例如 Exclude -例外 +排除 Exclude temporarily -暂时除外 +暂时排除 Exclude via filter: 通过过滤器排除: Exit immediately and set returncode < 0 -ç«‹å³é€€å‡ºï¼Œå¹¶ä¼ 回 +ç«‹å³é€€å‡ºï¼Œå¹¶è®¾ç½®è¿”回ç <0 Exit with RC < 0 -带å‚数退出 +退出并设置返回ç <0 Feedback and suggestions are welcome at: 欢迎在下é¢æ出å馈æ„è§å’Œå»ºè®®: File %x has an invalid date! - +文件 %x 的日期éžæ³•! File Manager integration: -文件管ç†é›†æˆå™¨: +文件管ç†å™¨é›†æˆ: File Time tolerance (seconds): 文件时间容错(秒): File already exists. Overwrite? @@ -375,41 +407,41 @@ File content File does not exist: 文件ä¸å˜åœ¨: File list exported! -文件清å•å·²ç»åˆ—出! +文件清å•å·²ç»å¯¼å‡º! File size and date 文件大å°å’Œæ—¥æœŸ File times that differ by up to the specified number of seconds are still handled as having same time. -文件相差最多指定秒数但ä»ç„¶å…·æœ‰ç›¸åŒçš„处ç†æ—¶é—´. +文件相差最多指定秒数但ä»ç„¶æŒ‰ç›¸åŒæ—¶é—´çš„处ç†. Filename 文件å Files %x have a file time difference of less than 1 hour! It's not safe to decide which one is newer due to Daylight Saving Time issues. - +文件 %x 的时间差异å°äºŽ1å°æ—¶ï¼ç”±äºŽå¤ä»¤æ—¶çš„é—®é¢˜å› æ¤ä¸èƒ½å®‰å…¨åœ°åˆ¤æ–哪一个比较新. Files %x have the same date but a different size! - +文件 %x 日期相åŒä½†å¤§å°ä¸åŒ! Files are found equal if\n - file content\nis the same. 如果文件内容相åŒåˆ™è®¤ä¸ºä¸¤è€…ç›¸åŒ Files are found equal if\n - filesize\n - last write time and date\nare the same. 如果文件大å°å’Œæœ€åŽä¿®æ”¹æ—¶é—´å’Œæ—¥æœŸç›¸åŒåˆ™è®¤ä¸ºä¸¤è€…相åŒ. Files remaining: -其余档案: +剩余文件: Files that exist on both sides and have different content -两侧都有但内容ä¸åŒçš„文件 +两侧都有并且内容ä¸åŒçš„文件 Files that exist on both sides, left one is newer -两侧都有但左侧较新的文件 +两侧都有,左侧较新的文件 Files that exist on both sides, right one is newer -两侧都有但å³ä¾§è¾ƒæ–°çš„文件 +两侧都有,å³ä¾§è¾ƒæ–°çš„文件 Files/folders remaining: -档案/文件夹剩余: +文件/文件夹剩余: Files/folders scanned: -档案/文件夹已扫æ: +文件/文件夹已扫æ: Files/folders that exist on left side only -仅在左侧å˜åœ¨çš„档案/文件夹 +仅在左侧å˜åœ¨çš„文件/文件夹 Files/folders that exist on right side only -仅在左侧å˜åœ¨çš„档案/文件夹 +仅在å³ä¾§å˜åœ¨çš„文件/文件夹 Filter 过滤 Filter active: Press again to deactivate -过滤激活: 请按键以关é—激活 +过滤激活: å†æŒ‰ä¸€æ¬¡å¯å…³é—激活 Filter files 过滤文件 Filter view @@ -431,7 +463,7 @@ FreeFileSync é…ç½® FreeFileSync is up to date! FreeFileSync 已是最新! Full path - +完整路径 Generating file list... 生æˆæ–‡ä»¶åˆ—表... Global settings @@ -441,31 +473,37 @@ Help Hide all error and warning messages éšè—所有错误与è¦å‘Šä¿¡æ¯ Hide conflicts - +éšè—å†²çª Hide files that are different -éšè—ä¸åŒçš„档案 +éšè—ä¸åŒçš„文件 Hide files that are equal -éšè—相åŒçš„档案 +éšè—相åŒçš„文件 Hide files that are newer on left -éšè—左侧较新的档案 +éšè—左侧较新的文件 Hide files that are newer on right -éšè—å³ä¾§è¾ƒæ–°çš„档案 +éšè—å³ä¾§è¾ƒæ–°çš„文件 Hide files that exist on left side only -ä»…éšè—在左侧的档案 +éšè—仅在左侧的文件 Hide files that exist on right side only -ä»…éšè—在å³ä¾§çš„档案 +éšè—仅在å³ä¾§çš„文件 Hide files that will be copied to the left side - +éšè—将被å¤åˆ¶åˆ°å·¦ä¾§çš„文件 Hide files that will be copied to the right side - +éšè—将被å¤åˆ¶åˆ°å³ä¾§çš„文件 +Hide files that will be created on the left side +éšè—将在左侧被建立的文件 +Hide files that will be created on the right side +éšè—将在å³ä¾§è¢«å»ºç«‹çš„文件 +Hide files that will be deleted on the left side +éšè—å°†åœ¨å·¦ä¾§è¢«åˆ é™¤çš„æ–‡ä»¶ +Hide files that will be deleted on the right side +éšè—将在å³ä¾§è¢«åˆ 除的文件 Hide files that won't be copied - +éšè—å°†ä¸ä¼šè¢«å¤åˆ¶çš„文件 Hide filtered items éšè—已过滤的项目 Hide further error messages during the current process -在当å‰é€²ç¨‹ä¸éšè—下一æ¥çš„é”™è¯¯ä¿¡æ¯ -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -éšè—åŒæ¥æ—¶çš„错误信æ¯ï¼šåœ¨ç»“æŸè¿›ç¨‹æ—¶æ”¶é›†å’Œæ˜¾ç¤ºçš„æ¸…å• +在当å‰è¿›ç¨‹ä¸éšè—进一æ¥çš„é”™è¯¯ä¿¡æ¯ Hints: æ示: Homepage @@ -473,7 +511,7 @@ Homepage If you like FFS å¦‚æžœä½ å–œæ¬¢ FFS Ignore 1-hour file time difference - +忽略1å°æ—¶æ–‡ä»¶æ—¶é—´å·®å¼‚ Ignore errors 忽略错误 Ignore subsequent errors @@ -485,9 +523,9 @@ Ignore this error, retry or abort? Include 包括 Include temporarily -包括暂时的 -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* - +暂时包括 +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +包括: *.doc;*.zip;*.exe\n排除temp\\* Info ä¿¡æ¯ Information @@ -495,9 +533,9 @@ Information Initialization of Recycle Bin failed! åˆå§‹åŒ–回收站失败! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) -åˆå§‹åŒ–回收站是ä¸å¤§å¯èƒ½äº†!ä¼°è®¡ä½ ä½¿ç”¨çš„ä¸æ˜¯Windows系统.å¦‚æžœä½ æƒ³æœªæ¥åœ¨æ¤ç³»ç»Ÿä¸Šåº”用请è”系作者. :) -Left: -左侧: +åˆå§‹åŒ–回收站是ä¸å¤§å¯èƒ½äº†!\n\nä¼°è®¡ä½ ä½¿ç”¨çš„ä¸æ˜¯Windows系统.\nå¦‚æžœä½ æƒ³åŒ…å«æ¤ç‰¹æ€§,请è”系作者. :) +Left +左侧 Load configuration from file ä»Žæ–‡ä»¶åŠ è½½é…ç½® Load configuration history (press DEL to delete items) @@ -509,19 +547,25 @@ Logging Mirror ->> é•œåƒ ->> Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization. -左侧文件夹镜åƒå¤‡ä»½: åŒæ¥åŽå³ä¾§æ–‡ä»¶å¤¹å°†è¢«è¦†ç›–(完全匹é…左边的文件夹). +左侧文件夹镜åƒå¤‡ä»½: åŒæ¥åŽå³ä¾§æ–‡ä»¶å¤¹å°†è¢«è¦†ç›–并且完全匹é…左边的文件夹. More than 50% of the total number of files will be copied or deleted! -超过总数的 50% 以上的文件è¦è¢«åˆ 除或å¤åˆ¶ +超过总数 50% 以上的文件è¦è¢«å¤åˆ¶æˆ–åˆ é™¤! Move column down -移动下一行 +下移一行 Move column up -移动上一行 +上移一行 +Move files to a custom directory. +将文件移动于自定义目录. +Move to custom directory +移动至自定义目录 Moving %x to Recycle Bin - +移动 %x 到回收站 +Moving %x to custom directory +移动 %x 至自定义目录 Not all items have been synchronized! Have a look at the list. - +并éžæ‰€æœ‰é¡¹ç›®éƒ½å·²åŒæ¥!请看æ¤åˆ—表. Not enough free disk space available in: -æ— è¶³å¤Ÿçš„å¯ç”¨ç©ºé—´äºŽ: +没有足够的å¯ç”¨ç£ç›˜ç©ºé—´ç”¨äºŽ: Nothing to synchronize according to configuration! æ ¹æ®é…置没有任何åŒæ¥! Number of files and directories that will be created @@ -533,9 +577,9 @@ Number of files that will be overwritten OK 确定 Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the synchronization directories. - +åªæœ‰é€šè¿‡è¿‡æ»¤çš„文件/文件夹会被选择用于åŒæ¥.过滤ä¸çš„路径将åšä¸ºåŒæ¥æ–‡ä»¶å¤¹çš„相关路径. Open with File Manager\tD-Click -在资æºç®¡ç†å™¨ä¸æ‰“å¼€ +在资æºç®¡ç†å™¨ä¸æ‰“å¼€\tåŒå‡» Operation aborted! æ“作已å–消! Operation: @@ -547,37 +591,47 @@ Pause Paused å·²æš‚åœ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) into the FreeFileSync installation directory to enable this feature. - +请å¤åˆ¶é€‚当的\"Shadow.dll\"(ä½äºŽ\"Shadow.zip\"压缩包ä¸)到FreeFileSync安装目录以å¯ç”¨æ¤ç‰¹æ€§. Please fill all empty directory fields. 请填满所有空的目录区域. +Please specify alternate directory for deletion! +è¯·æŒ‡å®šç”¨äºŽåˆ é™¤çš„æ›¿æ¢ç›®å½•! Press button to activate filter 请按键以激活过滤 Published under the GNU General Public License: 在GNU通用公共许å¯ä¸‹å‘布: Question - +问题 Quit 退出 +RealtimeSync - Automated Synchronization +实时åŒæ¥ - 自动åŒæ¥ +RealtimeSync configuration +实时åŒæ¥é…ç½® Relative path 相对路径 +Remove folder +åˆ é™¤æ–‡ä»¶å¤¹ Remove folder pair åˆ é™¤æ–‡ä»¶å¤¹å¯¹ +Report translation error +报告翻译错误 Reset é‡ç½® Reset all warning messages - +é‡ç½®æ‰€æœ‰è¦å‘Šä¿¡æ¯ Reset all warning messages? é‡ç½®æ‰€æœ‰è¦å‘Šä¿¡æ¯? Result 结果 -Right: -å³ä¾§: +Right +å³ä¾§ S&ave configuration ä¿å˜é…ç½®(&A) S&witch view - +切æ¢è§†å›¾(&W) Save changes to current configuration? - +ä¿å˜æ›´æ”¹åˆ°å½“å‰é…ç½®? Save current configuration to file ä¿å˜å½“å‰é…置到文件 Scanning... @@ -591,9 +645,9 @@ Select logfile directory: Select variant: 选择å˜åŒ–çš„: Show conflicts - +æ˜¾ç¤ºå†²çª Show file icons - +æ˜¾ç¤ºæ–‡ä»¶å›¾æ ‡ Show files that are different 显示ä¸åŒçš„文件 Show files that are equal @@ -607,15 +661,23 @@ Show files that exist on left side only Show files that exist on right side only 显示仅å˜åœ¨å³ä¾§çš„文件 Show files that will be copied to the left side - +显示将被å¤åˆ¶åˆ°å·¦ä¾§çš„文件 Show files that will be copied to the right side - +显示将被å¤åˆ¶åˆ°å³ä¾§çš„文件 +Show files that will be created on the left side +显示将在左侧被建立的文件 +Show files that will be created on the right side +显示将在å³ä¾§è¢«å»ºç«‹çš„文件 +Show files that will be deleted on the left side +æ˜¾ç¤ºå°†åœ¨å·¦ä¾§è¢«åˆ é™¤çš„æ–‡ä»¶ +Show files that will be deleted on the right side +显示将在å³ä¾§è¢«åˆ 除的文件 Show files that won't be copied - +显示将ä¸è¢«å¤åˆ¶çš„文件 Show popup -查看弹出 +æ˜¾ç¤ºå¼¹å‡ºçª—å£ Show popup on errors or warnings -查看弹出的错误或è¦å‘Š +在错误或è¦å‘Šæ—¶æ˜¾ç¤ºå¼¹å‡ºçª—å£ Significant difference detected: 已侦测到显著ä¸åŒ: Silent mode @@ -625,7 +687,7 @@ Size Sorting file list... 排åºæ–‡ä»¶åˆ—表... Source code written completely in C++ utilizing: -使用C++编写的æºä»£ç 已完全写好: +æºä»£ç 完全使用C++工具编写: Speed: 速度: Start @@ -633,13 +695,13 @@ Start Start synchronization 开始åŒæ¥ Statistics - +统计 Stop åœæ¢ Swap sides - +ä¸¤ä¾§äº’æ¢ Synchronization Preview - +åŒæ¥é¢„览 Synchronization aborted! åŒæ¥å·²æ”¾å¼ƒ! Synchronization completed successfully! @@ -651,23 +713,25 @@ Synchronization settings Synchronization status åŒæ¥çŠ¶æ€ Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\". - +åŒæ¥æ‰€æœ‰ .doc, .zipå’Œ .exe 文件, 除了\"temp\"ä¸çš„一切. Synchronize both sides simultaneously: Copy new or updated files in both directions. -åŒæ—¶åŒæ¥ä¸¤ä¾§: å¤åˆ¶æ–°çš„或更新的文件在两个方å‘. +åŒæ—¶åŒæ¥ä¸¤ä¾§: åŒå‘å¤åˆ¶æ–°çš„或更新的文件. Synchronize... - +åŒæ¥... Synchronizing... åŒæ¥ä¸... System out of memory! -系统内在溢出! +系统内å˜æº¢å‡º! +Target directory already existing! +ç›®æ ‡ç›®å½•å·²ç»å˜åœ¨! Target file already existing! ç›®æ ‡æ–‡ä»¶å·²ç»å˜åœ¨! The file does not contain a valid configuration: 该文件ä¸åŒ…å«æœ‰æ•ˆçš„é…ç½®: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -这一指令将被执行,æ¯æ¬¡ä½ åŒå‡»ä¸€ä¸ªæ–‡ä»¶å。 %name作为预留ä½ç½®é€‰å®šçš„文件。 +This commandline will be executed on each doubleclick. The following macros are available: +æ¤å‘½ä»¤è¡Œä¼šåœ¨æ¯æ¬¡åŒå‡»æ—¶è¢«æ‰§è¡Œ. 如下å®å‘½ä»¤å¯ç”¨: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. -这两个åŒæ ·å˜å¼‚评估命å文件时,在åŒç‰æ¡ä»¶ä¸‹,\n他们有åŒæ ·çš„文件大å°ç›¸åŒçš„最åŽæ”¶ä»¶æ—¥æœŸå’Œæ—¶é—´. +æ¤å˜åŒ–评估两个文件å相åŒçš„文件,åªæœ‰å½“他们有åŒæ ·çš„文件大å°å¹¶ä¸”最åŽä¿®æ”¹æ—¥æœŸå’Œæ—¶é—´ä¹Ÿç›¸åŒ\næ—¶æ‰è®¤ä¸ºå®ƒä»¬æ˜¯ç›¸åŒçš„. Time 时间 Time elapsed: @@ -681,9 +745,9 @@ Total required free disk space: Total time: 总共时间: Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes. - +对文件时间差异在精确的+/-1å°æ—¶çš„文件认为是相åŒçš„,å°äºŽ1å°æ—¶çš„认为是冲çªä»¥æ¤æ¥å¤„ç†å¤ä»¤æ—¶çš„å˜åŒ–. Two way <-> -两侧 <-> +åŒå‘ <-> Unable to connect to sourceforge.net! æ— æ³•é“¾æŽ¥åˆ° Sourceforge.net! Unable to create logfile! @@ -693,17 +757,19 @@ Unable to initialize Recycle Bin! Uncheck all 全部å–æ¶ˆé€‰ä¸ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchronization. - +å˜åœ¨ä¸å¯è§£å†³çš„冲çª!\n\nä½ å¯å¿½ç•¥å†²çªå¹¶ç»§ç»åŒæ¥. Update -> å‡çº§ -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +用法: 选择è¦ç›‘视的目录并输入一命令行. æ¯æ¬¡ç›®å½•(或å目录)ä¸çš„文件被修改时æ¤å‘½ä»¤è¡Œå°±ä¼šæ‰§è¡Œ. Use Recycle Bin 使用回收站 -Use Recycle Bin when deleting or overwriting files during synchronization -当åŒæ¥æ—¶ä½¿ç”¨å›žæ”¶ç«™åˆ 除或覆盖档案 +Use Recycle Bin when deleting or overwriting files. +å½“åˆ é™¤æˆ–è¦†ç›–æ–‡ä»¶æ—¶ä½¿ç”¨å›žæ”¶ç«™. Variant - +å˜åŒ– Volume name %x not part of filename %y! - +å·å %x 并éžæ–‡ä»¶å %y 的一部分! Warning è¦å‘Š Warning: Synchronization failed for %x item(s): @@ -711,16 +777,14 @@ Warning: Synchronization failed for %x item(s): Warnings: è¦å‘Š: When the comparison is started with this option set the following decision tree is processed: -当比较是开始使用æ¤é€‰é¡¹è®¾ç½®ä»¥ä¸‹å¤„ç†å†³å®šæ ‘: +当以æ¤é€‰é¡¹å¼€å§‹æ¯”è¾ƒæ—¶ä»¥ä¸‹å†³å®šæ ‘è¢«å¤„ç†: +You can ignore the error to consider not existing directories as empty. +您å¯å¿½ç•¥æ¤é”™è¯¯è€Œå°†ä¸å˜åœ¨çš„目录视为空. You may try to synchronize remaining items again (WITHOUT having to re-compare)! -您å¯èƒ½ä¼šå°è¯•å†æ¬¡åŒæ¥,其余的项目(而ä¸å¿…å†æ¯”较)! +您å¯èƒ½ä¼šå°è¯•å†æ¬¡åŒæ¥å‰©ä½™çš„项目(而ä¸å¿…é‡æ–°æ¯”较)! different ä¸åŒ file exists on both sides -两侧文件已å˜åœ¨ -flash conflict\n - +文件在两侧å‡å·²å˜åœ¨ on one side only 仅在一侧 -|> file on right side only\n -|> ä»…å³ä¾§æ–‡ä»¶\n diff --git a/BUILD/Languages/czech.lng b/BUILD/Languages/czech.lng new file mode 100644 index 00000000..f1178b94 --- /dev/null +++ b/BUILD/Languages/czech.lng @@ -0,0 +1,790 @@ + MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE + MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE + Byte + Byte + GB + GB + MB + MB + PB + PB + TB + TB + day(s) + d + hour(s) + hod + kB + kB + min + min + sec + s +%x / %y objects deleted successfully +%x / %y objektů úspěšnÄ› smazáno +%x Percent +%x procent +%x directories +adresářů: %x +%x files, +souborů: %x; +%x is not a valid FreeFileSync batch file! +%x nenà platným dávkovým souborem programu FreeFileSync! +%x of %y rows in view +%x z %y řádků +%x of 1 row in view +%x z 1 řádku +&Abort +&PÅ™eruÅ¡it +&About... +&O Programu... +&Advanced +&UpÅ™esnit +&Apply +&PoužÃt +&Cancel +&ZruÅ¡it +&Check for new version +Zkontrolovat &aktualizace +&Create batch job +&VytvoÅ™it dávku +&Default +&PÅ™eddefinované +&Exit +&Konec +&Export file list +&Exportovat seznam souborů +&File +&Soubor +&Global settings +&Nastavenà +&Help +&Pomoc +&Ignore +&Ignorovat +&Language +&Jazyk +&Load +&NaÄÃst +&Load configuration +&NaÄÃst konfiguraci +&No +&Ne +&OK +&OK +&Pause +&Pauza +&Quit +U&konÄit +&Restore +&Obnovit +&Retry +&Znovu +&Save +&Uložit +&Yes +&Ano +, + +- conflict +- konflikt +- conflict (same date, different size) +- konflikt (stejné datum, jiná velikost) +- different +- rozdÃlné +- directory part only +- pouze cesta +- equal +- stejné +- exists left only +- existuje pouze na levé stranÄ› +- exists right only +- existuje pouze na pravé stranÄ› +- full file or directory name +- celá cesta nebo jméno souboru +- left +- vlevo +- left newer +- vlevo novÄ›jÅ¡Ã +- right +- vpravo +- right newer +- vpravo novÄ›jÅ¡Ã +- sibling of %dir +- pouze cesta z protistrany +- sibling of %name +- celá cesta nebo jméno souboru z protistrany +-Open-Source file synchronization- +-synchronizace souborů Open-Source- +. +, +/sec +/s +1 directory +adresář: 1 +1 file, +soubor: 1; +1. &Compare +1. &Porovnat +1. Enter relative file or directory names separated by ';' or a new line. +1. Můžete použÃt relativnà cesty k souboru nebo adresáři oddÄ›lené ';' nebo řádkem. +2. &Synchronize... +2. &Synchronizovat... +2. Use wildcard characters '*' and '?'. +2. Můžete použÃt zástupné znaky (wildcard) '*' a '?'. +3. Exclude files directly on main grid via context menu. +3. Můžete použÃt pro vynechávánà souborů pÅ™Ãmo kontextového menu. +<Directory> +<Adresář> +<Last session> +<PoslednÃ> +<multiple selection> +<vÃcenásobný výbÄ›r> +A newer version of FreeFileSync is available: +je dostupná novÄ›jÅ¡Ã verze FreeFileSync: +Abort requested: Waiting for current operation to finish... +Požadavek na pÅ™eruÅ¡enÃ: ÄŒekánà na ukonÄenà aktuálnà operace... +Aborted +PÅ™eruÅ¡eno +About +O Programu +Action +Akce +Add folder +PÅ™idat adresář +Add folder pair +PÅ™idat adresář pro porovnánà +All items have been synchronized! +VÅ¡echny položky byly aktualizovány! +An exception occured! +Vyskytla se chyba! +As a result the files are separated into the following categories: +Jako výsledek jsou soubory rozdÄ›leny do následujÃcÃch kategoriÃ: +As the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller: +Jak název napovÃdá, dva soubory majÃcà stejné jméno jsou oznaÄeny za shodné jen a pouze pokud majà shodný obsah. Toto nastavenà je vhodné spÃÅ¡e pro sledovánà konzistence než pro zálohovánÃ. Proto nejsou data zmÄ›n souborů brána vůbec v potaz.\n\nPokud vyberete toto nastavenà bude schéma rozhodovánà kratÅ¡Ã: +Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. +VytvoÅ™enà dávkového souboru pro automatický provoz. Ke spuÅ¡tÄ›nà dávky jednoduÅ¡e jejà jméno zadejte jako parametr pÅ™i spuÅ¡tÄ›nà FreeFileSync: FreeFileSync.exe <batchfile>. +Auto-adjust columns +Automaticky pÅ™izpůsobit Å¡ÃÅ™ku +Batch execution +SpuÅ¡tÄ›nà dávky +Batch file created successfully! +Dávka úspěšnÄ› vytvoÅ™ena! +Batch job +Dávkový soubor +Big thanks for localizing FreeFileSync goes out to: +PodÄ›kovánà za pÅ™eklad FreeFileSync: +Browse +Procházet +Build: +Build: +Cancel +ZruÅ¡it +Change direction +ZmÄ›nit akci +Check all +OznaÄit vÅ¡e +Choose to hide filtered files/directories from list +Vyberte pro skrytà filtrovaných souborů/adresářů ze seznamu +Comma separated list +Text oddÄ›lený Äárkami +Commandline +PÅ™Ãkazová řádka +Commandline is empty! +PÅ™Ãkazová řádka je prázdná! +Compare +Porovnat +Compare both sides +Porovnat obÄ› strany +Compare by \"File content\" +Porovnat \"podle obsahu souboru\" +Compare by \"File size and date\" +Porovnat \"podle velikosti a data souboru\" +Compare by... +Porovnat ... +Comparing content +Porovnánà obsahu +Comparing content of files %x +Porovnávánà obsahu souborů %x +Comparing content... +Porovnávánà obsahu... +Comparison Result +Výsledek porovnánà +Comparison settings +Nastavenà porovnánà +Completed +Hotovo +Configuration +Konfigurace +Configuration loaded! +Konfigurace naÄtena. +Configuration overview: +PÅ™ehled konfigurace: +Configuration saved! +Konfigurace uložena. +Configure filter +Nastavenà filtru +Configure filter... +Nastavenà filtru... +Configure your own synchronization rules. +Nastavenà vlastnÃch pravidel synchronizace. +Confirm +Potvrdit +Conflict detected: +Zaznamenán konflikt: +Continue +PokraÄovat +Conversion error: +Chyba konverze: +Copy from left to right +KopÃrovat z leva do prava +Copy from left to right overwriting +KopÃrovat z leva do prava pÅ™episem +Copy from right to left +KopÃrovat z prava do leva +Copy from right to left overwriting +KopÃrovat z prava do leva pÅ™episem +Copy new or updated files to right folder. +KopÃrovat nové nebo aktualizované soubory do adresáře vpravo. +Copy to clipboard\tCTRL+C +Vložit do schránky\tCTRL+C +Copying file %x to %y +KopÃrovánà souboru %x do %y +Copying file %x to %y overwriting target +PÅ™epis souboru %y souborem %x +Could not determine volume name for file: +Nenà možné zjistit jméno jednotky souboru: +Could not initialize directory monitoring: +Nelze nastavit monitorovánà adresáře: +Could not read values for the following XML nodes: + +Create a batch job +VytvoÅ™it dávku +Creating folder %x +Vytvářenà adresáře %x +Current operation: +Aktuálnà operace: +Custom +Vlastnà +Customize columns +Vlastnà sloupce +Customize... +VlastnÃ.... +DECISION TREE +ROZHODOVÃNà +Data remaining: +Zbývá dat: +Date +Datum +Delay +ZpoždÄ›nà +Delay between two invocations of the commandline +ZpoždÄ›nà mezi dvÄ›ma pÅ™Ãkazovými řádky +Delete files/folders existing on left side only +Smazat soubory/adresáře existujÃcà pouze na levé stranÄ› +Delete files/folders existing on right side only +Smazat soubory/adresáře existujÃcà pouze na pravé stranÄ› +Delete files\tDEL +Smazat soubory\tDEL +Delete on both sides +Smazat z obou stran +Delete on both sides even if the file is selected on one side only +Smazat na obou stranách i když je soubor vybrán pouze na jedné z nich +Delete or overwrite files permanently. +Smazat nebo pÅ™epsat soubory trvale. +Delete permanently +Odstranit trvale +Deleting file %x +Mazánà souboru %x +Deleting folder %x +Mazánà adresáře %x +Deletion handling +Nastavenà mazánà +Directories are dependent! Be careful when setting up synchronization rules: +Adresáře jsou závislé! BuÄte opatrnà s definicà synchronizaÄnÃch pravidel: +Directories to watch +Sledované adresáře +Directory +Adresář +Directory does not exist: +Adresář neexistuje: +Do not display visual status information but write to a logfile instead +Nezobrazovat informace o stavu ale zapisovat pÅ™Ãmo do souboru záznamů +Do not show this dialog again +tento dialog již nezobrazovat +Do nothing +Nic nedÄ›lat +Do you really want to delete the following objects(s)? +Opravdu chcete smazat následujÃcà objekty? +Do you really want to move the following objects(s) to the Recycle Bin? +Opravdu chcete pÅ™esunout následujÃcà objekty do koÅ¡e? +Do you want FreeFileSync to automatically check for updates every week? +Chcete aby FreeFileSync automaticky zjiÅ¡Å¥oval aktualizace každý týden? +Don't ask me again +Již se znovu neptat +Donate with PayPal +PÅ™ispÄ›t pomocà PayPal +Download now? +Stáhnout nynÃ? +Drag && drop +Drag && Drop +Email +Email +Enable filter to exclude files from synchronization +Povolit filtr pro vynechánà souborů ze synchronizace +Endless loop when traversing directory: +Zacyklenà pÅ™i procházenà adresáře: +Error +Chyba +Error changing modification time: +Chyba nastavenà Äasu zmÄ›ny: +Error copying file: +Chyba kopÃrovánà souboru: +Error copying locked file %x! +Chyba kopÃrovánà zamÄeného souboru %x! +Error creating directory: +Chyba vytvoÅ™enà adresáře: +Error deleting directory: +Chyba mazánà adresáře: +Error deleting file: +Chyba mazánà souboru: +Error handling +Zpracovánà chyb +Error loading library function: +Chyba naÄtenà knihovny funkcÃ: +Error moving directory: +Chyba pÅ™esouvánà adresáře: +Error moving file: +Chyba pÅ™esouvánà souboru: +Error moving to Recycle Bin: +Chyba pÅ™esunu do KoÅ¡e: +Error opening file: +Chyba otevÅ™enà souboru: +Error parsing configuration file: +Chyba zpracovánà konfigurace: +Error reading file attributes: +Chyba Ätenà atributů souboru: +Error reading file: +Chyba Ätenà souboru: +Error resolving symbolic link: +Chyba odkazu zástupce: +Error starting Volume Shadow Copy Service! +Chyba spuÅ¡tÄ›nà služby Volume Shadow Copy Service! +Error traversing directory: +Chyba procházenà adresáře: +Error when monitoring directories. +Chyba pÅ™i sledovánà adresářů. +Error writing file attributes: +Chyba zápisu atributů souboru: +Error writing file: +Chyba zápisu souboru: +Error: Source directory does not exist anymore: +Chyba: Zdrojový adresář již neexistuje: +Example +PÅ™Ãklad +Exclude +Vynechat +Exclude temporarily +Vynechat doÄasnÄ› +Exclude via filter: +Vynechat pomocà filtru: +Exit immediately and set returncode < 0 +UkoÄit okamžitÄ› a nastavit návratový kód < 0 +Exit with RC < 0 +UkoÄit s RC < 0 +Feedback and suggestions are welcome at: +Komentáře a námÄ›ty zasÃlejte na: +File %x has an invalid date! +Soubor %x má chybné datum! +File Manager integration: +Integrace do průzkumnÃka: +File Time tolerance (seconds): +Tolerance Äasu souboru (sekundy): +File already exists. Overwrite? +Soubor již existuje. PÅ™epsat? +File content +Podle obsahu souboru +File does not exist: +Soubor neexistuje: +File list exported! +Seznam souborů exportován! +File size and date +Podle velikosti a data souboru +File times that differ by up to the specified number of seconds are still handled as having same time. +Soubory jejichž Äas se neliÅ¡Ã o vÃce než zadaný poÄet sekund jsou brány jako se stejným Äasem. +Filename +Jméno +Files %x have a file time difference of less than 1 hour! It's not safe to decide which one is newer due to Daylight Saving Time issues. +Soubory %x se liÅ¡Ã o ménÄ› než 1 hodinu. nenà možné bezpeÄnÄ› rozhodnout, který z nich je novÄ›jÅ¡Ã kvůli použÃvánà LetnÃho Äasu. +Files %x have the same date but a different size! +Soubory %x majà stejné datum a Äas ale rozdÃlnou velikost! +Files are found equal if\n - file content\nis the same. +Soubory jsou shodné jestliže\n - obsah souboru\nje stejný. +Files are found equal if\n - filesize\n - last write time and date\nare the same. +Soubory jsou shodné jestliže\n - velikost souboru\n - datum i Äas poslednà zmÄ›ny\njsou stejné. +Files remaining: +Zbývá souborů: +Files that exist on both sides and have different content +Soubory, ketré existujà na obou stranách a liÅ¡Ã se obsahem +Files that exist on both sides, left one is newer +Soubory, které existujà na obou stranách, z nichž vlevo je novÄ›jÅ¡Ã +Files that exist on both sides, right one is newer +Soubory, které existujé na obou stranách, z nichž vpravo je novÄ›jÅ¡Ã +Files/folders remaining: +Zbývá souborů/adresářů: +Files/folders scanned: +Zpracované soubory/adresáře: +Files/folders that exist on left side only +Soubory/adresáře, které existujà pouze vlevo +Files/folders that exist on right side only +Soubory/adresáře, které existujà pouze vpravo +Filter +Filtr +Filter active: Press again to deactivate +Filtr aktivnÃ: Klikni znovu pro deaktivaci +Filter files +Filtrovat soubory +Filter view +Filtrovat seznam +Folder Comparison and Synchronization +Porovnánà a Synchronizace adresářů +Folder pair +Dvojice adresářů +FreeFileSync - Folder Comparison and Synchronization +FreeFileSync - Porovnánà a Synchronizace adresářů +FreeFileSync Batch Job +FreeFileSync Dávkové zpracovánà +FreeFileSync at Sourceforge +FreeFileSync na Sourceforge +FreeFileSync batch file +FreeFileSync dávkový soubor +FreeFileSync configuration +Konfigurace FreeFileSync +FreeFileSync is up to date! +FreeFileSync je aktuálnÃ! +Full path +Plná cesta +Generating file list... +Vytvářenà seznamu souborů... +Global settings +Nastavenà programu +Help +NápovÄ›da +Hide all error and warning messages +Skrýt vÅ¡echny chyby a varovánà +Hide conflicts +Skrýt konflikty +Hide files that are different +Skrýt rozdÃlné soubory +Hide files that are equal +Skrýt shodné soubory +Hide files that are newer on left +Skrýt novÄ›jÅ¡Ã zleva +Hide files that are newer on right +Skrýt novÄ›jÅ¡Ã zprava +Hide files that exist on left side only +Skrýt soubory existujÃcà pouze vlevo +Hide files that exist on right side only +Skrýt soubory existujÃcà pouze vpravo +Hide files that will be copied to the left side +Skrýt soubory, které budou kopÃrovány vlevo +Hide files that will be copied to the right side +Skrýt soubory, které budou kopÃrovány vpravo +Hide files that will be created on the left side +Skrýt soubory, které budou vlevo vytvoÅ™eny +Hide files that will be created on the right side +Skrýt soubory, které budou vpravo vytvoÅ™eny +Hide files that will be deleted on the left side +Skrýt soubory, které budou vlevo smazány +Hide files that will be deleted on the right side +Skrýt soubory, které budou vpravo smazány +Hide files that won't be copied +Skrýt soubory, které nebudou kopÃrovány +Hide filtered items +Skrýt filtrované soubory +Hide further error messages during the current process +Nezobrazovat dalÅ¡Ã chybová hlášenà bÄ›hem zpracovánà +Hints: +NápovÄ›da: +Homepage +Homepage +If you like FFS +Pokud se Vám FSS lÃbà +Ignore 1-hour file time difference +Ignorovat 1 hodinu rozdÃlu v Äase mezi soubory +Ignore errors +Ignorovat chyby +Ignore subsequent errors +Ignorovat dalÅ¡Ã chyby +Ignore this error, retry or abort synchronization? +Ignorovat chybu, opakovat nebo pÅ™eruÅ¡it synchronizaci. +Ignore this error, retry or abort? +Ignorovat chybu, opakovat nebo pÅ™eruÅ¡it? +Include +PÅ™idat +Include temporarily +PÅ™idat doÄasnÄ› +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +PÅ™idat: *.doc;*.zip;*.exe\nVynechat: temp\\* +Info +Info +Information +Informace +Initialization of Recycle Bin failed! +Chyba inicializace KoÅ¡e! +It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) +Nebylo možné inicializovat KoÅ¡!\n\nPravdÄ›podobnÄ› nepoužÃváte Windows.\nPokud chcete tuto vlastnost využÃvat, kontaktujte autora. :) +Left +Levý +Load configuration from file +NaÄÃst konfiguraci ze souboru +Load configuration history (press DEL to delete items) +NaÄÃst historii konfigurace (pomocà DEL můžete položku smazat) +Log-messages: +Záznamy: +Logging +Zaznamenávánà +Mirror ->> +Zrcadlenà ->> +Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization. +Zrcadlenà levého adresáře: Pravý adresář bude pÅ™epsán a po synchronizaci bude totožný s levým. +More than 50% of the total number of files will be copied or deleted! +VÃce než 50% souborů bude kopÃrovaných nebo mazaných! +Move column down +PÅ™esunout sloupec dolů +Move column up +PÅ™esunout sloupec nahoru +Move files to a custom directory. +PÅ™esunout soubory do nastaveného adresáře. +Move to custom directory +PÅ™esunout do adresáře +Moving %x to Recycle Bin +PÅ™esouvánà %x do KoÅ¡e. +Moving %x to custom directory +PÅ™esouvánà %x do nastaveného adresáře. +Not all items have been synchronized! Have a look at the list. +Ne vÅ¡echny položky byly sesynchronizovány! PodÃvejte se na seznam. +Not enough free disk space available in: +Nedostatek mÃsta na disku: +Nothing to synchronize according to configuration! +Podle dané konfigurace nenà co synchronizovat! +Number of files and directories that will be created +PoÄet souborů a adresářů k vytvoÅ™enà +Number of files and directories that will be deleted +PoÄet souborů a adresářů ke smazánà +Number of files that will be overwritten +PoÄet souborů a adresářů k pÅ™epsánà +OK +OK +Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the synchronization directories. +Pouze soubory/adresáře odpovÃdajÃcà nastavenému filtru budou vybrány pro synchronizaci. Filtr je aplikován relativnÄ›(!) k cestÄ› synchronizovaných adresářů. +Open with File Manager\tD-Click +OtevÅ™Ãt\tDvojklikem +Operation aborted! +Operace zruÅ¡ena! +Operation: +Operace: +Overview +PÅ™ehled +Pause +Pauza +Paused +Pauza +Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) into the FreeFileSync installation directory to enable this feature. +ProsÃm zkopÃrujte odpovÃdajÃcà \"Shadow.dll\" (umÃstÄ›ný v \"Shadow.zip\") do instalaÄnÃho adresáře FreeFileSync, aby bylo možné použÃt tuto funkci. +Please fill all empty directory fields. +Zadejte adresáře pro synchronizaci. +Please specify alternate directory for deletion! +Zadejte cÃlový adresář pro mazánÃ! +Press button to activate filter +KliknutÃm aktivujete filtr +Published under the GNU General Public License: +Vydáno podl GNU General Public License (GPL): +Question +Otázky +Quit +Konec +RealtimeSync - Automated Synchronization +RealtimeSync - Automatická synchronizace +RealtimeSync configuration +Konfigurace RealtimeSync +Relative path +Relativnà cesta +Remove folder +Odstranit adresář +Remove folder pair +Odtsranit dvojici adresářů +Report translation error +Hlásit chyby pÅ™ekladu +Reset +Resetovat +Reset all warning messages +Resetovat vÅ¡echna varovná hlášenà +Reset all warning messages? +Resetovat vÅ¡echna varovná hlášenÃ? +Result +Výsledek +Right +Pravý +S&ave configuration +&Uloženà konfigurace +S&witch view +&ZmÄ›nit zobrazenà +Save changes to current configuration? +Uložit zmÄ›ny do aktuálnà konfigurace? +Save current configuration to file +Uložit zmÄ›ny do konfiguraÄnÃho souboru +Scanning... +ZpracovávánÃ... +Scanning: +Zpracováváno: +Select a folder +Vyberte adresář +Select logfile directory: +Vyberte adresář pro záznamy: +Select variant: +Vyberte variantu: +Show conflicts +Zobrazit konflikty +Show file icons +Zobrazit ikony souborů +Show files that are different +Zobrazit rozdÃlené soubory +Show files that are equal +Zobrazit shodné soubory +Show files that are newer on left +Zobrazit soubory novÄ›jÅ¡Ã vlevo +Show files that are newer on right +Zobrazit soubory novÄ›jÅ¡Ã vpravo +Show files that exist on left side only +Zobrazit soubory existujÃcà pouze vlevo +Show files that exist on right side only +Zobrazit soubory existujÃcà pouze vpravo +Show files that will be copied to the left side +Zobrazit soubory pro kopÃrovánà doleva +Show files that will be copied to the right side +Zobrazit soubory pro kopÃrovánà doprava +Show files that will be created on the left side +Zobrazit soubory, které budou vlevo vytvoÅ™eny +Show files that will be created on the right side +Zobrazit soubory, které budou vpravo vytvoÅ™eny +Show files that will be deleted on the left side +Zobrazit soubory, které budou vlevo smazány +Show files that will be deleted on the right side +Zobrazit soubory, které budou vpravo smazány +Show files that won't be copied +Zobrazit soubory, které nebudou kopÃrovány +Show popup +Zobrazit okno +Show popup on errors or warnings +Zobrazit hlášenà pÅ™i chybÄ› nebo varovánà +Significant difference detected: +Nalezeny významné zmÄ›ny: +Silent mode +Tichý mód +Size +Velikost +Sorting file list... +SetÅ™ÃdÄ›nà seznamu... +Source code written completely in C++ utilizing: +Zdrojový kód byl napsán kompletnÄ› v C++ s pomocÃ: +Speed: +Rychlost: +Start +Start +Start synchronization +Start synchronizace +Statistics +Statistika +Stop +Stop +Swap sides +ZmÄ›na stran +Synchronization Preview +Náhled synchronizace +Synchronization aborted! +Synchronizace zruÅ¡ena! +Synchronization completed successfully! +Synchronizace dokonÄena úspěšnÄ›! +Synchronization completed with errors! +Synchronizace dokonÄena s chybami. +Synchronization settings +Nastavenà synchronizace +Synchronization status +Stav synchronizace +Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\". +Synchronizuj vÅ¡echny soubory .doc, .zip a .exe s výjimkou vÅ¡eho v podadresáři \"temp\" +Synchronize both sides simultaneously: Copy new or updated files in both directions. +Synchronizuj obÄ› strany zároveň: KopÃruj nové nebo aktualizované soubory z obou adresářů. +Synchronize... +Synchronizace... +Synchronizing... +Synchronizuji... +System out of memory! +Nedostatek pamÄ›ti! +Target directory already existing! + +Target file already existing! +CÃlový soubor již existuje! +The file does not contain a valid configuration: +Soubor neobsahuje platnou konfiguraci: +This commandline will be executed on each doubleclick. The following macros are available: +Tento pÅ™Ãkaz bude spuÅ¡tÄ›n vždy, když poklikáte na název souboru. K dispozici jsou následujÃcà promÄ›nné: +This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. +Tato variantra vyhodnotà dva stejnÄ› pojmenované soubory jako shodné pokud majà i stejnou velikost A ZÃROVEŇ i datum a Äas poslednà zmÄ›ny. +Time +ÄŒas +Time elapsed: +Uplynulý Äas: +Time remaining: +ZbývajÃcà Äas: +Total amount of data that will be transferred +Celkový objem dat, který bude pÅ™enesen +Total required free disk space: +Požadované volné mÃsto na disku: +Total time: +Celkový Äas: +Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes. +Považovat Äas souboru liÅ¡Ãcà se pÅ™esnÄ› o +/- 1 hodinu jako shodný, ménÄ› než 1 hodinu jako konflikt, kvůli zpracovánà a pÅ™echodům na Letnà Äas. +Two way <-> +ObousmÄ›rná <-> +Unable to connect to sourceforge.net! +Nenà možné se pÅ™ipojit k sourceforge.net! +Unable to create logfile! +nenà možné vytvoÅ™it záznamový soubor! +Unable to initialize Recycle Bin! +Nenà možné použÃt KoÅ¡! +Uncheck all +OdznaÄit vÅ¡e +Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchronization. +NevyÅ™eÅ¡ené konflikty! \n\nJe možné konflikt ignorovat a pokraÄovat v synchronizaci. +Update -> +Aktualizuj -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +PoužitÃ: Vyberte adresáře, které majà být monitorovány a vložte pÅ™Ãkaz. Pokaždé, když dojde ke zmÄ›nÄ› v tÄ›chto adresářÃch (nebo podadresářÃch), bude pÅ™Ãkaz spuÅ¡tÄ›n. +Use Recycle Bin +PoužÃt KoÅ¡ +Use Recycle Bin when deleting or overwriting files. +PoužÃt KoÅ¡ pÅ™i mazánà nebo pÅ™episu souborů. +Variant +Varianta +Volume name %x not part of filename %y! +Disk %x nenà souÄástà jména souboru %y! +Warning +Varovánà +Warning: Synchronization failed for %x item(s): +VarovánÃ: Synchornizace se nepovedla pro \"%x\" položek: +Warnings: +VarovánÃ: +When the comparison is started with this option set the following decision tree is processed: +Když je zahájeno porovnávánà s tÃmto nastavenÃm, je použito následujÃcà schéma rozhodovánÃ: +You can ignore the error to consider not existing directories as empty. +Chybu považovanà neexistujÃcà adresářů jako prázdných můžete ignorovat. +You may try to synchronize remaining items again (WITHOUT having to re-compare)! +Můžete se pokusit synchronizovat zbývajÃcà položky (BEZ nutnosti znovuporovnávánÃ)! +different +rozdÃlný +file exists on both sides +soubor existuje na obou stranách +on one side only +pouze na jedné stranÄ› diff --git a/BUILD/Languages/dutch.lng b/BUILD/Languages/dutch.lng index 00a08d65..3484395a 100644 --- a/BUILD/Languages/dutch.lng +++ b/BUILD/Languages/dutch.lng @@ -20,8 +20,10 @@ min sec sec -!= files are different\n -!= Bestanden zijn verschillend\n +%x / %y objects deleted successfully +%x / %y objecten succesvol verwijderd +%x Percent +%x procent %x directories %x paden %x files, @@ -48,6 +50,8 @@ &Creëer batchjob &Default &Standaard +&Exit +&Afsluiten &Export file list &Exporteer bestandslijst &File @@ -72,6 +76,8 @@ &Pause &Quit &Afsluiten +&Restore +&Herstellen &Retry &Opnieuw proberen &Save @@ -80,20 +86,22 @@ &Ja , . -- do not copy\n -- niet kopiëren\n - conflict - conflict - conflict (same date, different size) - conflict (zelfde datum, verschillende grootte) - different - verschillend +- directory part only +- alleen de map - equal - gelijk - exists left only - bestaat alleen links - exists right only - bestaat alleen rechts +- full file or directory name +- volledige map of bestandsnaam - left - links - left newer @@ -102,8 +110,10 @@ - rechts - right newer - rechts is nieuwer --> copy to right side\n --> kopieer naar de rechterkant\n +- sibling of %dir +- verwant aan %dir +- sibling of %name +- verwant aan &name -Open-Source file synchronization- -Open-Source bestandssynchronisatie- . @@ -124,22 +134,12 @@ 2. U kunt gebruik maken van wildcard karakters zoals '*' en '?'. 3. Exclude files directly on main grid via context menu. 3. Sluit bestanden direct uit in het hoofscherm via een contextmenu -<- copy to left side\n -<- kopieer naar de linkerkant\n -<< left file is newer\n -<< linker bestand is nieuwer\n <Directory> <Pad> <Last session> <Laatste sessie> <multiple selection> <veelvoudige selectie> -<| file on left side only\n -<| bestand bestaat alleen links\n -== files are equal\n -== bestanden zijn gelijk\n ->> right file is newer\n ->> rechter bestand is nieuwer\n A newer version of FreeFileSync is available: Een nieuwe versie van FreeFileSync is beschikbaar: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About Informatie Action Actie +Add folder +Map toevoegen Add folder pair Voeg 1 paar gekoppelde mappen toe All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Zoals de naam suggereert, worden twee bestanden met dezelfde naam alleen gemarkeerd als gelijk, als ze precies dezelfde inhoud hebben. Deze optie is handig voor een consistentiecontrole in plaats van back-up handelingen. Daarom worden de tijdstempels niet bekeken.\n\n Met deze optie aan is de beslissingsboom korter: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Assembleer een batchbestand voor automatische synchronisatie. Om te starten in batchmodus is het voldoende om de bestandsnaam achter de FreeFileSync toepassing te zetten: FreeFileSync.exe <batchbestand>. Het is mogelijk dit in te plannen in de systeemplanner. +Auto-adjust columns +Kolommen automatisch aanpassen Batch execution Batch taak uitvoeren Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Gefilterde bestanden niet/wel weergeven Comma separated list Komma gescheiden lijst +Commandline +Opdrachtregel +Commandline is empty! +Opdrachtregel is leeg! Compare Vergelijk Compare both sides @@ -202,6 +210,8 @@ Comparing content... Inhoud vergelijken... Comparison Result Resultaat vergelijken +Comparison settings +Vergelijk instellingen Completed Volbracht Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Aan het overschrijven van bestand %x naar %y Could not determine volume name for file: Kon de schijfnaam niet vaststellen van bestand: -Could not set working directory: -Kan het pad in gebruik niet instellen: +Could not initialize directory monitoring: +Initaliseren van locatie-controle niet mogelijk: +Could not read values for the following XML nodes: + Create a batch job Creëer batchjob Creating folder %x @@ -256,12 +268,18 @@ Custom Eigen regels Customize columns Aanpassen kolommen +Customize... +Aanpassen... DECISION TREE BESLISSINGSBOOM Data remaining: Resterende data: Date Datum +Delay +Vertraging +Delay between two invocations of the commandline +Vertraging tussen het aanroepen van twee opdrachten van de opdrachtregel Delete files/folders existing on left side only Verwijder bestanden/folders die alleen links bestaan Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Verwijder aan beide kanten Delete on both sides even if the file is selected on one side only Verwijder aan beide kanten ookal is het bestand maar aan één kant geselecteerd +Delete or overwrite files permanently. +Verwijder of overschrijf bestanden onomkeerbaar. +Delete permanently +Verwijder onomkeerbaar Deleting file %x Bestand %x wordt verwijderd Deleting folder %x Map %x wordt verwijderd +Deletion handling +Verwijder-afhandeling Directories are dependent! Be careful when setting up synchronization rules: Mappen zijn afhankelijk van elkaar! Wees voorzichtig met het maken van synchronisatieregels: +Directories to watch +Locaties om te controleren Directory Map Directory does not exist: @@ -306,6 +332,8 @@ Email E-mail Enable filter to exclude files from synchronization Filter gebruiken om bestanden uit te sluiten van synchronisatie +Endless loop when traversing directory: +Oneindige lus bij het nalopen van locatie: Error Fout Error changing modification time: @@ -324,6 +352,10 @@ Error handling Fout afhandeling Error loading library function: Er is een fout opgetreden bij het laden van de 'library function': +Error moving directory: +Er is een fout opgetreden bij het verplaatsen van locatie: +Error moving file: +Er is een fout opgetreden bij het verplaatsen van bestand: Error moving to Recycle Bin: Er is een fout opgetreden bij het verplaatsen naar de prullenbak: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Er is een fout opgetreden bij het lezen van het bestand: Error resolving symbolic link: Er is een fout opgetreden bij het ophalen van een symbolische koppeling: -Error retrieving full path: -Er is een fout opgetreden bij het achterhalen van de volledige bestandslocatie: Error starting Volume Shadow Copy Service! Er is een fout opgetreden bij het starten van de Volume Schadow Copy Service! Error traversing directory: Er is een fout opgetreden bij het doorzoeken van map: +Error when monitoring directories. +Er is een fout opgetreden bij het controleren van locaties. Error writing file attributes: Er is een fout opgetreden bij het schrijven van de bestands-eigenschappen: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Verberg bestanden die naar de linkerkant zullen worden gekopieerd Hide files that will be copied to the right side Verberg bestanden die naar de rechterkant zullen worden gekopieerd +Hide files that will be created on the left side +Verberg bestanden die zullen worden aangemaakt aan de linkerkant +Hide files that will be created on the right side +Verberg bestanden die zullen worden aangemaakt aan de rechterkant +Hide files that will be deleted on the left side +Verberg bestanden die zullen worden verwijderd aan de linkerkant +Hide files that will be deleted on the right side +Verberg bestanden die zullen worden verwijderd aan de rechterkant Hide files that won't be copied Verberg bestanden die niet zullen worden gekopieerd Hide filtered items Verberg gefilterde items Hide further error messages during the current process Volgende foutmeldingen niet meer weergeven tijdens de huidige handeling -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Verbergt foutmeldingen tijdens het synchroniseren:\nze worden verzameld en op het eind in een lijst getoond Hints: Tips: Homepage @@ -486,8 +524,8 @@ Include Gebruiken Include temporarily Tijdelijk bijsluiten -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Bijsluiten: *.doc;*.zip;*.exe\nUitsluiten: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Bijsluiten: *.doc;*.zip;*.exe\nUitsluiten: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Initialiseren van de prullenbak is mislukt. It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Het was niet mogelijk de prullenbak te initialiseren!\n\nHet is waarschijnlijk dat u niet Windows gebruikt.\nAls u deze optie wel wilt, neem dan alstublieft contact op met de auteur. :) -Left: -Links: +Left +Links Load configuration from file Laad configuratie uit bestand Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Verplaats kolom naar beneden Move column up Verplaats kolom naar boven +Move files to a custom directory. +Verplaats bestanden naar een te kiezen locatie. +Move to custom directory +Verplaats naar een te kiezen locatie Moving %x to Recycle Bin %x aan het verplaatsen naar de Prullenbak +Moving %x to custom directory +Verplaatsen van %x naar gekozen locatie Not all items have been synchronized! Have a look at the list. Niet alle bestanden zijn gesynchroniseerd! Bekijk de lijst. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Kopiëer alstublieft \"Shadow.dll\" (locatie in \"Shadow.zip\" archief) naar de FreeFileSync installatiemap om het gebruik van deze optie mogelijk te maken Please fill all empty directory fields. Vul alstublieft aan beide kanten een pad in. +Please specify alternate directory for deletion! +Specificeer alstublieft een alternatieve locatie om te verwijderen! Press button to activate filter Druk op de knop om het filter te activeren. Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Vraag Quit Afsluiten +RealtimeSync - Automated Synchronization +RealtimeSync - Automatische Synchronisatie +RealtimeSync configuration +RealtimeSync configuratie Relative path Relatieve pad +Remove folder +Verwijder map Remove folder pair Verwijder 1 paar gekoppelde mappen +Report translation error +Rapporteer een fout in de vertaling Reset Reset Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Reset alle waarschuwingen? Result Resultaat -Right: -Rechts: +Right +Rechts S&ave configuration S&la de instellingen op S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Geef bestanden weer die naar de linkerkant worden gekopieerd Show files that will be copied to the right side Geef bestanden weer die naar de rechterkant worden gekopieerd +Show files that will be created on the left side +Geef bestanden weer die zullen worden aangemaakt aan de linkerkant +Show files that will be created on the right side +Geef bestanden weer die zullen worden aangemaakt aan de rechterkant +Show files that will be deleted on the left side +Geef bestanden weer die zullen worden verwijderd aan de linkerkant +Show files that will be deleted on the right side +Geef bestanden weer die zullen worden verwijderd aan de rechterkant Show files that won't be copied Geef bestanden weer die niet zullen worden gekopieerd Show popup @@ -660,12 +722,14 @@ Synchronizing... Aan het synchroniseren... System out of memory! Systeem heeft te weinig geheugen +Target directory already existing! + Target file already existing! Doelbestand bestaat al! The file does not contain a valid configuration: Het bestand bevat geen geldige configuratie: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Deze opdrachtregel wordt bij elke dubbelklik op een bestandsnaam uitgevoerd. %name doet dienst als plaatshouder voor het betreffende bestand. +This commandline will be executed on each doubleclick. The following macros are available: +Deze opdrachtregel zal worden uitgevoerd bij elke dubbele klik. De volgende macros zijn beschikbaar: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Deze variant ziet twee gelijknamige bestanden als gelijk wanneer ze dezelfde bestandsgrootte EN tijdstempel hebben. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Er bestaan onopgeloste conflicten! \n\nU kunt de conflicten negeren en doorgaan met synchroniseren. Update -> Overschrijven -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Uitleg: Selecteer locaties om te controleren en type een opdrachtregel. Elke keer dat bestanden worden aangepast binnen die locaties (en/of sublocaties) wordt de opdrachtregel uitgevoerd. Use Recycle Bin Gebruik de prullenbak -Use Recycle Bin when deleting or overwriting files during synchronization -Gebruik de prullenbak wanneer bestanden worden verwijderd of overschreven tijdens het synchroniseren +Use Recycle Bin when deleting or overwriting files. +Gebruik de prullenbak bij verwijderen of overschrijven van bestanden Variant Variant Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Waarschuwingen: When the comparison is started with this option set the following decision tree is processed: Wanneer met deze optie aan de vergelijking wordt gestart zal de volgende vergelijkingsboom worden gebruikt: +You can ignore the error to consider not existing directories as empty. +U kunt de fout negeren om niet bestaande locaties als leeg te beschouwen. You may try to synchronize remaining items again (WITHOUT having to re-compare)! U kunt proberen om de resterende bestanden opnieuw te synchroniseren (ZONDER opnieuw te hoeven vergelijken)! different verschillend file exists on both sides Bestand bestaat aan beide zijde -flash conflict\n -knipperen conflict\n on one side only alleen aan één kant -|> file on right side only\n -|> Bestand bestaat alleen aan de rechter kant\n diff --git a/BUILD/Languages/french.lng b/BUILD/Languages/french.lng index 94824d5b..47ce556d 100644 --- a/BUILD/Languages/french.lng +++ b/BUILD/Languages/french.lng @@ -20,8 +20,10 @@ min sec sec -!= files are different\n -!= les fichiers sont différents\n +%x / %y objects deleted successfully +%x / %y objets détruits avec succès +%x Percent +%x Pourcents %x directories %x dossiers %x files, @@ -48,6 +50,8 @@ &Créer un fichier de commandes &Default &Défaut +&Exit +&Quitter &Export file list &Exportation de la liste des fichiers &File @@ -72,6 +76,8 @@ &Pause &Quit &Quitter +&Restore +&Restaurer &Retry &Réessayer &Save @@ -80,20 +86,22 @@ &Oui , -- do not copy\n -- ne pas copier\n - conflict - conflit - conflict (same date, different size) - conflit (même date, taille différente) - different - fichiers différents +- directory part only +- seulement les répertoires - equal - fichiers identiques - exists left only - le fichier existe seulement à gauche - exists right only - le fichier existe seulement à droite +- full file or directory name +- nom complet du fichier ou du dossier - left - à gauche - left newer @@ -102,8 +110,10 @@ - à droite - right newer - fichier de droite plus récent --> copy to right side\n --> copier à droite\n +- sibling of %dir +- correspondance de %dir +- sibling of %name +- correspondance de %name -Open-Source file synchronization- -Synchronisation de fichiers Open-Source- . @@ -124,22 +134,12 @@ 2. Les caractères génériques '*' et '?' sont acceptés. 3. Exclude files directly on main grid via context menu. 3. Exclure les fichiers directement sur le tableau principal à l'aide du menu contextuel. -<- copy to left side\n -<- copier à gauche\n -<< left file is newer\n -<< le fichier de gauche est plus récent\n <Directory> <Répertoire> <Last session> <Dernière session> <multiple selection> <sélection multiple> -<| file on left side only\n -<| Le fichier existe seulement à gauche\n -== files are equal\n -== les fichiers sont identiques\n ->> right file is newer\n ->> le fichier de droite est plus récent\n A newer version of FreeFileSync is available: Une version plus récente de FreeFileSync est disponible : Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About A propos de Action Action +Add folder +Ajout d'un dossier Add folder pair Ajout d'un couple de dossiers All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Comme le nom le suggère, deux fichiers qui ont le même nom sont considérés comme identiques si, et seulement si, leur contenu est identique. Cette option est utile pour les contrôles de cohérence plutôt que pour les opérations de sauvegarde. Toutefois, les dates et heures ne sont pas du tout prises en compte.\n\nAvec cette option, l'arbre de décision est plus simple : Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Créer un fichier de commandespour une synchronisation automatique. Pour démarrer en mode batch, indiquer le nom du fichier à l'exécutable FreeFileSync : freefilesync.exe <fichier de commandes>. Ceci peut aussi être programmé dans le plannificateur de tâches. +Auto-adjust columns +Auto-ajustement des colonnes Batch execution Exécution du fichier de commandes Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Masquer les fichiers/répertoires filtrés Comma separated list Liste d'éléments séparés par une virgule +Commandline +Ligne de commande +Commandline is empty! +ligne de commande vide Compare Comparer Compare both sides @@ -202,6 +210,8 @@ Comparing content... Comparaison du contenu... Comparison Result Résultat de la comparaison +Comparison settings +Paramètres de comparaison Completed Terminé Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Copie le fichier %x vers %y avec écrasement Could not determine volume name for file: Impossible de trouver le nom de volume pour le fichier : -Could not set working directory: -Impossible de définir le répertoire de travail : +Could not initialize directory monitoring: +Impossible d'initialiser la surveillance des dossiers: +Could not read values for the following XML nodes: + Create a batch job Création du fichier de commandes Creating folder %x @@ -256,12 +268,18 @@ Custom Personnaliser Customize columns Personnaliser les colonnes +Customize... +Personnaliser... DECISION TREE ARBRE DE DECISION Data remaining: Données restantes : Date Date +Delay +délai +Delay between two invocations of the commandline +délai entre deux requêtes de la ligne de commande Delete files/folders existing on left side only Suppression des fichiers/répertoires n'existant que sur le côté gauche Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Suppression des deux côtés Delete on both sides even if the file is selected on one side only Suppression des deux côtés même si le fichier est sélectionné d'un seul côté +Delete or overwrite files permanently. +Supprimer ou écraser les fichiers définitivement. +Delete permanently +Suppression définitive Deleting file %x Suppression du fichier %x Deleting folder %x Suppression du dossier %x +Deletion handling +Festion des suppressions Directories are dependent! Be careful when setting up synchronization rules: Les dossiers sont imbriqués ! Attention à la mise à jour des règles de synchronisation : +Directories to watch +Dossiers à surveiller Directory Répertoire Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization Activer le filtrage pour exclure les fichiers de la synchronisation +Endless loop when traversing directory: +Boucle sans fin lors de la sucration du dossier Error Erreur Error changing modification time: @@ -324,6 +352,10 @@ Error handling Erreur de gestion de fichiers Error loading library function: Erreur lors du chargement de la bibliothèque de fonctions : +Error moving directory: +Erreur lors du déplacement du dossier : +Error moving file: +Erreur lors du déplacement du fichier : Error moving to Recycle Bin: Erreur lors du déplacement dans la corbeille : Error opening file: @@ -336,12 +368,12 @@ Error reading file: Erreur lors de la lecture du fichier : Error resolving symbolic link: Erreur lors de la résolution du lien symbolique : -Error retrieving full path: -Erreur lors de la recherche du chemin : Error starting Volume Shadow Copy Service! Erreur lors du démarrage du service 'Volume Shadow Copy' ! Error traversing directory: Erreur lors du parcours du répertoire : +Error when monitoring directories. +Erreur lors de la surveillance des dossiers. Error writing file attributes: Erreur lors de l'écriture des attributs du fichier : Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Masquer les fichiers qui seront copiés à gauche Hide files that will be copied to the right side Masquer les fichiers qui seront copiés à droite +Hide files that will be created on the left side +Masquer les fichiers qui seront créés à gauche +Hide files that will be created on the right side +Masquer les fichiers qui seront créés à droite +Hide files that will be deleted on the left side +Masquer les fichiers qui seront supprimés à gauche +Hide files that will be deleted on the right side +Masquer les fichiers qui seront supprimés à droite Hide files that won't be copied Masquer les fichiers qui ne seront pas copiés Hide filtered items Masquer les éléments filtrés Hide further error messages during the current process Masquer les messages d'erreur suivants pendant le traitement -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Masquer les messages d'erreur pendant la synchronisation :\nIls sont collationnés et listés à la fin de l'opération Hints: Conseils : Homepage @@ -486,8 +524,8 @@ Include Inclure Include temporarily Inclure temporairement -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Inclure : *.doc;*.zip;*.exe\nExclure : \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Inclure : *.doc;*.zip;*.exe\nExclure : temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Erreur lors de l'initialisation de la corbeille ! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Impossible d'accéder à la corbeille !\n\nIl est probable que vous n'utilisez pas Windows.\nSi vous désirez utilisee cette fonctionnalité, veuillez contacter l'auteur. :) -Left: -Gauche : +Left +Gauche Load configuration from file Charger la configuration à partir du fichier Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Déplacer la colonne vers le bas Move column up Déplacer la colonne vers le haut +Move files to a custom directory. +Déplacer les fichiers dans un dossier personnel +Move to custom directory +Déplacer dans un dossier personnel Moving %x to Recycle Bin Déplacement de %x vers la Corbeille +Moving %x to custom directory +Déplacement de %x dans un dossier personnel Not all items have been synchronized! Have a look at the list. Tout n'a pas été synchronisé ! Vérifiez la liste. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Veuillez copier le fichier \"Shadow.dll\" (situé dans l'archive \"Shadow.zip\") vers le répertoire d'installation de FreeFileSync pour utiliser cette fonctionnalité. Please fill all empty directory fields. Veuillez remplir tous les champs vides du répertoire. +Please specify alternate directory for deletion! +Spécifiez un autre dossier pour les suppressions ! Press button to activate filter Cliquez pour activer le filtrage Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Question Quit Quitter +RealtimeSync - Automated Synchronization +RealtimeSync - Synchronisation Automatisée +RealtimeSync configuration +RealtimeSync configuration Relative path Chemin +Remove folder +Supprimer le dossier Remove folder pair Supprimer le couple de dossiers +Report translation error +Etat d'erreurs de transfert Reset Réinitialiser Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Réinitialiser tous les avertissements ? Result Situation -Right: -Droite : +Right +Droite S&ave configuration S&auvegarder la configuration S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Afficher les ficgier qui seront copiés à gauche Show files that will be copied to the right side Afficher les ficgier qui seront copiés à droite +Show files that will be created on the left side +Afficher les ficgier qui seront créés à gauche +Show files that will be created on the right side +Afficher les ficgier qui seront créés à droite +Show files that will be deleted on the left side +Afficher les ficgier qui seront supprimiés à gauche +Show files that will be deleted on the right side +Afficher les ficgier qui seront supprimiés à droite Show files that won't be copied Afficher les ficgier qui ne seront pas copiés Show popup @@ -660,12 +722,14 @@ Synchronizing... Synchronisation en cours... System out of memory! Erreur mémoire système ! +Target directory already existing! + Target file already existing! Le fichier de destination existe déjà ! The file does not contain a valid configuration: Le fichier ne contient pas de configuration valide : -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Cette ligne de commandes sera exécutée chaque fois que vous double-cliquerez sur un fichier. %name sert d'emplacement pour le fichier sélectionné. +This commandline will be executed on each doubleclick. The following macros are available: +Cette ligne de commande sera éxécutée sur chaque double clic. Les macros suivnates sont valides : This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Cette variante définit comme identiques deux fichiers de même nom lorsqu'ils ont la même taille et le même date et heure de modification. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Il y a des conflits non résolus !\n\nVous pouvez ignorer ces conflits et continuer la synchronisation. Update -> Mise à Jour -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Utilisation : Choisir un dossier et entrer une ligne de commande. A chaque fois qu'un fichier est modifié dans ces dossiers (ou sous-dossiers), la ligne de commande est éxécutée. Use Recycle Bin Utilisation de la corbeille -Use Recycle Bin when deleting or overwriting files during synchronization -Utilisation de la corbeille lors de la suppression ou du remplacement des fichiers pendant la synchronisation +Use Recycle Bin when deleting or overwriting files. +Utiliser la Corbeille lors de la suppression ou du remplacement d'un fichier. Variant Variante Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Avertissements : When the comparison is started with this option set the following decision tree is processed: Lorsque la comparaison démarre avec cette option, l'arbre de décision suivant est exécuté : +You can ignore the error to consider not existing directories as empty. +Vous pouvez ignorer l'erreur considérant qu'un dossier inexistant est vide. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Vous pouvez essayer de synchroniser à nouveau les éléments restants (SANS avoir à les re-comparer) ! different fichiers différents file exists on both sides Le fichier existe des deux côtés -flash conflict\n -flash conflit\n on one side only Le fichier existe sur un seul côté seulement -|> file on right side only\n -|> Le fichier existe seulement à droite\n diff --git a/BUILD/Languages/german.lng b/BUILD/Languages/german.lng index 08ceea4b..3e801fc0 100644 --- a/BUILD/Languages/german.lng +++ b/BUILD/Languages/german.lng @@ -20,8 +20,10 @@ Min. sec Sek. -!= files are different\n -!= Dateien sind verschieden\n +%x / %y objects deleted successfully +%x von %y Objekten erfolgreich gelöscht +%x Percent +%x Prozent %x directories %x Verzeichnisse %x files, @@ -48,6 +50,8 @@ &Batch-Job erstellen &Default &Standard +&Exit +&Beenden &Export file list Dateiliste e&xportieren &File @@ -72,6 +76,8 @@ Konfiguration &laden &Pause &Quit &Beenden +&Restore +&Wiederherstellen &Retry &Wiederholen &Save @@ -80,20 +86,22 @@ Konfiguration &laden &Ja , . -- do not copy\n -- nicht kopieren\n - conflict - Konflikt - conflict (same date, different size) - Konflikt (gleiches Datum, unterschiedliche Größe) - different - verschieden +- directory part only +- nur Verzeichnisanteil - equal - gleich - exists left only - existiert nur links - exists right only - existiert nur rechts +- full file or directory name +- kompletter Datei oder Verzeichnisname - left - links - left newer @@ -102,8 +110,10 @@ Konfiguration &laden - rechts - right newer - rechts neuer --> copy to right side\n --> nach rechts kopieren\n +- sibling of %dir +- Gegenstück zu %dir +- sibling of %name +- Gegenstück zu %name -Open-Source file synchronization- -Open-Source Datei-Synchronisation- . @@ -124,22 +134,12 @@ Konfiguration &laden 2. Die Platzhalter '*' und '?' werden unterstützt. 3. Exclude files directly on main grid via context menu. 3. Dateien können direkt über das Kontextmenü im Hauptfenster ausgeschlossen werden. -<- copy to left side\n --> nach links kopieren\n -<< left file is newer\n -<< Linke Datei ist neuer\n <Directory> <Verzeichnis> <Last session> <Letzte Sitzung> <multiple selection> <Mehrfachauswahl> -<| file on left side only\n -<| Datei existiert nur links\n -== files are equal\n -== Dateien sind gleich\n ->> right file is newer\n ->> Rechte Datei ist neuer\n A newer version of FreeFileSync is available: Eine neuere Version von FreeFileSync ist verfügbar: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About Ãœber Action Aktion +Add folder +Verzeichnis hinzufügen Add folder pair Verzeichnispaar hinzufügen All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Wie der Name andeutet, werden zwei Dateien mit gleichem Namen genau dann als gleich angesehen, wenn sie den gleichen Dateiinhalt haben. Diese Einstellung ist eher für Konsistenzprüfungen geeignet als für Backup-Operationen. Aus diesem Grund wird der Zeitpunkt der letzten Änderung der Dateien nicht berücksichtigt.\n\nDer Entscheidungsbaum ist in diesem Fall kleiner: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Erzeuge eine Batchdatei für die automatisierte Synchronisation. Um den Batch-Modus zu starten, muss nur der Dateiname an die Programmdatei übergeben werden: FreeFileSync.exe <Batchdatei>. Dies kann auch in den Taskplaner des Betriebssystems eingetragen werden. +Auto-adjust columns +Spalten automatisch anpassen Batch execution Batchlauf Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Gefilterte Dateien bzw. Verzeichnisse ein-/ausblenden Comma separated list Kommagetrennte Liste +Commandline +Kommandozeile +Commandline is empty! +Die Kommandozeile ist leer! Compare Vergleichen Compare both sides @@ -202,6 +210,8 @@ Comparing content... Vergleiche Dateiinhalt... Comparison Result Ergebnis des Vergleichs +Comparison settings +Vergleichseinstellungen Completed Fertig Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Kopiere Datei %x nach %y und überschreibe Ziel Could not determine volume name for file: Der Laufwerksname für folgende Datei konnte nicht ermittelt werden: -Could not set working directory: -Das Arbeitsverzeichnis konnte nicht gesetzt werden: +Could not initialize directory monitoring: +Die Verzeichnisüberwachung konnte nicht gestartet werden: +Could not read values for the following XML nodes: +Die folgenden XML Knoten konnten nicht gelesen werden: Create a batch job Batch-Job erstellen Creating folder %x @@ -256,12 +268,18 @@ Custom Eigene Customize columns Spalten anpassen +Customize... +Anpassen... DECISION TREE ENTSCHEIDUNGSBAUM Data remaining: Verbliebene Daten: Date Datum +Delay +Verzögerung +Delay between two invocations of the commandline +Verzögerung zwischen zwei Aufrufen der Kommandozeile Delete files/folders existing on left side only Nur links existierende Dateien/Verzeichnisse löschen Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Auf beiden Seiten löschen Delete on both sides even if the file is selected on one side only Lösche auf beiden Seiten, auch wenn die Datei nur auf einer Seite markiert ist +Delete or overwrite files permanently. +Dateien endgültig löschen oder überschreiben. +Delete permanently +Endgültig löschen Deleting file %x Lösche Datei %x Deleting folder %x Lösche Verzeichnis %x +Deletion handling +Behandlung von Löschungen Directories are dependent! Be careful when setting up synchronization rules: Die Verzeichnisse sind voneinander abhängig! Achtung beim Festlegen der Synchronisationseinstellungen: +Directories to watch +Zu überwachende Verzeichnisse Directory Verzeichnis Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization Aktiviere Filter, um Dateien von der Synchronisation auszuschließen +Endless loop when traversing directory: +Endlosschleife beim Lesen des Verzeichnisses: Error Fehler Error changing modification time: @@ -324,24 +352,28 @@ Error handling Fehlerbehandlung Error loading library function: Fehler beim Laden der Bibliotheksfunktion: +Error moving directory: +Fehler beim Verschieben des Verzeichnisses: +Error moving file: +Fehler beim Verschieben der Datei: Error moving to Recycle Bin: Fehler beim Verschieben in den Papierkorb: Error opening file: Fehler beim Öffnen der Datei: Error parsing configuration file: -Fehler beim Lesen der Konfigurationsdatei: +Fehler beim Auswerten der Konfigurationsdatei: Error reading file attributes: Fehler beim Lesen der Dateiattribute: Error reading file: Fehler beim Lesen der Datei: Error resolving symbolic link: Fehler beim Auflösen des Symbolischen Links: -Error retrieving full path: -Fehler beim Ermitteln des kompletten Pfades: Error starting Volume Shadow Copy Service! Fehler beim Starten des Volume Shadow Copy Service! Error traversing directory: Fehler beim Durchsuchen des Verzeichnisses: +Error when monitoring directories. +Fehler beim Ãœberwachen der Verzeichnisse. Error writing file attributes: Fehler beim Schreiben der Dateiattribute: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Dateien die nach links kopiert werden ausblenden Hide files that will be copied to the right side Dateien die nach rechts kopiert werden ausblenden +Hide files that will be created on the left side +Dateien die links erstellt werden ausblenden +Hide files that will be created on the right side +Dateien die rechts erstellt werden ausblenden +Hide files that will be deleted on the left side +Dateien die links gelöscht werden ausblenden +Hide files that will be deleted on the right side +Dateien die rechts gelöscht werden ausblenden Hide files that won't be copied Dateien die nicht kopiert werden ausblenden Hide filtered items Gefilterte Elemente ausblenden Hide further error messages during the current process Weitere Fehlermeldungen während des laufenden Prozesses ausblenden -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Verhindert das Anzeigen von Fehlermeldungen während der Synchronisation:\nSie werden jedoch gesammelt und am Ende als Liste angezeigt Hints: Tipps: Homepage @@ -486,8 +524,8 @@ Include Einschließen Include temporarily Temporär einschließen -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Einschließen: *.doc;*.zip;*.exe\nAusschließen: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Einschließen: *.doc;*.zip;*.exe\nAusschließen: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Die Initialisierung des Papierkorbs ist fehlgeschlagen! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Die Papierkorbfunktion steht nicht zur Verfügung!\n\nWahrscheinlich benutzen Sie nicht Microsoft Windows.\nWenn Sie diese Funktion wirklich benötigen, kontaktieren Sie bitte den Autor. :) -Left: -Links: +Left +Links Load configuration from file Konfiguration aus Datei laden Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Spalte nach unten verschieben Move column up Spalte nach oben verschieben +Move files to a custom directory. +Verschiebe Dateien in ein benutzerdefiniertes Verzeichnis. +Move to custom directory +In eigenes Verzeichnis verschieben Moving %x to Recycle Bin Verschiebe %x in den Papierkorb +Moving %x to custom directory +Verschiebe %x in eigenes Verzeichnis Not all items have been synchronized! Have a look at the list. Nicht alle Elemente wurden synchronisiert! Siehe verbliebene Elemente im Hauptfenster. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Um diese Funktionalität zu aktivieren, bitte die entsprechende Datei \"Shadow.dll\" (siehe Archiv \"Shadow.zip\") in das FreeFileSync Installationsverzeichnis kopieren. Please fill all empty directory fields. Bitte die leeren Verzeichnisfelder füllen. +Please specify alternate directory for deletion! +Bitte ein alternatives Löschverzeichnis angeben! Press button to activate filter Taste drücken, um Filter zu aktivieren Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Frage Quit Beenden +RealtimeSync - Automated Synchronization +RealtimeSync - Automatisierte Synchronisation +RealtimeSync configuration +RealtimeSync Konfiguration Relative path Relativer Pfad +Remove folder +Verzeichnis entfernen Remove folder pair Verzeichnispaar entfernen +Report translation error +Ãœbersetzungsfehler melden Reset Zurücksetzen Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Sollen alle Warnmeldungen zurückgesetzt werden? Result Ergebnis -Right: -Rechts: +Right +Rechts S&ave configuration Konfiguration s&peichern S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Dateien die nach links kopiert werden anzeigen Show files that will be copied to the right side Dateien die nach rechts kopiert werden anzeigen +Show files that will be created on the left side +Dateien die links erstellt werden anzeigen +Show files that will be created on the right side +Dateien die rechts erstellt werden anzeigen +Show files that will be deleted on the left side +Dateien die links gelöscht werden anzeigen +Show files that will be deleted on the right side +Dateien die rechts gelöscht werden anzeigen Show files that won't be copied Dateien die nicht kopiert werden anzeigen Show popup @@ -660,12 +722,14 @@ Synchronizing... Synchronisiere... System out of memory! Zu wenig freier Arbeitsspeicher! +Target directory already existing! +Zielverzeichnis existiert bereits! Target file already existing! Die Zieldatei existiert bereits! The file does not contain a valid configuration: Die Datei enthält keine gültige Konfiguration: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Diese Kommandozeile wird bei jedem Doppelklick auf einen Dateinamen ausgeführt. %name dient dabei als Platzhalter für die ausgewählte Datei. +This commandline will be executed on each doubleclick. The following macros are available: +Diese Befehlszeile wird bei jeden Doppelklick ausgeführt. Dabei stehen die folgenden Makros zur Verfügung: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Diese Variante identifiziert zwei gleichnamige Dateien als gleich, wenn sie die gleiche Dateigröße haben UND der Zeitpunkt der letzten Änderung derselbe ist. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Es existieren ungelöste Konflikte! \n\nDie Konflikte können ignoriert und die Synchronisation fortgesetzt werden. Update -> Aktualisieren -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Verwendung: Die zu überwachenden Verzeichnisse auswählen und eine Kommandozeile angeben. Jedesmal wenn Dateien innerhalb dieser Verzeichnisse (oder Unterverzeichnisse) verändert werden, wird die Kommandozeile ausgeführt. Use Recycle Bin Papierkorb verwenden -Use Recycle Bin when deleting or overwriting files during synchronization -Papierkorb für zu löschende oder zu überschreibende Dateien nutzen +Use Recycle Bin when deleting or overwriting files. +Papierkorb für zu löschende oder zu überschreibende Dateien nutzen. Variant Variante Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Warnungen: When the comparison is started with this option set the following decision tree is processed: Wenn der Vergleich mit dieser Option gestartet wurde, wird folgender Entscheidungsbaum abgearbeitet: +You can ignore the error to consider not existing directories as empty. +Dieser Fehler kann ignoriert werden, um nicht existierende Verzeichnisse als leer anzusehen. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Verbliebene Elemente können nochmals synchronisiert werden (OHNE dass ein erneuter Vergleich notwendig ist)! different verschieden file exists on both sides Datei existiert auf beiden Seiten -flash conflict\n -Blitz Konflikt\n on one side only nur auf einer Seite -|> file on right side only\n -|> Datei existiert nur rechts\n diff --git a/BUILD/Languages/hungarian.lng b/BUILD/Languages/hungarian.lng index 6cf67623..0c1926c6 100644 --- a/BUILD/Languages/hungarian.lng +++ b/BUILD/Languages/hungarian.lng @@ -20,8 +20,10 @@ perc sec másodperc -!= files are different\n -!= a fájlok különböznek\n +%x / %y objects deleted successfully +%X / %Y objektum sikeresen törölve +%x Percent +%x százalék %x directories %x mappa %x files, @@ -33,7 +35,7 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! %x of 1 row in view %x sor látható az 1 sorból &Abort -&MegszakÃtás +&MegszakÃt &About... &A programról... &Advanced @@ -48,6 +50,8 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! &Kötegelt feladat létrehozása &Default &Alapértelmezett +&Exit +&Kilépés &Export file list &Fájllista exportálása &File @@ -72,6 +76,8 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! &Szünet &Quit &Kilépés +&Restore +&VisszaállÃtás &Retry &Ismét &Save @@ -80,20 +86,22 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! &Igen , . -- do not copy\n -- nem másolni\n - conflict - ütközés - conflict (same date, different size) - ütközés (ugyanaz a dátum, különbözÅ‘ méret) - different - különbözÅ‘ +- directory part only +- csak a mappa részét - equal - egyezik - exists left only - csak a bal oldalon létezik - exists right only - csak a jobb oldalon létezik +- full file or directory name +- teljes fájl- vagy mappanév - left - bal oldali - left newer @@ -102,8 +110,10 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! - jobb oldali - right newer - a jobb oldali újabb --> copy to right side\n --> másolni a jobb oldalra\n +- sibling of %dir +- a %dir gyermeke +- sibling of %name +- a %name gyermeke -Open-Source file synchronization- -NyÃlt forráskódú fájlszinkronizálás- . @@ -124,22 +134,12 @@ A(z) %x nem megfelelÅ‘ FreeFileSync kötegelt feladat fájl! 2. A csillag ('*') és a kérdÅ‘jel ('?') helyettesÃtÅ‘ karakterek megengedettek. 3. Exclude files directly on main grid via context menu. 3. Fájlok közvetlen kizárása a fÅ‘ listából helyi menü segÃtségével. -<- copy to left side\n -<- másolni a bal oldalra\n -<< left file is newer\n -<< a bal oldali fájl újabb\n <Directory> <Mappa> <Last session> <Utolsó munkamenet> <multiple selection> <többszörös kijelölés> -<| file on left side only\n -<| csak a bal oldalon lévÅ‘ fájl\n -== files are equal\n -== egyezÅ‘ fájlok\n ->> right file is newer\n ->> a jobb oldali fájl újabb\n A newer version of FreeFileSync is available: ElérhetÅ‘ a FreeFileSync egy újabb verziója: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About A programról Action Művelet +Add folder +Mappa hozzáadása Add folder pair Mappa pár megadása All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Ahogy a neve is mutatja, két fájl, melyeknek ugyanaz a nevük, akkor és csakis akkor lesz egyezÅ‘ként jelölve, ha a tartalmuk megegyezik. Ez az opció leginkább a konzisztencia-viszgálatokhoz jó, mintsem a biztonsági mentésekhez. Ãgy a fájlok dátuma nem számÃt semmit.\n\nEnnek az opciónak az engedélyezésével a döntési fa kisebb lesz: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Egy kötegelt feladat fájl létrehozása az automatizált szinkronizációhoz. Kötegelt feladat módban való indÃtáshoz egyszerűen meg kell adni a fájl nevét a FreeFileSync.exe-nek: FreeFileSync.exe <kötegelt feladat fájl>. Ezt ütemezni is lehet az operációs rendszer feladatkezelÅ‘jével. +Auto-adjust columns +Oszlopok automatikus igazÃtása Batch execution Kötegelt végrehajtás Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Szűrt fájlok/mappák elrejtése a listában Comma separated list Comma separated values +Commandline +Parancssor +Commandline is empty! +A parancssor üres! Compare ÖsszehasonlÃtás Compare both sides @@ -202,6 +210,8 @@ Comparing content... Tartalom összehasonlÃtása... Comparison Result Az összehasonlÃtás eredménye +Comparison settings +ÖsszehasonlÃtási beállÃtások Completed Befejezve Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target A(z) %x fájl másolása a(z) %y fájlba fölülÃrva a célt Could not determine volume name for file: A következÅ‘ fájlnak nem lehet meghatározni a kötetnevét: -Could not set working directory: -Munkamappa beállÃtása sikertelen: +Could not initialize directory monitoring: +A mappafigyelés inicializálása sikertelen: +Could not read values for the following XML nodes: + Create a batch job Kötegelt feladat létrehozása Creating folder %x @@ -256,12 +268,18 @@ Custom Egyedi Customize columns Oszlopok testreszabása +Customize... +Testreszabás... DECISION TREE DÖNTÉSI FA Data remaining: HátralévÅ‘ adat: Date Dátum +Delay +Várakozás +Delay between two invocations of the commandline +Két parancssor meghÃvása közötti várakozás Delete files/folders existing on left side only Csak a bal oldalon létezÅ‘ fájlok/mappák törlése Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Törlés mindkét oldalon Delete on both sides even if the file is selected on one side only Törlés mindkét oldalon, még akkor is, ha csak egyik oldalon lett kijelölve +Delete or overwrite files permanently. +A fájlok folyamatos törlése vagy felülÃrása. +Delete permanently +Folyamatosan törölni Deleting file %x Fájl törlése %x Deleting folder %x Mappa törlése %x +Deletion handling +Törlések kezelése Directories are dependent! Be careful when setting up synchronization rules: A mappák függenek egymástól! Legyen óvatos, amikor megadja a szinkronizálási szabályokat: +Directories to watch +FigyelendÅ‘ mappák Directory Mappa Directory does not exist: @@ -306,6 +332,8 @@ Email E-mail Enable filter to exclude files from synchronization SzűrÅ‘ engedélyezése fájlok a szinkronizációból való kizárásához +Endless loop when traversing directory: +Végtelen hurok a mappák bejárásakor: Error Hiba Error changing modification time: @@ -324,6 +352,10 @@ Error handling Hibakezelés Error loading library function: A könyvtári funkció betöltése sikertelen: +Error moving directory: +Hiba a mappa mozgatásakor: +Error moving file: +Hiba a fájl mozgatásakor: Error moving to Recycle Bin: A Lomtárba (Recycle Bin) mozgatás sikertelen: Error opening file: @@ -336,12 +368,12 @@ Error reading file: A fájl olvasása sikertelen: Error resolving symbolic link: A szimbolikus link feloldása sikertelen: -Error retrieving full path: -A teljes elérési útvonal meghatározása sikertelen: Error starting Volume Shadow Copy Service! Hiba történt a Volume Shadow Copy szolgáltatás indÃtása közben! Error traversing directory: A mappa átnézése sikertelen: +Error when monitoring directories. +Hiba történt a mappák figyelése közben. Error writing file attributes: A fájl attribútumainak Ãrása sikertelen: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side A bal oldalra másolandó fájlok elrejtése Hide files that will be copied to the right side A jobb oldalra másolandó fájlok elrejtése +Hide files that will be created on the left side +A bal oldalon létrehozandó fájlok elrejtése. +Hide files that will be created on the right side +A jobb oldalon létrehozandó fájlok elrejtése. +Hide files that will be deleted on the left side +A bal oldalon törlendÅ‘ fájlok elrejtése. +Hide files that will be deleted on the right side +A jobb oldalon törlendÅ‘ fájlok elrejtése. Hide files that won't be copied A nem másolandó fájlok elrejtése Hide filtered items A szűrt elemek elrejtése Hide further error messages during the current process A további hibaüzenetek elrejtése az aktuális folyamat során -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Hibaüzenetek elrejtése szinkronizálás közben:\nÖssze lesznek gyűjtve és a folyamat végén meg lesznek jelenÃtve egy listában Hints: Tippek: Homepage @@ -486,8 +524,8 @@ Include Csatol Include temporarily Ideiglenesen tartalmaz -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Csatol: *.doc;*.zip;*.exe\nKizár: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Csatol: *.doc;*.zip;*.exe\nKizár: temp\\* Info Információ Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! A Lomtár (Recycle Bin) inicializálása sikertelen! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Lehetetlen a Lomtár (Recycle Bin) inicializálása!\n\nValószÃnűleg azért, mert nem Windost használ.\nHa szeretné ezt a funkciót használni, kérjük, lépjen kapcsolatba a szerzÅ‘vel. :) -Left: -Bal oldal: +Left +Bal oldal Load configuration from file BeállÃtások betöltése fájlból Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Oszlop mozgatása lefelé Move column up Oszlop mozgatása felfelé +Move files to a custom directory. +Fájlok mozgatása egyedi mappába. +Move to custom directory +Mozgatás egyedi mappába Moving %x to Recycle Bin %x mozgatása a Lomtárba +Moving %x to custom directory +%x mozgatása egyedi mappába Not all items have been synchronized! Have a look at the list. Nem minden elem szinkronizálódott! Tekintsd meg a listát. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Ennek a funkciónak a használatához, kérjük, másold a megfelelÅ‘ \"Shadow.dll\" fájlt (megtalálható a \"Shadow.zip\" archÃvumban) abba a mappába, amelybe a FreeFileSync-et telepÃtetted. Please fill all empty directory fields. Kérjük, töltse ki az összes üres mappa mezÅ‘t. +Please specify alternate directory for deletion! +Kérjük, adjon meg egy alternatÃv mappát a törléshez! Press button to activate filter Nyomja meg a gombot a szűrÅ‘ aktiválásához Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Kérdés Quit Kilépés +RealtimeSync - Automated Synchronization +RealtimeSync - Automatikus szinkronizálás +RealtimeSync configuration +RealtimeSync beállÃtások Relative path RelatÃv útvonal +Remove folder +Mappa eltávolÃtása Remove folder pair Mappa párok eltávolÃtása +Report translation error +FordÃtói hiba bejelentése Reset HelyreállÃtás Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? HelyreállÃtja az összes figyelmeztetÅ‘ üzenetet? Result Eredmény -Right: -Jobb oldal: +Right +Jobb oldal S&ave configuration BeállÃtások mentés&e S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side A bal oldalra másolandó fájlok mutatása Show files that will be copied to the right side A jobb oldalra másolandó fájlok mutatása +Show files that will be created on the left side +A bal oldalon létrehozandó fájlok mutatása. +Show files that will be created on the right side +A jobb oldalon létrehozandó fájlok mutatása. +Show files that will be deleted on the left side +A bal oldalon törlendÅ‘ fájlok mutatása. +Show files that will be deleted on the right side +A jobb oldalon törlendÅ‘ fájlok mutatása. Show files that won't be copied A nem másolandó fájlok mutatása Show popup @@ -660,12 +722,14 @@ Synchronizing... Szinkronizálás folyamatban... System out of memory! Nincs elég rendszermemória! +Target directory already existing! + Target file already existing! A célként megadott fájl már létezik! The file does not contain a valid configuration: A következÅ‘ fájl nem tartalmaz érvényes beállÃtásokat: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Ez a parancssor lesz végrehajtva minden fájlnéven történÅ‘ dupla kattintás esetében. %name helyettesÃti a kiválasztott fájlt. +This commandline will be executed on each doubleclick. The following macros are available: +Ez a parancssor fog végrehajtódni minden dupla kattintásnál. A következÅ‘ makrók elérhetÅ‘ek: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Ez a változat akkor tekint egyezÅ‘nek két azonos nevű fájlt, ha azok mérete ÉS az utolsó módosÃtásuk ideje azonos. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Feloldatlan ütközések vannak! \n\nFigyelmen kÃvül hagyhatod az ütközéseket és folytathatod a szinkronizálást. Update -> FrissÃtés -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Használat: Válassza ki a figyelendÅ‘ mappákat és adjon meg egy parancssort. Minden alkalommal, amikor az adott mappákon (vagy almappákon) belül megváltoznak a fájlok, a parancssor végrehajtásra kerül. Use Recycle Bin Lomtár (Recycle Bin) használata -Use Recycle Bin when deleting or overwriting files during synchronization -A Lomtár (Recycle Bin) használata fájlok szinkronizálása közbeni törlésnél vagy felülÃrásnál +Use Recycle Bin when deleting or overwriting files. +A Lomtár használata fájlok törlésénél vagy felülÃrásánál. Variant Variáns Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Figyelem: When the comparison is started with this option set the following decision tree is processed: Ha az összehasonlÃtás ezekkel a beállÃtásokkal lesz elindÃtva, akkor a következÅ‘ döntési fa érvényesül: +You can ignore the error to consider not existing directories as empty. +Figyelmen kÃvül hagyhatja a hibákat a nem létezÅ‘ mappákat üresnek tekintve. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Meg lehet próbálni újra a megmaradt elemek szinkronizálását (az összehasonlÃtás újbóli elvégzése NÉLKÃœL)! different különbözÅ‘ file exists on both sides mindkét oldalon létezÅ‘ fájlok -flash conflict\n -jelzés ütközés\n on one side only csak az egy oldalon létezÅ‘ fájlok -|> file on right side only\n -|> csak a jobb oldali fájl\n diff --git a/BUILD/Languages/italian.lng b/BUILD/Languages/italian.lng index 8a1f1332..472a17cf 100644 --- a/BUILD/Languages/italian.lng +++ b/BUILD/Languages/italian.lng @@ -20,8 +20,10 @@ min sec sec -!= files are different\n -!= i file sono diversi\n +%x / %y objects deleted successfully +%x / %y oggetti cancellati con successo +%x Percent +%x Percento %x directories %x cartelle %x files, @@ -48,6 +50,8 @@ &Crea un job in batch &Default &Default +&Exit +&Esci &Export file list &Esporta la lista dei file &File @@ -72,6 +76,8 @@ &Pausa &Quit &Esci +&Restore +&Ripristina &Retry &Riprova &Save @@ -80,20 +86,22 @@ &Si , , -- do not copy\n -- non copiare\n - conflict - conflitto - conflict (same date, different size) - conflitto (stessa data, dimensione diversa) - different - file diversi +- directory part only +- solo parte di directory - equal - file identici - exists left only - il file esiste solo a sinistra - exists right only - il file esiste solo a destra +- full file or directory name +- file completo o nome directory - left - a sinistra - left newer @@ -102,8 +110,10 @@ - a destra - right newer - file di destra più recente --> copy to right side\n --> copia sul lato destro\n +- sibling of %dir +- fratello di %dir +- sibling of %name +- fratello di %name -Open-Source file synchronization- -Sincronizzazione Open-Source- . @@ -124,22 +134,12 @@ 2. Sono ammessi i caratteri generici '*' e '?'. 3. Exclude files directly on main grid via context menu. 3. Escludi i file direttamente sulla griglia principale tramite il menu contestuale. -<- copy to left side\n -<- copia sul lato sinistro\n -<< left file is newer\n -<< il file di sinistra è più recente\n <Directory> <Directory> <Last session> <Ultima sessione> <multiple selection> <selezione multipla> -<| file on left side only\n -<| il file esiste solo a sinistra\n -== files are equal\n -== i file sono uguali\n ->> right file is newer\n ->> il file di destra è più recente\n A newer version of FreeFileSync is available: E' disponibile una nuova versione di FreeFileSync: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About A proposito di Action Azioni +Add folder +Aggiungi cartella Add folder pair Aggiungi una coppia di cartelle All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Come suggerisce il nome, due file con lo stesso nome sono considerati come identici se, e solamente se, il loro contenuto è identico. Questa opzione è utile sia per i contrlli di coerenza che per le operazioni di backup. Tuttavia, data e ora vengono ignorate.\n\nAbilitando questa opzione l'albero delle decisioni è semplificato: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Componi un file batch per la sincronia automatica. Per partire in modalità batch fai semplicemente seguire il nome del file all'eseguibile di FreeFileSync: FreeFileSync.exe <nomefilebatch>. Puoi anche schedulare l'operazione nelle operazioni pianificate del sistema operativo. +Auto-adjust columns +Larghezza automatica colonne Batch execution Esecuzione in batch Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Nascondi i files/directories dalla lista Comma separated list Lista di elementi separati da virgola +Commandline +Linea di comando +Commandline is empty! +La linea di comando è vuota! Compare Compara Compare both sides @@ -202,6 +210,8 @@ Comparing content... Comparazione contenuto... Comparison Result Risultato della comparazione +Comparison settings +Impostazioni di comparazione Completed Completato Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Copia file %x su %y sovrascrivendo la destinazione Could not determine volume name for file: Impossibile determinare il nome volume per il file: -Could not set working directory: -Impossibile definire la directory di lavoro: +Could not initialize directory monitoring: +Monitoraggio directory non inizializzabile: +Could not read values for the following XML nodes: + Create a batch job Creazione di un job batch Creating folder %x @@ -256,12 +268,18 @@ Custom Personalizza Customize columns Personalizza colonne +Customize... +Personalizza... DECISION TREE ALBERO DELLE DECISIONI Data remaining: Dati rimanenti: Date Data +Delay +Ritardo +Delay between two invocations of the commandline +Ritardo tra due richieste nella lina di comando Delete files/folders existing on left side only Elimina files/cartelle esistenti solo a sinistra Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Cancella su entrambi i lati Delete on both sides even if the file is selected on one side only Cancella su entrambi i lati anche se il file è selezionato su un solo lato. +Delete or overwrite files permanently. +Cancella o sovrascrivi file definitivamente. +Delete permanently +Cancella definitivamente Deleting file %x Eliminazione file %x Deleting folder %x Eliminazione cartella %x +Deletion handling +Gestione cancellazione Directories are dependent! Be careful when setting up synchronization rules: Le directory sono dipendenti! Fai attenzione quando configuri le regole di sincronizzazione: +Directories to watch +Directory da controllare Directory Directory Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization Abilita il filtro per escludere files dalla sincronizzazione +Endless loop when traversing directory: +Loop senza fine attraverso le directory: Error Errore Error changing modification time: @@ -321,9 +349,13 @@ Errore durante l'eliminazione delle directory: Error deleting file: Errore durante l'eliminazione del file: Error handling -Errore nella gestione +Gestione degli errori Error loading library function: Errore nel caricamento della funzione libreria: +Error moving directory: +Errore nello spostamento directory: +Error moving file: +Errore nello spostamento file: Error moving to Recycle Bin: Errore durante lo spostamento nel Cestino: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Errore durante la lettura del file: Error resolving symbolic link: Errore nella risoluzione di collegamento simbolico: -Error retrieving full path: -Errore nel reperire il percorso completo: Error starting Volume Shadow Copy Service! Errore in avvio del Servizio Volume Shadow Copy! Error traversing directory: Errore nel percorso della directory: +Error when monitoring directories. +Errore durante il monitoraggio directory. Error writing file attributes: Errore nella scrittura degli attributi file: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Nascondi i file da copiare sul lato sinistro Hide files that will be copied to the right side Nascondi i file da copiare sul lato destro +Hide files that will be created on the left side +Nascondi i file che verranno creati sul lato sinistro +Hide files that will be created on the right side +Nascondi i file che verranno creati sul lato destro +Hide files that will be deleted on the left side +Nascondi i file che verranno cancellati sul lato sinistro +Hide files that will be deleted on the right side +Nascondi i file che verranno cancellati sul lato destro Hide files that won't be copied Nascondi i file che non saranno copiati Hide filtered items Nascondi gli elementi filtrati Hide further error messages during the current process Non mostrare i successivi messaggi d'errore durante il processo corrente -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Non mostrare i messaggi d'errore durante la sincronizzazione:\nVerranno raccolti e mostrati alla fine del processo Hints: Consigli: Homepage @@ -486,8 +524,8 @@ Include Includi Include temporarily Includi temporaneamente -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Includi: *.doc;*.zip;*.exe\nEscludi: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Includi: *.doc;*.zip;*.exe\nEscludi: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Inizializzazione del Cestino fallita! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Impossibile inizializzare il Cestino!\n\nE'probabile che non si stia utilizzando Windows.\nSe si vuole usare questa funzionalità , contattare l'autore. :) -Left: -Sinistra: +Left +Sinistra Load configuration from file Carica configurazione da file Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Sposta colonna giu' Move column up Sposta colonna su' +Move files to a custom directory. +Sposta i file in una directory personalizzata. +Move to custom directory +Sposta in una directory personalizzata Moving %x to Recycle Bin Spostamento di %x nel Cestino +Moving %x to custom directory +Spostamento di %x in diretcory personalizzata Not all items have been synchronized! Have a look at the list. Non tutti gli oggetti sono stati sincronizzati! Controlla la lista. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Per abilitare questa funzione è necessario copiare l'appropriata \"Shadow.dll\" (che si trova nell'archivio \"Shadow.zip\") nella directory di installazione di FreeFileSync. Please fill all empty directory fields. Compilare tutti i campi di directory vuoti. +Please specify alternate directory for deletion! +Prego specificare una directory alternativa per la cancellazione! Press button to activate filter Cliccare per attivare il filtro Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Domanda Quit Esci +RealtimeSync - Automated Synchronization +RealtimeSync - Sincronizzazione Automatizzata +RealtimeSync configuration +Configurazione di RealtimeSync Relative path Percorso relativo +Remove folder +Rimuovi cartella Remove folder pair Elimina la coppia di cartelle +Report translation error +Segnala errori di traduzione Reset Reset Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Resettare tutti i messaggi d'avviso? Result Risultato -Right: -Destra: +Right +Destra S&ave configuration S&alva la configurazione S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Mostra file da copiare sul lato sinistro Show files that will be copied to the right side Mostra file da copiare sul lato destro +Show files that will be created on the left side +Mostra file che verranno creati sul lato sinistro +Show files that will be created on the right side +Mostra file che verranno creati sul lato destro +Show files that will be deleted on the left side +Mostra file che verranno cancellati sul lato sinistro +Show files that will be deleted on the right side +Mostra file che verranno cancellati sul lato destro Show files that won't be copied Mostra file che non saranno copiati Show popup @@ -660,12 +722,14 @@ Synchronizing... Sincronizzazione in corso... System out of memory! Memoria di sistema esaurita! +Target directory already existing! +Directory di destinazione già esistente! Target file already existing! File destinazione già esistente! The file does not contain a valid configuration: Il file non contiene una configurazione valida -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Questa riga di comando verrà eseguita ad ogni doppio click sul nome di un file. %name é lo spazio riservato per il file selezionato. +This commandline will be executed on each doubleclick. The following macros are available: +Questa linea di comando verrà eseguita ad ogni doppio-click. Sono disponibili le seguenti macro: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Questa variante definisce identici due file con lo stesso nome quando hanno la stessa dimensione E la stessa data e ora. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Sono presenti conflitti irrisolti! \n\nPuoi ignorare i conflitti e continuare la sincronizzazione. Update -> Aggiorna -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Uso: Seleziona le directory da monitorare e inserisci una linea di comando. Ogni volta che i file vengono modificati in queste directory (o sotto-directory) la linea di comando verrà eseguita. Use Recycle Bin Usa il Cestino -Use Recycle Bin when deleting or overwriting files during synchronization -Usa il Cestino quando si cancella o sovrascrivono file durante la sincronizzazione +Use Recycle Bin when deleting or overwriting files. +Usa il Cestino quando si cancella o sovrascrive un file. Variant Variante Volume name %x not part of filename %y! @@ -709,18 +775,16 @@ Attenzione Warning: Synchronization failed for %x item(s): Attenzione: Sincronizzazione fallita per %x elementi: Warnings: -Attenzione: +Avvisi: When the comparison is started with this option set the following decision tree is processed: Quando questo set di opzioni viene selezionato per la comparazione viene processato il seguente albero di decisioni: +You can ignore the error to consider not existing directories as empty. +Puoi ignorare l'errore per considerare directory inesistenti come vuote. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Puoi provare a sincronizzare di nuovo gli elementi restanti (SENZA doverli ri-comparare) ! different file differenti file exists on both sides file esistente su entrambi i lati -flash conflict\n -conflitto flash\n on one side only file esistente su un solo lato -|> file on right side only\n -|> Il file esiste solo sul lato destro\n diff --git a/BUILD/Languages/japanese.lng b/BUILD/Languages/japanese.lng index 6ac7f498..0d473b8c 100644 --- a/BUILD/Languages/japanese.lng +++ b/BUILD/Languages/japanese.lng @@ -20,8 +20,10 @@ 分 sec 秒 -!= files are different\n -!= ファイルã«å·®ç•°ã‚ã‚Š\n +%x / %y objects deleted successfully +%x / %y ã®ã‚ªãƒ–ジェクトを削除ã—ã¾ã—㟠+%x Percent +%x パーセント %x directories %x ディレクトリ %x files, @@ -48,6 +50,8 @@ 一括ジョブを作æˆ(&C) &Default デフォルト(&D) +&Exit +終了(&E) &Export file list ファイル一覧をエクスãƒãƒ¼ãƒˆ(&E) &File @@ -72,6 +76,8 @@ 一時åœæ¢(&P) &Quit 終了(&Q) +&Restore +修復(&R) &Retry å†è©¦è¡Œ(&R) &Save @@ -80,20 +86,22 @@ ã¯ã„(&Y) , . -- do not copy\n -- コピーã—ãªã„\n - conflict - ä¸ä¸€è‡´ - conflict (same date, different size) - ä¸ä¸€è‡´ (åŒã˜æ—¥ä»˜, ç•°ãªã‚‹ã‚µã‚¤ã‚º) - different - 差異ã‚ã‚Š +- directory part only +- ディレクトリ部ã®ã¿ - equal - åŒä¸€ - exists left only - å·¦å´ã«ã®ã¿å˜åœ¨ - exists right only - å³å´ã«ã®ã¿å˜åœ¨ +- full file or directory name +- 完全ãªãƒ•ã‚¡ã‚¤ãƒ«/フォルダå - left - å·¦å´ - left newer @@ -102,8 +110,10 @@ - å³å´ - right newer - å³å´ã®æ–¹ãŒæ–°ã—ã„ --> copy to right side\n --> å³å´ã«ã‚³ãƒ”ー\n +- sibling of %dir +- %dir ã®å…„弟 +- sibling of %name +- %name ã®å…„弟 -Open-Source file synchronization- -Open-Source ファイルåŒæœŸãƒ„ール- . @@ -124,22 +134,12 @@ 2. ワイルドカード㫠' * ' 㨠' ? ' を使用出æ¥ã¾ã™ã€‚ 3. Exclude files directly on main grid via context menu. 3. コンテã‚ストメニューã‹ã‚‰ç›´æŽ¥ãƒ•ã‚¡ã‚¤ãƒ«ã‚’除外出æ¥ã¾ã™ã€‚ -<- copy to left side\n -<- å·¦å´ã«ã‚³ãƒ”ー\n -<< left file is newer\n -<< å·¦å´ã®æ–¹ãŒæ–°ã—ã„\n <Directory> <ディレクトリ> <Last session> <最後ã®ã‚»ãƒƒã‚·ãƒ§ãƒ³> <multiple selection> <複数é¸æŠž> -<| file on left side only\n -<| å·¦å´ã®ã¿ã«å˜åœ¨\n -== files are equal\n -== åŒæ§˜ã®ãƒ•ã‚¡ã‚¤ãƒ«\n ->> right file is newer\n ->> å³å´ã®æ–¹ãŒæ–°ã—ã„\n A newer version of FreeFileSync is available: FreeFileSync ã®æ–°ã—ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒåˆ©ç”¨å¯èƒ½ã§ã™: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About æƒ…å ± Action æ“作 +Add folder +ãƒ•ã‚©ãƒ«ãƒ€ã‚’è¿½åŠ Add folder pair フォルダã®ãƒšã‚¢ã‚’è¿½åŠ All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if ã“ã®ã‚ªãƒ—ションã§ã¯ã€åŒã˜åå‰ã‚’共有ã™ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«ã§å†…容ãŒåŒã˜å ´åˆã¯ã€åŒä¸€ã¨ã—ã¦æ‰±ã‚ã‚Œã¾ã™ã€‚ ãƒãƒƒã‚¯ã‚¢ãƒƒãƒ—æ“作よりã€ã‚€ã—ã‚æ•´åˆæ€§ã®ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã†æ™‚ã«å½¹ç«‹ã¤ã‚ªãƒ—ションã§ã™ã€‚ 従ã£ã¦ãƒ•ã‚¡ã‚¤ãƒ«ã®æ—¥æ™‚ã«ã¤ã„ã¦ã¯å…¨ã考慮ã•ã‚Œã¦ã„ã¾ã›ã‚“。\n\nè¨å®šãŒæœ‰åŠ¹ãªæ™‚ã¯ã€ãƒ„リー表示ãŒå°ã•ããªã‚Šã¾ã™ã€‚ Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. 一括ã§åŒæœŸå‡¦ç†ã‚’è¡Œã†ãŸã‚ã®ãƒãƒƒãƒãƒ•ã‚¡ã‚¤ãƒ«ã‚’作æˆã—ã¾ã™ã€‚ 一括モードを開始ã™ã‚‹ã¨ãã¯ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®ãƒ‘スåを実行ファイル\n< FreeFileSync.exe> \nã«ãƒãƒƒãƒãƒ•ã‚¡ã‚¤ãƒ«ã§æ¸¡ã™ã ã‘ã§ã™ã€‚ ã¾ãŸã€ã“ã®æ“作ã¯OSã®ã‚¿ã‚¹ã‚¯ã‚¹ã‚±ã‚¸ãƒ¥ãƒ¼ãƒ©ã‹ã‚‰å®Ÿè¡Œã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ +Auto-adjust columns +列ã®è‡ªå‹•èª¿æ•´ Batch execution 一括処ç†ã‚’実行 Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list リストã‹ã‚‰é™¤å¤–ã—ãŸã„ファイル/ディレクトリをé¸æŠž Comma separated list カンマ区切り +Commandline +コマンドライン +Commandline is empty! +コマンドラインãŒç©ºç™½ã§ã™! Compare 比較 Compare both sides @@ -202,6 +210,8 @@ Comparing content... 内容を比較ä¸... Comparison Result 比較çµæžœ +Comparison settings +比較è¨å®š Completed 完了ã—ã¾ã—㟠Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target ファイル %x をコピーã€%y ã«ä¸Šæ›¸ãä¸ Could not determine volume name for file: ファイルã®ãƒœãƒªãƒ¥ãƒ¼ãƒ åãŒæ±ºå®šã•ã‚Œã¦ã„ã¾ã›ã‚“: -Could not set working directory: -作æ¥ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãŒè¨å®šã§ãã¾ã›ã‚“: +Could not initialize directory monitoring: +監視ã™ã‚‹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“: +Could not read values for the following XML nodes: + Create a batch job ä¸€æ‹¬ã‚¸ãƒ§ãƒ–ã‚’ä½œæˆ Creating folder %x @@ -256,12 +268,18 @@ Custom カスタムCustomize columns 列ã®èª¿æ•´ +Customize... +カスタマイズ... DECISION TREE [判定ツリー] Data remaining: 残りã®ãƒ‡ãƒ¼ã‚¿: Date データ +Delay +é…延時間 +Delay between two invocations of the commandline +2 ã¤ã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã‚’実行ã™ã‚‹æ™‚ã®é…延時間 Delete files/folders existing on left side only å·¦å´ã®ã¿ã«å˜åœ¨ã™ã‚‹ãƒ•ã‚¡ã‚¤ãƒ«/フォルダを削除 Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides 両方を削除 Delete on both sides even if the file is selected on one side only 片å´ã®ãƒšã‚¤ãƒ³ã®ã¿é¸æŠžã•ã‚Œã¦ã„ã‚‹å ´åˆã§ã‚‚両方を削除ã™ã‚‹ +Delete or overwrite files permanently. +ファイルを上書ãã€ã¾ãŸã¯å®Œå…¨ã«å‰Šé™¤ +Delete permanently +完全ã«å‰Šé™¤ Deleting file %x ファイル %x ã‚’å‰Šé™¤ä¸ Deleting folder %x フォルダ %x ã‚’å‰Šé™¤ä¸ +Deletion handling +削除ã®å–り扱ㄠDirectories are dependent! Be careful when setting up synchronization rules: ディレクトリãŒä¾å˜é–¢ä¿‚ã«ã‚ã‚Šã¾ã™! åŒæœŸè¦å‰‡ã®è¨å®šæ™‚ã«ã¯æ³¨æ„ã—ã¦ãã ã•ã„: +Directories to watch +ディレクトリを監視 Directory ディレクトリ Directory does not exist: @@ -306,6 +332,8 @@ Email E-メール Enable filter to exclude files from synchronization åŒæœŸå‡¦ç†ã®éš›ã€é™¤å¤–ファイルフィルターを有効ã«ã™ã‚‹ã€‚ +Endless loop when traversing directory: +ディレクトリ移動ä¸ã«ç„¡é™ãƒ«ãƒ¼ãƒ—ãŒç™ºç”Ÿ: Error エラー Error changing modification time: @@ -324,6 +352,10 @@ Error handling ãƒãƒ³ãƒ‰ãƒªãƒ³ã‚°ã®ã‚¨ãƒ©ãƒ¼ Error loading library function: ライブラリèªã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼: +Error moving directory: +ディレクトリ移動ã«å¤±æ•—: +Error moving file: +ファイルã®ç§»å‹•ã«å¤±æ•—: Error moving to Recycle Bin: ゴミ箱ã¸ã®ç§»å‹•ã«å¤±æ•—: Error opening file: @@ -336,12 +368,12 @@ Error reading file: ファイルèªã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼: Error resolving symbolic link: シンボリックリンクã®è§£æ±ºã«å¤±æ•—: -Error retrieving full path: -フルパスã®å–å¾—ã«å¤±æ•—: Error starting Volume Shadow Copy Service! ボリュームシャドウコピーã®é–‹å§‹ã«å¤±æ•—! Error traversing directory: ディレクトリã®ç§»å‹•ã‚¨ãƒ©ãƒ¼: +Error when monitoring directories. +ディレクトリã®ç›£è¦–エラー Error writing file attributes: ファイル属性ã®æ›¸ãè¾¼ã¿ã‚¨ãƒ©ãƒ¼: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side å·¦å´ã«ã‚³ãƒ”ーã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ Hide files that will be copied to the right side å³å´ã«ã‚³ãƒ”ーã—ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ +Hide files that will be created on the left side +å·¦å´ã§ä½œæˆã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ +Hide files that will be created on the right side +å³å´ã§ä½œæˆã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ +Hide files that will be deleted on the left side +å·¦å´ã§å‰Šé™¤ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ +Hide files that will be deleted on the right side +å³å´ã§å‰Šé™¤ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ Hide files that won't be copied コピーã—ãªã‹ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’éš ã™ Hide filtered items é©åˆã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’éžè¡¨ç¤ºã«ã™ã‚‹ Hide further error messages during the current process ç¾åœ¨ã®å‡¦ç†ä¸ã¯ä»¥é™ã®ã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’表示ã—ãªã„ -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -åŒæœŸå‡¦ç†ä¸ã®ã‚¨ãƒ©ãƒ¼ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’éžè¡¨ç¤ºã«ã™ã‚‹:\néžè¡¨ç¤ºã«ã—ãŸãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã€å‡¦ç†ã®çµ‚了後ã«ä¸€è¦§è¡¨ç¤ºã•ã‚Œã¾ã™ã€‚ Hints: ヒント: Homepage @@ -486,8 +524,8 @@ Include å«ã‚ã‚‹ Include temporarily 一時フォルダをå«ã‚ã‚‹ -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -å«ã‚ã‚‹: *.doc;*.zip;*.exe\n除外: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +å«ã‚ã‚‹: *.doc;*.zip;*.exe\n除外: temp\\* Info æƒ…å ± Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! ゴミ箱ã®åˆæœŸåŒ–ã«å¤±æ•—ã—ã¾ã—ãŸ! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) ゴミ箱をåˆæœŸåŒ–ã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ã§ã—ãŸ!\n\n使用ã—ã¦ã„ã‚‹ OS ãŒã€Windows 以外㮠OS ã§ã™ã€‚\nã“ã®æ©Ÿèƒ½ã‚’使用ã—ãŸã„å ´åˆã¯ã€ä½œè€…ã¾ã§ã”連絡ãã ã•ã„ :) -Left: -å·¦å´: +Left +å·¦å´ Load configuration from file 外部ファイルã‹ã‚‰æ§‹æˆè¨å®šã‚’èªã¿è¾¼ã¿ã¾ã™ Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down 列を下ã«ç§»å‹• Move column up 列を上ã«ç§»å‹• +Move files to a custom directory. +ファイルを指定ディレクトリã«ç§»å‹• +Move to custom directory +指定ディレクトリã«ç§»å‹• Moving %x to Recycle Bin %x をゴミ箱ã«ç§»å‹•ä¸ +Moving %x to custom directory +%x を指定ディレクトリã«ç§»å‹•ä¸ Not all items have been synchronized! Have a look at the list. ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã¯åŒæœŸã•ã‚Œã¦ã„ã¾ã›ã‚“ã€ãƒªã‚¹ãƒˆã‚’確èªã—ã¦ãã ã•ã„ Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i \"Shadow.dll\" (\"Shadow.zip\" アーカイブ内) ã‚’ã€FreeFileSync インストールフォルダã«ã‚³ãƒ”ーã™ã‚‹ã“ã¨ã§ã€ã“ã®æ©Ÿèƒ½ã‚’利用ã§ãるよã†ã«ãªã‚Šã¾ã™ã€‚ Please fill all empty directory fields. アイテムãŒé¸æŠžã•ã‚Œã¦ã„ã¾ã›ã‚“! +Please specify alternate directory for deletion! +削除ã«ä½¿ç”¨ã™ã‚‹ä»£æ›¿ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’指定ã—ã¦ãã ã•ã„! Press button to activate filter ボタンをクリックã§æœ‰åŠ¹åŒ– Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question è³ªå• Quit 終了 +RealtimeSync - Automated Synchronization +リアルタイムåŒæœŸ - 自動åŒæœŸ +RealtimeSync configuration +リアルタイムåŒæœŸã®æ§‹æˆè¨å®š Relative path 相対パス +Remove folder +フォルダ除去 Remove folder pair フォルダペアを除去 +Report translation error +翻訳エラーã®è©³ç´° Reset リセット Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? ã™ã¹ã¦ã®è¦å‘Šã‚’リセットã—ã¾ã™ã‹? Result çµæžœ -Right: -å³å´: +Right +å³å´ S&ave configuration 構æˆè¨å®šã‚’ä¿å˜(&A) S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side å·¦å´ã«ã‚³ãƒ”ーã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 Show files that will be copied to the right side å³å´ã«ã‚³ãƒ”ーã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 +Show files that will be created on the left side +å·¦å´ã§ä½œæˆã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 +Show files that will be created on the right side +å³å´ã§ä½œæˆã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 +Show files that will be deleted on the left side +å·¦å´ã§å‰Šé™¤ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 +Show files that will be deleted on the right side +å³å´ã§å‰Šé™¤ã•ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 Show files that won't be copied コピーã•ã‚Œãªã‹ã£ãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’表示 Show popup @@ -660,12 +722,14 @@ Synchronizing... åŒæœŸå‡¦ç†ä¸... System out of memory! メモリãŒä¸è¶³ã—ã¦ã„ã¾ã™! +Target directory already existing! +対象ディレクトリã¯ã™ã§ã«å˜åœ¨ã—ã¾ã™! Target file already existing! 対象ファイルã¯æ—¢ã«å˜åœ¨ã—ã¾ã™! The file does not contain a valid configuration: ã“ã®ãƒ•ã‚¡ã‚¤ãƒ«ã«ã¯æœ‰åŠ¹ãªæ§‹æˆãŒå«ã¾ã‚Œã¦ã„ã¾ã›ã‚“: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -ファイルåをダブルクリックã™ã‚‹åº¦ã«ã€ã“ã®ã‚³ãƒžãƒ³ãƒ‰ãŒå®Ÿè¡Œã•ã‚Œã¾ã™ã€‚ %name ã¯é¸æŠžãƒ•ã‚¡ã‚¤ãƒ«ã®ãƒ—レースフォルダã¨ã—ã¦æ©Ÿèƒ½ã—ã¾ã™ã€‚ +This commandline will be executed on each doubleclick. The following macros are available: +ã“ã®ã‚³ãƒžãƒ³ãƒ‰ãƒ©ã‚¤ãƒ³ã¯ãƒ€ãƒ–ルクリックã§å®Ÿè¡Œã•ã‚Œã¾ã™ã€‚ã¾ãŸã€ä»¥ä¸‹ã®ãƒžã‚¯ãƒã‚’利用å¯èƒ½ã§ã™: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. ã“ã®å¤‰æ•°ã§ã¯ã€ãµãŸã¤ã®åŒåファイルãŒå˜åœ¨ã—ãŸå ´åˆã€ ãã‚Œãžã‚Œã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚µã‚¤ã‚ºã¨æœ€çµ‚更新日付/時間を比較ã—ã¾ã™ã€‚ Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro 未解決ã®ä¸ä¸€è‡´ãŒã‚ã‚Šã¾ã™! \n\nã“ã®ä¸ä¸€è‡´ã‚’無視ã—ã¦åŒæœŸã‚’続行ã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ã€‚ Update -> æ›´æ–° -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +使用方法: 監視ã™ã‚‹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’é¸æŠžã—ã¦ã€ã‚³ãƒžãƒ³ãƒ‰ã‚’入力ã—ã¾ã™ã€‚ é¸æŠžã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª(サブディレクトリ)内ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒå¤‰æ›´ã•ã‚Œã‚‹åº¦ã«ã€å…¥åŠ›ã—ãŸã‚³ãƒžãƒ³ãƒ‰ãŒå®Ÿè¡Œã•ã‚Œã¾ã™ã€‚ Use Recycle Bin ゴミ箱を使用 -Use Recycle Bin when deleting or overwriting files during synchronization -åŒæœŸå‡¦ç†ã®é–“ã€ãƒ•ã‚¡ã‚¤ãƒ«ã®ä¸Šæ›¸ã/削除をã™ã‚‹æ™‚ã«ã‚´ãƒŸç®±ã‚’使用 +Use Recycle Bin when deleting or overwriting files. +ファイルã®å‰Šé™¤ã€ä¸Šæ›¸ã時ã«ã‚´ãƒŸç®±ã‚’使用ã™ã‚‹ Variant 変化 Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: è¦å‘Š: When the comparison is started with this option set the following decision tree is processed: ã“ã®ã‚ªãƒ—ションã§æ¯”較を開始ã—ãŸå ´åˆã¯ã€ä»¥ä¸‹ã®ãƒ„リーã«å¾“ã£ã¦å‡¦ç†ãŒè¡Œã‚ã‚Œã¾ã™: +You can ignore the error to consider not existing directories as empty. +æ—¢å˜ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªãŒç©ºã§ã¯ãªã„ã¨ã„ã†ã‚¨ãƒ©ãƒ¼ã¯ç„¡è¦–ã§ãã¾ã™ã€‚ You may try to synchronize remaining items again (WITHOUT having to re-compare)! 残ã£ã¦ã„るファイルã¯ã€å†ã³åŒæœŸã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ (å†æ¯”較ã¨ã¯åˆ¥ã®å‹•ä½œ)! different 差異ã‚ã‚Š file exists on both sides 両å´ã«å˜åœ¨ã™ã‚‹ãƒ•ã‚¡ã‚¤ãƒ« -flash conflict\n -ä¸ä¸€è‡´ã‚’点滅 on one side only 片å´ã®ã¿ -|> file on right side only\n -|> å³å´ã®ã¿ã«å˜åœ¨\n diff --git a/BUILD/Languages/polish.lng b/BUILD/Languages/polish.lng index fae04f18..0a8b7f08 100644 --- a/BUILD/Languages/polish.lng +++ b/BUILD/Languages/polish.lng @@ -20,8 +20,10 @@ minuty sec sekundy -!= files are different\n -!= pliki sÄ… różne\n +%x / %y objects deleted successfully +%x / %y usuniÄ™tych obiektów +%x Percent +%x Procent %x directories %x katalogi %x files, @@ -43,11 +45,13 @@ &Cancel &Anuluj &Check for new version -&Sprawdź aktualizacje +&Aktualizuj &Create batch job -&Twórz zadanie batch +&Twórz plik wsadowy &Default &DomyÅ›lne +&Exit +&WyjÅ›cie &Export file list &Eksportuj listÄ™ plików &File @@ -63,7 +67,7 @@ &Load &Wczytaj &Load configuration -&Åaduj konfiguracjÄ™ +&Wczytaj konfiguracjÄ™ &No &Nie &OK @@ -72,6 +76,8 @@ &Pauza &Quit &Zamknij +&Restore +&Przywróć &Retry &Powtórz &Save @@ -80,20 +86,22 @@ &Tak , . -- do not copy\n -- nie kopiuj\n - conflict - konflikt - conflict (same date, different size) - konflikt (ta sama data, różny rozmiar) - different - różny +- directory part only +- tylko struktura katalogu - equal - równy - exists left only - istnieje tylko po lewej stronie - exists right only - istnieje tylko po prawej stronie +- full file or directory name +- peÅ‚na nazwa pliku lub katalogu - left - lewy - left newer @@ -102,8 +110,10 @@ - prawy - right newer - prawy jest nowszy --> copy to right side\n --> kopiuj na prawÄ… stronÄ™ +- sibling of %dir +- brat %dir +- sibling of %name +- brat %name -Open-Source file synchronization- -synchronizacja plików Open-Source- . @@ -124,22 +134,12 @@ 2. Użyj wieloznacznika (wildcard) '*' i '?'. 3. Exclude files directly on main grid via context menu. 3. Wyklucz pliki i foldery używajÄ…c prawego przycisku myszki. -<- copy to left side\n -<- kopiuje na lewÄ… stronÄ™\n -<< left file is newer\n -<< lewy plik jest nowszy\n <Directory> <Katalog> <Last session> <Ostatnia sesja> <multiple selection> <zaznaczone elementy> -<| file on left side only\n -<| istnieje tylko po lewej stronie\n -== files are equal\n -== pliki sÄ… równe\n ->> right file is newer\n ->> prawy plik jest nowszy\n A newer version of FreeFileSync is available: DostÄ™pna jest nowa wersja FreeFileSync: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About O Programie Action Akcja +Add folder +Dodaj folder Add folder pair Dodaj foldery do porównania All items have been synchronized! @@ -161,13 +163,15 @@ W rezultacie pliki zostaÅ‚y podzielone na nastÄ™pujÄ…ce kategorie: As the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller: Jak wskazuje nazwa, dwa pliki o tej samej nazwie sÄ… równe tylko i wyÅ‚Ä…cznie jeżeli ich zawartość jest jednakowa. Czas modyfikacji nie jest brany pod uwagÄ™. Ta opcja jest raczej użyteczna do sprawdzania spójnoÅ›ci plików niż zadaÅ„ kopii zapasowej.\n\nDrzewko decyzyjne dla tej opcji jest mniejsze: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. -Twórz zadanie batch dla automatyzacji procesu. By rozpocząć prace w tym trybie zwyczajnie uruchom plik z zadaniem batch lub dodaj go do zadaÅ„ zaplanowanych Twojego systemu. Plik batch może być również przekazywany jako parametr do programu w postaci: FreeFileSync.exe <batchfile>. +Twórz plik wsadowy dla automatyzacji procesu. By rozpocząć prace w tym trybie zwyczajnie uruchom plik klikajÄ…c dwa razy lub dodaj go do zadaÅ„ zaplanowanych Twojego systemu. Plik wsadowy może być również przekazywany jako parametr do programu w postaci: FreeFileSync.exe <plikwsadowy>. +Auto-adjust columns +Autodopasowanie kolumn Batch execution -Zadanie Batch +Uruchomienie pliku wsadowego Batch file created successfully! -Plik Batch utworzony pomyÅ›lnie! +Plik wsadowy utworzony pomyÅ›lnie! Batch job -Zadanie batch +Plik wsadowy Big thanks for localizing FreeFileSync goes out to: PodziÄ™kowania za tÅ‚umaczenie FreeFileSync: Browse @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Zaznacz aby ukryć przefiltrowane pliki/katalogi z listy Comma separated list Lista oddzielona przecinkami +Commandline +Wiersz poleceÅ„ +Commandline is empty! +Wiersz poleceÅ„ jest pusty! Compare Porównaj Compare both sides @@ -202,12 +210,14 @@ Comparing content... Porównywanie zawartoÅ›ci... Comparison Result Rezultat porównywania +Comparison settings +Ustawienia porównywania Completed ZakoÅ„czono Configuration Konfiguracja Configuration loaded! -Konfiguracja zaÅ‚adowana! +Konfiguracja wczytana! Configuration overview: PrzeglÄ…d konfiguracji: Configuration saved! @@ -244,10 +254,12 @@ Copying file %x to %y overwriting target Nadpisywanie pliku %y plikiem %x Could not determine volume name for file: Nie można okreÅ›lić nazwy dysku dla pliku: -Could not set working directory: -Nie można ustawić poprawnego folderu: +Could not initialize directory monitoring: +Nie można uruchomić monitora katalogów: +Could not read values for the following XML nodes: + Create a batch job -Twórz zadanie Batch +Twórz plik wsadowy Creating folder %x Tworzenie folderu %x Current operation: @@ -256,12 +268,18 @@ Custom WÅ‚asne Customize columns Dostosuj kolumny +Customize... +Dostosuj... DECISION TREE DRZEWO DECYZYJNE Data remaining: PozostaÅ‚e dane: Date Data +Delay +Opóźnienie +Delay between two invocations of the commandline +Opóźnienie pomiÄ™dzy wywoÅ‚aniem dwóch komend Delete files/folders existing on left side only UsuÅ„ pliki/foldery istniejÄ…ce tylko po lewej stronie Delete files/folders existing on right side only @@ -272,18 +290,26 @@ Delete on both sides UsuÅ„ po obu stronach Delete on both sides even if the file is selected on one side only UsuÅ„ po obu stronach nawet jeżeli plik zaznaczony jest tylko po jednej stronie +Delete or overwrite files permanently. +UsuÅ„ lub nadpisz pliki na staÅ‚e. +Delete permanently +UsuÅ„ na staÅ‚e Deleting file %x Usuwanie pliku %x Deleting folder %x Usuwanie folderu %x +Deletion handling +ObsÅ‚uga usuwania Directories are dependent! Be careful when setting up synchronization rules: Katalogi sÄ… zależne! PamiÄ™taj o tym podczas ustawiania zasad synchronizacji: +Directories to watch +Katalogi do obserwacji Directory Katalog Directory does not exist: Katalog nie istnieje: Do not display visual status information but write to a logfile instead -Nie wyÅ›wietla informacji o statusie, ale tworzy plik z logami +Nie wyÅ›wietla graficznej informacji o statusie, ale tworzy plik z logami Do not show this dialog again Nie pokazuj tego okna ponownie Do nothing @@ -306,6 +332,8 @@ Email Poczta Enable filter to exclude files from synchronization WÅ‚Ä…cz filtr aby wykluczyć pliki z procesu synchronizacji +Endless loop when traversing directory: +ZapÄ™tlenie podczas przeglÄ…dania katalogu: Error BÅ‚Ä…d Error changing modification time: @@ -324,6 +352,10 @@ Error handling ObsÅ‚uga bÅ‚Ä™dów Error loading library function: BÅ‚Ä…d wczytywania funkcji: +Error moving directory: +BÅ‚Ä…d podczas przenoszenia katalogu: +Error moving file: +BÅ‚Ä…d podczas przenoszenia pliku: Error moving to Recycle Bin: BÅ‚Ä…d podczas przenoszenia do kosza: Error opening file: @@ -336,12 +368,12 @@ Error reading file: BÅ‚Ä…d odczytu pliku: Error resolving symbolic link: BÅ‚Ä…d odczytu dowiÄ…zania symbolicznego: -Error retrieving full path: -BÅ‚Ä…d odzyskiwania peÅ‚nej Å›cieżki: Error starting Volume Shadow Copy Service! BÅ‚Ä…d podczas uruchamianiu usÅ‚ugi Shadow Copy! Error traversing directory: BÅ‚Ä…d podczas odczytywania katalogu: +Error when monitoring directories. +BÅ‚Ä…d podczas monitorowania katalogów. Error writing file attributes: BÅ‚Ä…d zapisu atrybutów pliku: Error writing file: @@ -421,11 +453,11 @@ Para folderów FreeFileSync - Folder Comparison and Synchronization FreeFileSync - Porównywanie i Synchronizacja folderów FreeFileSync Batch Job -FreeFileSync Batch +FreeFileSync plik wsadowy FreeFileSync at Sourceforge FreeFileSync na Sourceforge FreeFileSync batch file -FreeFileSync plik batch +FreeFileSync plik wsadowy FreeFileSync configuration Konfiguracja FreeFileSync FreeFileSync is up to date! @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Ukryj pliki, które bÄ™dÄ… kopiowane na lewÄ… stronÄ™ Hide files that will be copied to the right side Ukryj pliki, które bÄ™dÄ… kopiowane na prawÄ… stronÄ™ +Hide files that will be created on the left side +Ukryj pliki, które bÄ™dÄ… utworzone po lewej stronie +Hide files that will be created on the right side +Ukryj pliki, które bÄ™dÄ… utworzone po prawej stronie +Hide files that will be deleted on the left side +Ukryj pliki, które bÄ™dÄ… usuniÄ™te po lewej stronie +Hide files that will be deleted on the right side +Ukryj pliki, które bÄ™dÄ… usuniÄ™te po lewej stronie Hide files that won't be copied Ukryj pliki, które nie bÄ™dÄ… kopiowane Hide filtered items Ukryj elementy przefiltrowane Hide further error messages during the current process Ukryj kolejne informacje o bÅ‚Ä™dach dla tego zadania -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Ukryj informacje o bÅ‚Ä™dach podczas synchronizacji:\nZostanÄ… wyÅ›wietlone pod koniec procesu Hints: Wskazówki: Homepage @@ -486,8 +524,8 @@ Include DoÅ‚Ä…cz Include temporarily DoÅ‚Ä…cz tymczasowo -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -DoÅ‚Ä…cz: *.doc;*.zip;*.exe\nWyklucz: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +DoÅ‚Ä…cz: *.doc;*.zip;*.exe\nWyklucz: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Niepowodzenie inicjalizacji Kosza! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Inicjalizacja Kosza nie byÅ‚a możliwa!\n\nPrawdopodobnie nie używasz Windowsa.\nJeżeli chcesz doÅ‚Ä…czyć tÄ… cechÄ™, skontaktuj siÄ™ z autorem. :) -Left: -Lewy: +Left +Lewy Load configuration from file Wczytaj konfiguracjÄ™ z pliku Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down PrzesuÅ„ kolumnÄ™ w dół Move column up PrzesuÅ„ kolumnÄ™ do góry +Move files to a custom directory. +PrzenieÅ› plik do niestandardowego katalogu. +Move to custom directory +PrzenieÅ› do niestandardowego katalogu Moving %x to Recycle Bin Przenoszenie %x do kosza. +Moving %x to custom directory +Przenoszenie %x to niestandardowego katalogu Not all items have been synchronized! Have a look at the list. Nie wszystkie elementy zostaÅ‚y zsynchronizowane! Zobacz tÄ… listÄ™. Not enough free disk space available in: @@ -533,7 +577,7 @@ Liczba plików, które zostanÄ… nadpisane OK OK Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the synchronization directories. -Tylko pliki/katalogi, które nie zostanÄ… odrzucone przez filtr zostanÄ… dodane do procesu synchronizacji. Filtr dziaÅ‚a tylko dla nazw wprowadzonych relatywnie(!) +Tylko pliki/katalogi, które nie zostanÄ… odrzucone przez filtr dodane bÄ™dÄ… do procesu synchronizacji. Filtr dziaÅ‚a tylko dla nazw wprowadzonych relatywnie(!) Open with File Manager\tD-Click Exploruj Operation aborted! @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Skopiuj odpowiedni plik \"Shadow.dll\" (ulokowany w \"Shadow.zip\") do folderu z instalacjÄ… FreeFileSync aby uaktywnić tÄ… opcjÄ™. Please fill all empty directory fields. Podaj foldery do synchronizacji. +Please specify alternate directory for deletion! +ProszÄ™ okreÅ›lić inny katalog jako kosz! Press button to activate filter Kliknij aby aktywować filtr Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Pytanie Quit ZakoÅ„cz +RealtimeSync - Automated Synchronization +RealtimeSync - Automatyczna Synchronizacja +RealtimeSync configuration +RealtimeSync konfiguracja Relative path Relatywna Å›cieżka +Remove folder +UsuÅ„ folder Remove folder pair UsuÅ„ parÄ™ folderów +Report translation error +ZgÅ‚oÅ› bÅ‚Ä…d w tÅ‚umaczeniu Reset Resetuj Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Zresetować wszystkie ostrzeżenia? Result Rezultat -Right: -Prawy: +Right +Prawy S&ave configuration Z&apisz konfiguracjÄ™ S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Pokaż pliki, które bÄ™dÄ… kopiowane na lewÄ… stronÄ™ Show files that will be copied to the right side Pokaż pliki, które bÄ™dÄ… kopiowane na prawÄ… stronÄ™ +Show files that will be created on the left side +Pokaż pliki, które bÄ™dÄ… utworzone po lewej stronie +Show files that will be created on the right side +Pokaż pliki, które bÄ™dÄ… utworzone po prawej stronie +Show files that will be deleted on the left side +Pokaż pliki, które bÄ™dÄ… usuniÄ™te po lewej stronie +Show files that will be deleted on the right side +Pokaż pliki, które bÄ™dÄ… usuniÄ™te po prawej stronie Show files that won't be copied Pokaż pliki, które nie bÄ™dÄ… kopiowane Show popup @@ -660,12 +722,14 @@ Synchronizing... SynchronizujÄ™... System out of memory! Brak pamiÄ™ci! +Target directory already existing! +Katalog docelowy już istnieje! Target file already existing! Plik docelowy już istnieje! The file does not contain a valid configuration: NieprawidÅ‚owy format pliku: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Ta komenda bÄ™dzie wykonywana za każdym razem jak klikniesz dwa razy na dany plik. %name jest wskaźnikiem na katalog zaznaczonego pliku. +This commandline will be executed on each doubleclick. The following macros are available: +Ta komenda bÄ™dzie wykonana przy każdym podwójnym klikniÄ™ciu. DostÄ™pne sÄ… nastÄ™pujÄ…ce makra: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Ten wariant traktuje dwa pliki jako równe w przypadku gdy majÄ… jednakowy rozmiar oraz tÄ… samÄ… datÄ™ i czas ostatniej modyfikacji. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro IstniejÄ… nierozwiÄ…zane konflikty! \n\nMożesz je zignorować i kontynuÅ‚ować synchronizacjÄ™. Update -> Uaktualnij -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Użycie: Wybierz katalogi do monitorowania i wprowadź komendÄ™. Gdy któryÅ› z plików zostanie zmodyfikowany, w obrÄ™bie katalogów, zostanie uruchomiona podana komenda. Use Recycle Bin Użyj kosza -Use Recycle Bin when deleting or overwriting files during synchronization -Użyj Kosza podczas usuwania bÄ…dź nadpisywania plików w trakcie synchronizacji +Use Recycle Bin when deleting or overwriting files. +Używaj Kosza podczas usuwania lub nadpisywania plików. Variant Wariant Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Ostrzeżenia: When the comparison is started with this option set the following decision tree is processed: Gdy porównywanie z zaznaczonÄ… opcjÄ… jest w toku, podejmowane sÄ… nastÄ™pujÄ…ce dezyje: +You can ignore the error to consider not existing directories as empty. +Możesz zignorować ten bÅ‚Ä…d i uznać nieistniejÄ…cy katalog za pusty. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Możesz spróbować synchronizować pozostaÅ‚e elementy ponownie (bez koniecznoÅ›ci ponownego porównywania)! different różny file exists on both sides plik istnieje po obu stronach -flash conflict\n -konflikt\n on one side only tylko po jednej stronie -|> file on right side only\n -|> istnieje tylko po prawej stronie\n diff --git a/BUILD/Languages/portuguese.lng b/BUILD/Languages/portuguese.lng index 04002221..e250315d 100644 --- a/BUILD/Languages/portuguese.lng +++ b/BUILD/Languages/portuguese.lng @@ -20,8 +20,10 @@ min sec seg -!= files are different\n -!= ficheiros diferentes\n +%x / %y objects deleted successfully +%x / %y objectos eliminados com sucesso +%x Percent +%x Por cento %x directories %x pastas %x files, @@ -48,6 +50,8 @@ &Criar um ficheiro batch &Default &Config. Iniciais +&Exit +&Sair &Export file list &Exportar lista de ficheiros &File @@ -72,6 +76,8 @@ &Pausa &Quit &Sair +&Restore +&Restaurar &Retry &Tentar de Novo &Save @@ -80,20 +86,22 @@ &Sim , -- do not copy\n -- não copiar\n - conflict - conflito - conflict (same date, different size) - conflito (mesma data, tamanho diferente) - different - ficheiros diferentes +- directory part only +- apenas parte do directório - equal - ficheiros iguais - exists left only - existe apenas à esquerda - exists right only - existe apenas à direita +- full file or directory name +- nome completo do ficheiro ou directório - left - esquerda - left newer @@ -102,8 +110,10 @@ - direita - right newer - mais novo à direita --> copy to right side\n --> copiar para a direita\n +- sibling of %dir +- irmão de %dir +- sibling of %name +- irmão de %name -Open-Source file synchronization- -Sincronização de ficheiros Open-Source- . @@ -124,22 +134,12 @@ 2. Usar '*' e '?' como caracteres de procura. 3. Exclude files directly on main grid via context menu. 3. Excluir ficheiros directamente da grelha através do menu de contexto. -<- copy to left side\n -<- copiar para a esquerda\n -<< left file is newer\n -<< ficheiro à esquerda mais recente\n <Directory> <Directório> <Last session> <Última Sessão> <multiple selection> <Selecção Múltipla> -<| file on left side only\n -<| ficheiro apenas à esquerda\n -== files are equal\n -== ficheiros iguais\n ->> right file is newer\n ->> ficheiro à direita mais recente\n A newer version of FreeFileSync is available: Mais recente versão do FreeFileSync disponÃvel: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About Sobre Action Acção +Add folder +Adicionar pasta Add folder pair Adicionar um par de pastas All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Como o nome sugere, dois ficheiros com o mesmo nome são assinalados iguais se e só se o seu conteúdo for idêntico. Esta opção é útil para controles de consistência mais do que para efeitos de backup. Portanto, a data dos ficheiros não é tomada em conta.\n\nCom esta opção, a arvoré de decisão é menor: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Criar um batch para sincronização automática. Para iniciar o modo batch, passar o nome do ficheiro para o executável do FreeFileSync: FreeFileSync.exe <ficheiro batch>. Também pode ser calendarizado no programador de tarefas. +Auto-adjust columns +Auto ajustar colunas Batch execution Execução do batch Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Ocultar itens filtrados da lista Comma separated list Lista de itens separados por virgula +Commandline +Linha de comandos +Commandline is empty! +Linha de comandos vazia! Compare Comparar Compare both sides @@ -201,7 +209,9 @@ A comparar o conteúdo do ficheiro %x Comparing content... A comparar... Comparison Result -Resultado comparação +Resultados da Comparação +Comparison settings +Opções de Comparação Completed Terminado Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Copiar ficheiro %x para %y substituindo Could not determine volume name for file: Não é possÃvel determinar o nome do volume para o ficheiro: -Could not set working directory: -Não pode definir pasta de trabalho: +Could not initialize directory monitoring: +Não é possÃvel iniciar monitorização do directório: +Could not read values for the following XML nodes: + Create a batch job Criar ficheiro batch Creating folder %x @@ -256,12 +268,18 @@ Custom Personalizado Customize columns Personalizar colunas +Customize... +Personalizar... DECISION TREE ÃRVORE DE DECISÃO Data remaining: Dados em falta: Date Data +Delay +Atraso +Delay between two invocations of the commandline +Atraso entre duas chamadas da linha de comandos Delete files/folders existing on left side only Eliminar itens existentes apenas no lado esquerdo Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Eliminar em ambos os lados Delete on both sides even if the file is selected on one side only Eliminar em ambos os lados mesmo se o ficheiro só está seleccionado num lado +Delete or overwrite files permanently. +Apagar ou substituir ficheiros permanentemente. +Delete permanently +Apagar permanentemente Deleting file %x Apagar ficheiro %x Deleting folder %x Apagar pasta %x +Deletion handling +Controlo eliminação Directories are dependent! Be careful when setting up synchronization rules: Directórios são dependentes! Cuidado ao definir as regras de sincronização: +Directories to watch +Directórios a observar Directory Directório Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization Ligar filtro para excluir ficheiros da sincronização +Endless loop when traversing directory: +Loop infinito ao percorrer directório: Error Erro Error changing modification time: @@ -324,8 +352,12 @@ Error handling Controlador de erros Error loading library function: Erro ao carregar a livraria: +Error moving directory: +Erro ao mover o directório: +Error moving file: +Erro ao mover o ficheiro: Error moving to Recycle Bin: -Erro ao mover para Reciclagem: +Erro ao mover para a Reciclagem: Error opening file: Erro ao abrir ficheiro: Error parsing configuration file: @@ -336,12 +368,12 @@ Error reading file: Erro de leitura de ficheiro: Error resolving symbolic link: Erro na resolução do link simbólico: -Error retrieving full path: -Erro no retorno do caminho: Error starting Volume Shadow Copy Service! Erro ao iniciar o serviço Volume Shadow Copy! Error traversing directory: Erro ao percorrer a pasta: +Error when monitoring directories. +Erro ao monitorizar os directórios. Error writing file attributes: Erro na escrita dos atributos do ficheiro: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Ocultar ficheiros a copiar para a esquerda Hide files that will be copied to the right side Ocultar ficheiros a copiar para a direita +Hide files that will be created on the left side +Ocultar ficheiros a ser criados à esquerda +Hide files that will be created on the right side +Ocultar ficheiros a ser criados à direita +Hide files that will be deleted on the left side +Ocultar ficheiros a ser apagados à esquerda +Hide files that will be deleted on the right side +Ocultar ficheiros a ser apagados à direita Hide files that won't be copied Ocultar ficheiros que não serão copiados Hide filtered items Ocultar itens filtrados Hide further error messages during the current process Ocultar próximas mensagens de erro durante este processo -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Ocultar mensagens de erro durante a sincronização:\nSerão coleccionadas e mostradas numa lista no fim do processo Hints: Dicas: Homepage @@ -486,8 +524,8 @@ Include Incluir Include temporarily Incluir temporariamente -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Incluir: *.doc;*.zip;*.exe\nExcluir: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Incluir: *.doc;*.zip;*.exe\nExcluir: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! InÃcio da Reciclagem falhou! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Não é possÃvel aceder à Reciclagem!\n\nÉ possÃvel que não esteja a utilizar Windows.\nSe desejar esta opção incluÃda, é favor contactar o autor. :) -Left: -Esquerda: +Left +Esquerda Load configuration from file Carregar configuração do ficheiro Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Mover coluna para baixo Move column up Mover coluna para cima +Move files to a custom directory. +Mover ficheiros para uma pasta própria. +Move to custom directory +Mover para pasta própria Moving %x to Recycle Bin Mover %x para a Reciclagem +Moving %x to custom directory +Mover %x para pasta própria Not all items have been synchronized! Have a look at the list. Nem todos os ficheiros foram sincronizados! Verifique a lista. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Por favor copie o \"Shadow.dll\" correcto (localizado no arquivo \"Shadow.zip\") para a pasta da instalação do FreeFileSync para activar esta opção. Please fill all empty directory fields. Por favor, preencha todos os campos vazios. +Please specify alternate directory for deletion! +Por favor especifique directório alternativo para eliminação! Press button to activate filter Pressione para activar o filtro Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Questão Quit Sair +RealtimeSync - Automated Synchronization +RealtimeSync - Sincronização Automática +RealtimeSync configuration +Configuração do RealtimeSync Relative path Caminho +Remove folder +Remover pasta(s) Remove folder pair Remover o par de pastas +Report translation error +Informar um erro de tradução Reset Reiniciar Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Reiniciar todas mensagens de aviso? Result Resultado -Right: -Direita: +Right +Direita S&ave configuration G&uardar a configuração S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Mostrar ficheiros a copiar para a esquerda Show files that will be copied to the right side Mostrar ficheiros a copiar para a direita +Show files that will be created on the left side +Mostrar ficheiros a ser criados à esquerda +Show files that will be created on the right side +Mostrar ficheiros a ser criados à direita +Show files that will be deleted on the left side +Mostrar ficheiros a ser apagados à esquerda +Show files that will be deleted on the right side +Mostrar ficheiros a ser apagados à direita Show files that won't be copied Mostrar ficheiros que não serão copiados Show popup @@ -660,12 +722,14 @@ Synchronizing... A sincronizar... System out of memory! Sistema sem memória! +Target directory already existing! +Directório de destino já existe! Target file already existing! -Ficheiro destino já existe! +Ficheiro de destino já existe! The file does not contain a valid configuration: O ficheiro não contém uma configuração válida: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Esta linha de comandos será executada cada vez que fizer duplo click num ficheiro. %name serve para reservar o lugar do ficheiro seleccionado. +This commandline will be executed on each doubleclick. The following macros are available: +Esta linha de comandos será executada a cada duplo clique. As seguintes macros estão disponÃveis: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Esta variante avalia dois ficheiros de nome igual como iguais quando têm o mesmo tamanho e a mesma data e hora de modificação. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Existem conflitos não resolvidos! \n\nPode ignorá-los e continuar a sincronização. Update -> Actualizar -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Uso: Selecionar directórios a monitorizar e escrever uma linha de comando. Cada vez que um ficheiro for alterado nestes directórios (ou subdirectórios) a linha de comando será executada. Use Recycle Bin Utilizar Reciclagem -Use Recycle Bin when deleting or overwriting files during synchronization -Utilizar a Reciclagem ao eliminar ou substituir ficheiros durante a sincronização +Use Recycle Bin when deleting or overwriting files. +Utilizar Reciclagem ao apagar ou substituir ficheiros. Variant Variável Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Avisos: When the comparison is started with this option set the following decision tree is processed: Usar a seguinte árvore de decisão quando inicia com estas opções de comparação: +You can ignore the error to consider not existing directories as empty. +Pode ignorar o erro para considerar directórios não existentes como vazios. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Pode tentar sincronizar os restantes elementos outra vez (SEM TER QUE comparar de novo) ! different ficheiros diferentes file exists on both sides ficheiro existente em ambos os lados -flash conflict\n -relâmpago conflito\n on one side only ficheiro existente apenas num lado -|> file on right side only\n -|> ficheiro apenas à direita\n diff --git a/BUILD/Languages/portuguese_br.lng b/BUILD/Languages/portuguese_br.lng index 359b22d1..5d6060b3 100644 --- a/BUILD/Languages/portuguese_br.lng +++ b/BUILD/Languages/portuguese_br.lng @@ -20,8 +20,10 @@ min sec seg -!= files are different\n -!= arquivos são diferentes\n +%x / %y objects deleted successfully +%x / %y objetos apagados com sucesso +%x Percent +%x Porcento %x directories %x diretórios %x files, @@ -48,6 +50,8 @@ &Criar um arquivo batch &Default &Config. Padrão +&Exit +&Sair &Export file list &Exportar lista de arquivos &File @@ -72,6 +76,8 @@ &Pausa &Quit &Sair +&Restore +&Restaurar &Retry &Tentar de Novo &Save @@ -80,20 +86,22 @@ &Sim , . -- do not copy\n -- não copiar\n - conflict - conflito - conflict (same date, different size) - conflito (mesma data, tamanho diferente) - different - diferente +- directory part only +- apenas a parte do diretório - equal - igual - exists left only - existe apenas à esquerda - exists right only - existe apenas à direita +- full file or directory name +- nome completo do arquivo ou diretório - left - esquerda - left newer @@ -102,8 +110,10 @@ - direita - right newer - mais recente à direita --> copy to right side\n --> copiar para o lado direito\n +- sibling of %dir +- equivalente de %dir +- sibling of %name +- equivalente de %name -Open-Source file synchronization- -Sincronização de Arquivos Open-Source- . @@ -124,22 +134,12 @@ 2. Usar '*' e '?' como caracteres coringa. 3. Exclude files directly on main grid via context menu. 3. Excluir arquivos diretamente do grid principal através do menu de contexto. -<- copy to left side\n -<- copiar para o lado esquerdo\n -<< left file is newer\n -<< arquivo à esquerda é mais recente\n <Directory> <Diretório> <Last session> <Última Sessão> <multiple selection> <seleção múltipla> -<| file on left side only\n -<| arquivo apenas à esquerda\n -== files are equal\n -== arquivos são iguais\n ->> right file is newer\n ->> arquivo à direita é mais recente\n A newer version of FreeFileSync is available: Uma nova versão do FreeFileSync foi encontrada: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About Sobre Action Ação +Add folder +Adicionar pasta Add folder pair Adicionar par de pastas All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Como o nome sugere, dois arquivos com o mesmo nome são assinalados como iguais se e somente se o seu conteúdo for idêntico. Esta opção é útil para controles de consistência mais do que para efeitos de backup. Portanto, a data dos arquivos não é levada em consideração.\n\nCom esta opção, a árvore de decisão é menor: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Criar um arquivo batch para sincronização automatizada. Para iniciar o modo batch, passar o nome do arquivo para o executável do FreeFileSync: FreeFileSync.exe <arquivo batch>. Também pode ser programado no Agendador de Tarefas do sistema operacional. +Auto-adjust columns +Autoajustar colunas Batch execution Execução do batch Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Ocultar arquivos/diretórios filtrados da lista Comma separated list Lista de itens separada por vÃrgula +Commandline +Linha de comando +Commandline is empty! +A linha de comando está vazia! Compare Comparar Compare both sides @@ -202,6 +210,8 @@ Comparing content... Comparando conteúdo... Comparison Result Resultado da Comparação +Comparison settings +Configurações da comparação Completed Finalizado Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Copiando arquivo %x para %y substituindo destino Could not determine volume name for file: Não foi possÃvel determinar o nome do volume para o arquivo: -Could not set working directory: -Não se pode definir pasta de trabalho: +Could not initialize directory monitoring: +Não foi possÃvel inicializar o monitoramento de diretórios: +Could not read values for the following XML nodes: + Create a batch job Criar arquivo batch Creating folder %x @@ -256,12 +268,18 @@ Custom Personalizado Customize columns Personalizar colunas +Customize... +Personalizar... DECISION TREE ÃRVORE DE DECISÃO Data remaining: Dados faltantes: Date Data +Delay +Atraso +Delay between two invocations of the commandline +Atraso entre duas chamadas de linhas de comando Delete files/folders existing on left side only Apagar arquivos/pastas existentes apenas no lado esquerdo Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Apagar em ambos os lados Delete on both sides even if the file is selected on one side only Apagar em ambos os lados mesmo se o arquivo está selecionado só em um lado +Delete or overwrite files permanently. +Apagar ou sobrescrever arquivos permanentemente. +Delete permanently +Apagar permanentemente Deleting file %x Apagando arquivo %x Deleting folder %x Apagando pasta %x +Deletion handling +Tratamento da exclusão Directories are dependent! Be careful when setting up synchronization rules: Diretórios são dependentes! Cuidado ao definir as regras de sincronização: +Directories to watch +Diretórios para monitorar Directory Diretório Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization Habilitar filtro para excluir arquivos da sincronização +Endless loop when traversing directory: +Loop infinito quando percorrendo diretório: Error Erro Error changing modification time: @@ -321,9 +349,13 @@ Erro ao apagar diretório: Error deleting file: Erro ao apagar arquivo: Error handling -Controlador de erros +Tratamento de erros Error loading library function: Erro ao carregar a biblioteca de funções: +Error moving directory: +Erro movendo diretório: +Error moving file: +Erro movendo arquivo: Error moving to Recycle Bin: Erro ao mover para a Lixeira: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Erro ao ler arquivo: Error resolving symbolic link: Erro na resolução de link simbólico: -Error retrieving full path: -Erro ao obter caminho completo: Error starting Volume Shadow Copy Service! Erro ao inicializar o Serviço de Cópias de Sombra de Volume! Error traversing directory: Erro ao percorrer diretório: +Error when monitoring directories. +Erro monitorando diretórios. Error writing file attributes: Erro ao escrever atributos do arquivo: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Ocultar arquivos que serão copiados para o lado esquerdo Hide files that will be copied to the right side Ocultar arquivos que serão copiados para o lado direito +Hide files that will be created on the left side +Ocultar arquivos que serão criados no lado esquerdo +Hide files that will be created on the right side +Ocultar arquivos que serão criados no lado direito +Hide files that will be deleted on the left side +Ocultar arquivos que serão apagados no lado esquerdo +Hide files that will be deleted on the right side +Ocultar arquivos que serão apagados no lado direito Hide files that won't be copied Ocultar arquivos que não serão copiados Hide filtered items Ocultar itens filtrados Hide further error messages during the current process Ocultar próximas mensagens de erro durante este processo -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Ocultar mensagens de erro durante a sincronização:\nElas serão armazenadas e mostradas em uma lista ao final do processo Hints: Dicas: Homepage @@ -486,8 +524,8 @@ Include Incluir Include temporarily Incluir temporariamente -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -Incluir: *.doc;*.zip;*.exe\nExcluir: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +Incluir: *.doc;*.zip;*.exe\nExcluir: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Inicialização da Lixeira falhou! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Não foi possÃvel acessar a Lixeira!\n\nÉ possÃvel que não esteja utilizando Windows.\nSe desejar esta opção incluÃda, favor contatar o autor. :) -Left: -Esquerda: +Left +Esquerda Load configuration from file Carregar configuração do arquivo Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Mover coluna para baixo Move column up Mover coluna para cima +Move files to a custom directory. +Mover arquivos para um diretório escolhido. +Move to custom directory +Mover para um diretório escolhido Moving %x to Recycle Bin Movendo %x para a Lixeira +Moving %x to custom directory +Movendo %x para o diretório escolhido Not all items have been synchronized! Have a look at the list. Nem todos os itens foram sincronizados! Olhe a lista. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Por favor, copie o \"Shadow.dll\" apropriado (localizado no arquivo \"Shadow.zip\") no diretório de instalação do FreeFileSync para habilitar essa funcionalidade. Please fill all empty directory fields. Por favor, preencha todos os campos de diretórios vazios. +Please specify alternate directory for deletion! +Por favor, especifique diretório alternativo para exclusão! Press button to activate filter Pressione para ativar o filtro Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Questão Quit Sair +RealtimeSync - Automated Synchronization +RealtimeSync - Sincronização Automátizada +RealtimeSync configuration +Configuração do RealtimeSync Relative path Caminho relativo +Remove folder +Remover pasta Remove folder pair Remover par de pastas +Report translation error +Reportar erro de tradução Reset Reiniciar Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Resetar todas as mensagens de aviso? Result Resultado -Right: -Direita: +Right +Direita S&ave configuration S&alvar configuração S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Mostrar arquivos que serão copiados para o lado esquerdo Show files that will be copied to the right side Mostrar arquivos que serão copiados para o lado direito +Show files that will be created on the left side +Mostrar arquivos que serão criados no lado esquerdo +Show files that will be created on the right side +Mostrar arquivos que serão criados no lado direito +Show files that will be deleted on the left side +Mostrar arquivos que serão apagados no lado esquerdo +Show files that will be deleted on the right side +Mostrar arquivos que serão apagados no lado direito Show files that won't be copied Mostrar arquivos que não serão copiados Show popup @@ -660,12 +722,14 @@ Synchronizing... Sincronizando... System out of memory! Sistema sem memória! +Target directory already existing! +Diretório de destino já existe! Target file already existing! Arquivo de destino já existe! The file does not contain a valid configuration: O arquivo não contém uma configuração válida: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Esta linha de comandos será executada cada vez que fizer duplo click em um arquivo. %name serve para reservar o lugar do arquivo selecionado. +This commandline will be executed on each doubleclick. The following macros are available: +Esta linha de comando será executada em cada click-duplo. As seguintes macros estão disponÃveis: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Esta variante avalia dois arquivos de nomes equivalentes como sendo iguais quando têm o mesmo tamanho E a mesma data e hora de modificação. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Conflitos não resolvidos existentes! \n\nVocê pode ignorar conflitos e continuar a sincronização. Update -> Atualizar -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Uso: Selecionar diretórios para monitoração e entre com uma linha de comando. Cada vez que os arquivos são modificados nesses diretórios (ou subdiretórios) a linha de comando é executada. Use Recycle Bin Utilizar Lixeira -Use Recycle Bin when deleting or overwriting files during synchronization -Utilizar a Lixeira ao apagar ou substituir arquivos durante a sincronização +Use Recycle Bin when deleting or overwriting files. +Usar a Lixeira quando apagar ou sobrescrever arquivos. Variant Variante Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Avisos: When the comparison is started with this option set the following decision tree is processed: Quando a comparação é iniciada com esta opção, a seguinte árvore de decisão é processada: +You can ignore the error to consider not existing directories as empty. +Você pode ignorar o erro para considerar como diretórios não existente como vazios. You may try to synchronize remaining items again (WITHOUT having to re-compare)! -Pode tentar sincronizar os elementos restantes outra vez (SEM ter que comparar novamente)! +Você pode tentar sincronizar os elementos restantes outra vez (SEM ter que comparar novamente)! different diferente file exists on both sides arquivo existe em ambos os lados -flash conflict\n -raio conflito\n on one side only existente apenas em um lado -|> file on right side only\n -|> arquivo apenas do lado direito\n diff --git a/BUILD/Languages/russian.lng b/BUILD/Languages/russian.lng index 2e3aa21e..231757e3 100644 --- a/BUILD/Languages/russian.lng +++ b/BUILD/Languages/russian.lng @@ -20,8 +20,10 @@ мин. sec Ñек. -!= files are different\n -!= файлы разные\n +%x / %y objects deleted successfully +%x / %y объектов удалено удачно +%x Percent +%x % %x directories %x папки %x files, @@ -45,15 +47,17 @@ &Check for new version &Проверить наличие новой верÑии &Create batch job -&Создать задание +&Создать задание... &Default &По-умолчанию +&Exit +&Выход &Export file list -&ÐкÑпортировать ÑпиÑок файлов +&ÐкÑпортировать ÑпиÑок файлов... &File &Файл &Global settings -&Глобальные наÑтройки +&Глобальные наÑтройки... &Help &Помощь &Ignore @@ -63,7 +67,7 @@ &Load &Загрузить &Load configuration -&Загрузить конфигурацию +&Загрузить конфигурацию... &No &Ðет &OK @@ -72,6 +76,8 @@ &Пауза &Quit &Выход +&Restore +&ВоÑÑтановить &Retry &Повторить &Save @@ -80,30 +86,34 @@ &Да , . -- do not copy\n - не копировать\n - conflict - конфликт +- конфликт - conflict (same date, different size) -конфликт (даты Ñовпадают, размеры разные) +- конфликт (даты Ñовпадают, размеры разные) - different -разные +- разные +- directory part only +- папка - equal -одинаковые +- одинаковые - exists left only -только левые ÑущеÑтвуют +- только левые ÑущеÑтвуют - exists right only -только правые ÑущеÑтвуют +- только правые ÑущеÑтвуют +- full file or directory name +- файл - left -левые +- левые - left newer -левые новее +- левые новее - right -правые +- правые - right newer -правые новее --> copy to right side\n --> Ñкопировать на правую Ñторону\n +- правые новее +- sibling of %dir +- Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸Ñ‡Ð½Ð°Ñ Ð¿Ð°Ð¿ÐºÐ° Ñ Ð´Ñ€ÑƒÐ³Ð¾Ð¹ Ñтороны +- sibling of %name +- аналогичный файл Ñ Ð´Ñ€ÑƒÐ³Ð¾Ð¹ Ñтороны -Open-Source file synchronization- Синхронизатор файлов Ñ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ñ‹Ð¼ иÑходным кодом . @@ -124,22 +134,12 @@ 2. ИÑпользуйте Ñимволы '*' и '?' Ð´Ð»Ñ Ð·Ð°Ð¼ÐµÐ½Ñ‹ неизвеÑтных. 3. Exclude files directly on main grid via context menu. 3. ИÑключите файлы прÑмо в главном окне через контекÑтное меню. -<- copy to left side\n -<- Ñкопировать на левую Ñторону\n -<< left file is newer\n -<< файл Ñлева новее\n <Directory> <Папка> <Last session> <ПоÑледнÑÑ ÑеÑÑиÑ> <multiple selection> <групповое выделение> -<| file on left side only\n -<| файлы только Ñлева\n -== files are equal\n -== файлы одинаковые\n ->> right file is newer\n ->> файлы Ñправа новее\n A newer version of FreeFileSync is available: ДоÑтупна Ð½Ð¾Ð²Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ FreeFileSync: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About О программе Action ДейÑтвие +Add folder +Добавить папку Add folder pair Добавить папку All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Как напиÑано в названии, два файла Ñ Ð¾Ð´Ð¸Ð½Ð°ÐºÐ¾Ð²Ñ‹Ð¼ именем отмечаютÑÑ Ñ€Ð°Ð²Ð½Ñ‹Ð¼Ð¸, только еÑли они имеют то же Ñамое Ñодержание. Ðта Ð¾Ð¿Ñ†Ð¸Ñ Ð¿Ð¾Ð»ÐµÐ·Ð½Ð° Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ ÑоглаÑованноÑти, а не операции резервного копированиÑ. ПоÑтому даты файлов не учитываютÑÑ Ð²Ð¾Ð¾Ð±Ñ‰Ðµ.\n\nС Ñтой опцией алгоритм короче: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Создайте файл Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð´Ð»Ñ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ð·Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð½Ð¾Ð¹ Ñинхронизации. Чтобы запуÑтить программу в Ñтом режиме проÑто передайте название файла на выполнение FreeFileSync: FreeFileSync.exe <batchfile>. Ðто также может быть запиÑано в планировщике задач Вашей операционной ÑиÑтемы. +Auto-adjust columns +Ðвтовыравнивание ширины колонок Batch execution Выполнение пакетного Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Выберите Ð´Ð»Ñ ÑÐºÑ€Ñ‹Ñ‚Ð¸Ñ Ð¾Ñ‚Ñ„Ð¸Ð»ÑŒÑ‚Ñ€Ð¾Ð²Ð°Ð½Ð½Ñ‹Ñ… файлов/папок из ÑпиÑка Comma separated list СпиÑок, разделÑемый запÑтыми +Commandline +ÐšÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока +Commandline is empty! +ÐšÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока пуÑта! Compare Сравнить Compare both sides @@ -202,6 +210,8 @@ Comparing content... Сравнение ÑодержаниÑ... Comparison Result Результаты ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ +Comparison settings +ÐаÑтройки ÑÑ€Ð°Ð²Ð½ÐµÐ½Ð¸Ñ Completed Завершено Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Копирование файла %x в %y Ñ Ð·Ð°Ð¼ÐµÐ½Ð¾Ð¹ Could not determine volume name for file: Ðе удалоÑÑŒ определить название тома Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð°: -Could not set working directory: -Ðе удалоÑÑŒ уÑтановить рабочую папку: +Could not initialize directory monitoring: +Ðе удалоÑÑŒ инициализировать папку Ð´Ð»Ñ Ð¼Ð¾Ð½Ð¸Ñ‚Ð¾Ñ€Ð¸Ð½Ð³Ð°: +Could not read values for the following XML nodes: +Ðе удалоÑÑŒ прочитать Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð»Ñ Ñледующих XML запиÑей: Create a batch job Создать пакетное задание Creating folder %x @@ -256,28 +268,42 @@ Custom Выборочно Customize columns Выбор колонок +Customize... +Выбрать колонки... DECISION TREE Древо решений Data remaining: ОÑталоÑÑŒ: Date Дата +Delay +Задержка +Delay between two invocations of the commandline +Задержка между Ð´Ð²ÑƒÐ¼Ñ Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñми к командной Ñтроке Delete files/folders existing on left side only -Удалить файлы/папки, ÑущеÑтвующие только на левой Ñтороне +УдалÑÑ‚ÑŒ файлы/папки, ÑущеÑтвующие только на левой Ñтороне Delete files/folders existing on right side only -Удалить файлы/папки, ÑущеÑтвующие только на правой Ñтороне +УдалÑÑ‚ÑŒ файлы/папки, ÑущеÑтвующие только на правой Ñтороне Delete files\tDEL -Удалить файлы\tDEL +Удалить файл(Ñ‹)...\tDEL Delete on both sides -Удалить на обоих Ñторонах +Удалить Ñ Ð¾Ð±ÐµÐ¸Ñ… Ñторон Delete on both sides even if the file is selected on one side only -Удалить на обоих Ñторонах, еÑли даже файл выделен только на одной Ñтороне +Удалить Ñ Ð¾Ð±ÐµÐ¸Ñ… Ñторон, еÑли даже файл выделен только на одной Ñтороне +Delete or overwrite files permanently. +УдалÑÑ‚ÑŒ или перезапиÑать файлы, не Ð¿Ð¾Ð¼ÐµÑ‰Ð°Ñ Ð² Корзину +Delete permanently +УдалÑÑ‚ÑŒ, не Ð¿Ð¾Ð¼ÐµÑ‰Ð°Ñ Ð² "Корзину" Deleting file %x Удаление файла %x Deleting folder %x Удаление папки %x +Deletion handling +ÐаÑтройки ÑƒÐ´Ð°Ð»ÐµÐ½Ð¸Ñ Directories are dependent! Be careful when setting up synchronization rules: ЗавиÑимые папки! Будьте внимательны при наÑтройке правил Ñинхронизации: +Directories to watch +Папки Ð´Ð»Ñ Ð½Ð°Ð±Ð»ÑŽÐ´ÐµÐ½Ð¸Ñ Directory Папка Directory does not exist: @@ -306,6 +332,8 @@ Email Почта Enable filter to exclude files from synchronization Применить фильтр, чтобы иÑключить файлы из Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ð½Ð° Ñинхронизацию +Endless loop when traversing directory: +Зацикливание при вÑтрече переÑекающихÑÑ Ð¿ÑƒÑ‚ÐµÐ¹: Error Ошибка Error changing modification time: @@ -324,6 +352,10 @@ Error handling Обработка ошибок Error loading library function: Ошибка при загрузке функции библиотеки: +Error moving directory: +Ошибка Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¿ÐºÐ¸: +Error moving file: +Ошибка Ð¿ÐµÑ€ÐµÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð°: Error moving to Recycle Bin: Ошибка при отправке в Корзину: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Ошибка при чтении файла: Error resolving symbolic link: Ошибка при решении ÑимволичеÑкой ÑÑылки: -Error retrieving full path: -Ошибка при получении полного пути: Error starting Volume Shadow Copy Service! Ошибка при запуÑке Службы Теневого ÐšÐ¾Ð¿Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¢Ð¾Ð¼Ð°! Error traversing directory: Ошибка при переÑечении папок: +Error when monitoring directories. +Ошибка при мониторинге папок. Error writing file attributes: Ошибка при запиÑи параметров файла: Error writing file: @@ -387,7 +419,7 @@ Files %x have a file time difference of less than 1 hour! It's not safe to decid Files %x have the same date but a different size! Файлы %x имеют одинаковую дату, но различаютÑÑ Ð¿Ð¾ размеру! Files are found equal if\n - file content\nis the same. -Файлы ÑчитаютÑÑ Ñ€Ð°Ð²Ð½Ñ‹Ð¼Ð¸, еÑли\n - Ñодержание файлов одинаковое +Файлы ÑчитаютÑÑ Ñ€Ð°Ð²Ð½Ñ‹Ð¼Ð¸, еÑли Ñодержание файлов одинаковое Files are found equal if\n - filesize\n - last write time and date\nare the same. Файлы ÑчитаютÑÑ Ñ€Ð°Ð²Ð½Ñ‹Ð¼Ð¸, еÑли одинаковые\n - размер файла\n - дата и Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð¾Ñледнего Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Files remaining: @@ -399,7 +431,7 @@ Files that exist on both sides, left one is newer Files that exist on both sides, right one is newer Файлы, ÑущеÑтвующие на обоих Ñторонах, правый новее Files/folders remaining: -Файлов/папко оÑталоÑÑŒ: +Файлов/папок оÑталоÑÑŒ: Files/folders scanned: Файлов/папок проÑканировано: Files/folders that exist on left side only @@ -427,9 +459,9 @@ FreeFileSync на Sourceforge FreeFileSync batch file Файл Ð·Ð°Ð´Ð°Ð½Ð¸Ñ FreeFileSync FreeFileSync configuration -FreeFileSync наÑтройка +ÐаÑтройка FreeFileSync FreeFileSync is up to date! -У Ð’Ð°Ñ Ñамый поÑледний FreeFileSync! +У Ð’Ð°Ñ ÑÐ°Ð¼Ð°Ñ Ð¿Ð¾ÑледнÑÑ Ð²ÐµÑ€ÑÐ¸Ñ FreeFileSync! Full path Полный путь Generating file list... @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Скрыть файлы, которые будут Ñкопированы на левую Ñторону Hide files that will be copied to the right side Скрыть файлы, которые будут Ñкопированы на правую Ñторону +Hide files that will be created on the left side +Скрыть файлы, которые будут Ñозданы на левой Ñтороне +Hide files that will be created on the right side +Скрыть файлы, которые будут Ñозданы на правой Ñтороне +Hide files that will be deleted on the left side +Скрыть файлы, которые будут удалены на левой Ñтороне +Hide files that will be deleted on the right side +Скрыть файлы, которые будут удалены на правой Ñтороне Hide files that won't be copied Скрыть файлы, которые не будут Ñкопированы Hide filtered items Скрыть отфильтрованные Hide further error messages during the current process Скрыть поÑледующие ошибки во Ð²Ñ€ÐµÐ¼Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ³Ð¾ процеÑÑа -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Скрыть ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках во Ð²Ñ€ÐµÐ¼Ñ Ñинхронизации:\nони накапливаютÑÑ Ð¸ показываютÑÑ ÐºÐ°Ðº ÑпиÑок в конце процеÑÑа Hints: ПодÑказка: Homepage @@ -486,8 +524,8 @@ Include Ð’ÐºÐ»ÑŽÑ‡Ð°Ñ Include temporarily Ð’ÐºÐ»ÑŽÑ‡Ð°Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ðµ -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -ВключаÑ: *.doc;*.zip;*.exe\nИÑключаÑ: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +ВключаÑ: *.doc;*.zip;*.exe\nИÑключаÑ: temp\\* Info Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Ð˜Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ ÐšÐ¾Ñ€Ð·Ð¸Ð½Ñ‹ провалена! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Ðевозможно инициализировать Корзину!\n\nВероÑтно, что Ð’Ñ‹ не иÑпользуете Windows.\nЕÑли Ð’Ñ‹ хотите, чтобы Ñта Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð±Ñ‹Ð»Ð°, пожалуйÑта ÑвÑжитеÑÑŒ Ñ Ð°Ð²Ñ‚Ð¾Ñ€Ð¾Ð¼.:) -Left: -Слева: +Left +Слева Load configuration from file Загрузить конфигурацию из файла Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down ПеремеÑтить вниз Move column up ПеремеÑтить вверх +Move files to a custom directory. +Перемещать файлы в выбранную папку +Move to custom directory +Перемещать в выбранную папку Moving %x to Recycle Bin Отправка %x в Корзину +Moving %x to custom directory +ПеремеÑтить %x в выбранную папку Not all items have been synchronized! Have a look at the list. Ðе вÑе пункты были Ñинхронизированы! ПоÑмотрите ÑпиÑок. Not enough free disk space available in: @@ -535,7 +579,7 @@ OK Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the synchronization directories. Только файлы/папки, которые проходÑÑ‚ фильтрацию, будут отобраны Ð´Ð»Ñ Ñинхронизации. Ðтот фильтр будет применÑÑ‚ÑŒÑÑ Ðº пути папки. Open with File Manager\tD-Click -Открыть файловым менеджером\tD-Click +Открыть в Проводнике...\tD-Click Operation aborted! ÐžÐ¿ÐµÑ€Ð°Ñ†Ð¸Ñ Ð¾Ñ‚Ð¼ÐµÐ½ÐµÐ½Ð°! Operation: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i ПожалуйÑта, Ñкопируйте ÑоответÑтвующий \"Shadow.dll\" (находÑщийÑÑ Ð² архиве \"Shadow.zip\") в папку уÑтановки FreeFileSync Ð´Ð»Ñ Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ñтой функции. Please fill all empty directory fields. ПожалуйÑта, заполните вÑе пуÑтые Ð¿Ð¾Ð»Ñ Ð¿Ð°Ð¿Ð¾Ðº +Please specify alternate directory for deletion! +ПроÑьба указать альтернативную папку Ð´Ð»Ñ ÑƒÐ´Ð°Ð»ÐµÐ½Ñ‹Ñ… файлов! Press button to activate filter Включить фильтр Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Ð’Ð¾Ð¿Ñ€Ð¾Ñ Quit Выход +RealtimeSync - Automated Synchronization +RealtimeSync - ÐвтоматичеÑÐºÐ°Ñ ÑÐ¸Ð½Ñ…Ñ€Ð¾Ð½Ð¸Ð·Ð°Ñ†Ð¸Ñ +RealtimeSync configuration +ÐаÑтройка RealtimeSync Relative path ОтноÑительный путь +Remove folder +Удалить папку Remove folder pair Удалить папку +Report translation error +Сообщить об ошибке перевода Reset СброÑить Reset all warning messages @@ -570,10 +624,10 @@ Reset all warning messages? СброÑить вÑе ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ñ Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñми? Result ОпиÑание -Right: -Справа: +Right +Справа S&ave configuration -Сохранить конфигурацию +Сохранить конфигурацию... S&witch view Переключить вид Save changes to current configuration? @@ -585,7 +639,7 @@ Scanning... Scanning: Сканирую: Select a folder -Выделить папку +Выбрать папку Select logfile directory: Выберите папку Ð´Ð»Ñ Ð»Ð¾Ð³-файлов: Select variant: @@ -610,6 +664,14 @@ Show files that will be copied to the left side Показать файлы, которые будут Ñкопированы на левую Ñторону Show files that will be copied to the right side Показать файлы, которые будут Ñкопированы на правую Ñторону +Show files that will be created on the left side +Показать файлы, которые будут Ñозданы на левой Ñтороне +Show files that will be created on the right side +Показать файлы, которые будут Ñозданы на правой Ñтороне +Show files that will be deleted on the left side +Показать файлы, которые будут удалены на левой Ñтороне +Show files that will be deleted on the right side +Показать файлы, которые будут удалены на правой Ñтороне Show files that won't be copied Показать файлы, которые не будут Ñкопированы Show popup @@ -637,7 +699,7 @@ Statistics Stop Стоп Swap sides - +ПоменÑÑ‚ÑŒ направление Synchronization Preview ПредпроÑмотр Ñинхронизации Synchronization aborted! @@ -660,12 +722,14 @@ Synchronizing... СинхронизациÑ... System out of memory! Ðехватка памÑти! +Target directory already existing! +ÐšÐ¾Ð½ÐµÑ‡Ð½Ð°Ñ Ð¿Ð°Ð¿ÐºÐ° уже ÑущеÑтвует! Target file already existing! Конечный файл уже ÑущеÑтвует! The file does not contain a valid configuration: Файл не Ñодержит дейÑтвительную конфигурацию: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Ðта ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока будет выполнÑÑ‚ÑŒÑÑ ÐºÐ°Ð¶Ð´Ñ‹Ð¹ раз, когда Ð’Ñ‹ дважды кликните на имени файла. %name Ñлужит указателем меÑта Ð´Ð»Ñ Ð²Ñ‹Ð±Ñ€Ð°Ð½Ð½Ð¾Ð³Ð¾ файла. +This commandline will be executed on each doubleclick. The following macros are available: +Ðта ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока будет выполнÑÑ‚ÑŒÑÑ Ð¿Ñ€Ð¸ каждом двойном клике. Следующие макроÑÑ‹ доÑтупны: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Ðтот вариант Ñравнивает два файла Ñ Ð¾Ð´Ð¸Ð½Ð°ÐºÐ¾Ð²Ñ‹Ð¼Ð¸ именами и Ñчитает их равными, еÑли они имеют одинаковый размер файла и одинаковую дату и Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð¾Ñледнего изменениÑ. Time @@ -681,7 +745,7 @@ Total required free disk space: Total time: Общее времÑ: Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes. -Обрабатывать файлы, которые отличаютÑÑ Ð¿Ð¾ времени на 1 чаÑ, как равные, менее чем на 1 чаÑ, как конфликтные, чтобы ÑправитьÑÑ Ñ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´Ð¾Ð¼ на летнее времÑ. +Учитывать файлы, которые отличаютÑÑ Ð¿Ð¾ времени на 1 чаÑ, как равные, менее чем на 1 чаÑ, как конфликтные, чтобы учеÑÑ‚ÑŒ переход на летнее времÑ. Two way <-> Ð’ обоих направлениÑÑ… <-> Unable to connect to sourceforge.net! @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro СущеÑтвуют нерешенные конфликты \n\nÐ’Ñ‹ можете проигнорировать их и продолжить Ñинхронизацию. Update -> Обновить -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Выберите папки Ð´Ð»Ñ Ð¼Ð¾Ð½Ð¸Ñ‚Ð¾Ñ€Ð¸Ð½Ð³Ð° и введите командную Ñтроку. Каждый раз при обновлении Ñтих папок (или их подпапок) ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока будет выполнÑÑ‚ÑŒÑÑ. Use Recycle Bin ИÑпользовать "Корзину" -Use Recycle Bin when deleting or overwriting files during synchronization -ИÑпользовать "Корзину" при удалении или перезапиÑи во Ð²Ñ€ÐµÐ¼Ñ Ñинхронизации +Use Recycle Bin when deleting or overwriting files. +ИÑпользовать "Корзину" при удалении или перезапиÑи файлов Variant Вариант Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: ПредупреждениÑ: When the comparison is started with this option set the following decision tree is processed: Когда Ñравнение запущено Ñ Ñтими критериÑми, алгоритм Ñледующий: +You can ignore the error to consider not existing directories as empty. +Ð’Ñ‹ можете проигнорировать ошибку, принÑв неÑущеÑтвующие папки за пуÑтые. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Ð’Ñ‹ можете попытатьÑÑ Ñинхронизировать оÑтавшиеÑÑ Ð¿ÑƒÐ½ÐºÑ‚Ñ‹ Ñнова (без повторного ÑравнениÑ)! different разные file exists on both sides файлы ÑущеÑтвуют на обоих Ñторонах -flash conflict\n -Ð¼Ð¾Ð»Ð½Ð¸Ñ ÐºÐ¾Ð½Ñ„Ð»Ð¸ÐºÑ‚\n on one side only файлы ÑущеÑтвуют только на одной Ñтороне -|> file on right side only\n -|> файлы только на правой Ñтороне\n diff --git a/BUILD/Languages/slovenian.lng b/BUILD/Languages/slovenian.lng index 90ecd55c..5e77766b 100644 --- a/BUILD/Languages/slovenian.lng +++ b/BUILD/Languages/slovenian.lng @@ -20,8 +20,10 @@ min sec sek -!= files are different\n -!= datoteki sta razliÄni\n +%x / %y objects deleted successfully +%x / %y objektov uspeÅ¡no izbrisanih +%x Percent +%x Procentov %x directories %x imeniki %x files, @@ -48,6 +50,8 @@ &Ustvari batch opravilo &Default &Privzeto +&Exit +&Izhod &Export file list &Izvozi seznam datotek &File @@ -72,6 +76,8 @@ Na&loži konfiguracijo &Pavza &Quit &Zapri +&Restore +&Obnovi &Retry &Ponovi &Save @@ -80,20 +86,22 @@ Na&loži konfiguracijo &Da , , -- do not copy\n -- ne kopiraj\n - conflict - spor - conflict (same date, different size) - spor (isti datum, razliÄna velikost) - different - razliÄni +- directory part only +- del, ki zajema samo imenike - equal - enaki - exists left only - obstaja samo na levi - exists right only - obstaja samo na desni +- full file or directory name +- polno ime datoteke ali imenika - left - levo - left newer @@ -102,8 +110,10 @@ Na&loži konfiguracijo - desno - right newer - desna novejÅ¡a --> copy to right side\n --> kopiraj na desno stran\n +- sibling of %dir +- v sorodu z %dir +- sibling of %name +- v sorodu z %name -Open-Source file synchronization- -Odprto-kodna sinhronizacija datotek- . @@ -124,22 +134,12 @@ Na&loži konfiguracijo 2. Uporabite lahko tudi znake '*' in '?'. 3. Exclude files directly on main grid via context menu. 3. IzkljuÄite datoteke neposredno na glavni mreži s kontekstnim menujem. -<- copy to left side\n -<- kopiraj na levo stran\n -<< left file is newer\n -<< leva datoteka je novejÅ¡a\n <Directory> <Imenik> <Last session> <Zadnja seja> <multiple selection> <mnogokratna izbira> -<| file on left side only\n -<| datoteka obstaja samo na levi\n -== files are equal\n -== datoteki sta enaki\n ->> right file is newer\n ->> desna datoteka je novejÅ¡a\n A newer version of FreeFileSync is available: Na voljo je nova razliÄica FreeFileSync: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About O programu(1) Action Ukrep +Add folder +Dodaj mapo Add folder pair Dodaj par imenikov All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Kot že samo ime pove, sta dve datoteki oznaÄeni kot enaki samo takrat, ko imata enako vsebino. Ta možnost je bolj uporabna za preverjanje doslednosti kot za operacije varnostnega shranjevanja. Zaradi tega se Äasi datotek ne upoÅ¡tevajo.\n\nZ omogoÄeno to možnostjo je drevo odloÄanja manjÅ¡e: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Sestavi batch datoteko za samodejno sinhronizacijo. Da zaÄnete v batch naÄinu, preprosto podajte ime datoteke k FreeFileSync izvrÅ¡ilni datoteki: FreeFileSync.exe <imedatotekebatch>. To se lahko tudi nastavi v urniku opravil vaÅ¡ega operacijskega sistema. +Auto-adjust columns +Samo-prilagodi stolpce Batch execution Batch izvajanje Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Skrij filtrirane datoteke/imenike iz seznama Comma separated list Seznam loÄen z vejico +Commandline +Ukazna vrstica +Commandline is empty! +Ukazna vrstica je prazna! Compare Primerjaj Compare both sides @@ -202,6 +210,8 @@ Comparing content... Primerjam vsebino... Comparison Result Rezultati primerjave +Comparison settings +Nastavitve primerjanja Completed ZakljuÄeno Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Kopiram datoteko %x v %y s prepisovanjem cilja Could not determine volume name for file: Ne morem doloÄiti imena volumna za datoteko: -Could not set working directory: -Ne morem nastaviti delovnega imenika: +Could not initialize directory monitoring: +Ne morem zaÄeti nadzorovanja imenikov: +Could not read values for the following XML nodes: + Create a batch job Ustvari batch opravilo Creating folder %x @@ -256,12 +268,18 @@ Custom Po meri Customize columns Stolpce prikroji po meri +Customize... +Prilagodi... DECISION TREE DREVO ODLOÄŒITEV Data remaining: Preostanek podatkov: Date Datum +Delay +Zakasnitev +Delay between two invocations of the commandline +Zakasnitev med dvema pozivoma ukazne vrstice Delete files/folders existing on left side only IzbriÅ¡i datoteke/mape, ki obstajajo samo na levi strani Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides IzbriÅ¡i na obeh straneh Delete on both sides even if the file is selected on one side only IzbriÅ¡i na obeh straneh, Äetudi je datoteka izbrana na samo eni strani +Delete or overwrite files permanently. +Trajno izbriÅ¡i ali prepiÅ¡i datoteke. +Delete permanently +Trajno izbriÅ¡i Deleting file %x Brisanje datoteke %x Deleting folder %x Brisanje mape %x +Deletion handling +Postopanje pri brisanju Directories are dependent! Be careful when setting up synchronization rules: Imeniki so v odvisnosti! Bodite pozorni, ko nastavljate sinhronizacijska pravila: +Directories to watch +Imenika za nadzorovanje Directory Imenik Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization OmogoÄi filter, da se datoteke izkljuÄi iz sinhronizacije +Endless loop when traversing directory: +NeskonÄna zanka pri prehodu imenika: Error Napaka Error changing modification time: @@ -324,6 +352,10 @@ Error handling Napaka pri obravnavanju Error loading library function: Napaka pri nalaganju funkcije iz knjižnice: +Error moving directory: +Napaka pri premikanju imenika: +Error moving file: +Napaka pri premikanju datoteke: Error moving to Recycle Bin: Napaka pri premikanju v KoÅ¡: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Napaka pri branju datoteke: Error resolving symbolic link: Napaka pri razreÅ¡evanju simboliÄne povezave: -Error retrieving full path: -Napaka pri pridobivanju polne poti: Error starting Volume Shadow Copy Service! Napaka pri zagonu servisa Volume Shadow Copy! Error traversing directory: Napaka pri prehajanju imenika: +Error when monitoring directories. +Napaka pri nadzorovanju imenikov. Error writing file attributes: Napaka pri pisanju atributov datoteke: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Skrij datoteke, ki bodo kopirane na levo stran Hide files that will be copied to the right side Skrij datoteke, ki bodo kopirane na desno stran +Hide files that will be created on the left side +Skrij datoteke, ki bodo ustvarjene na levi strani +Hide files that will be created on the right side +Skrij datoteke, ki bodo ustvarjene na desni strani +Hide files that will be deleted on the left side +Skrij datoteke, ki bodo izbrisane na levi strani +Hide files that will be deleted on the right side +Skrij datoteke, ki bodo izbrisane na desni strani Hide files that won't be copied Skrij datoteke, ki ne bodo kopirane Hide filtered items Skrij filtrirane predmete Hide further error messages during the current process Skrijte nadaljnja obvestila o napakah med trenutnim procesom -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Skrij obvestila o napakah med sinhronizacijo:\nObvestila se zbirajo in se prikažejo kot seznam na koncu procesa Hints: Namigi: Homepage @@ -486,8 +524,8 @@ Include VkljuÄi Include temporarily Trenutno vkljuÄi -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* -VkljuÄi: *.doc;*.zip;*.exe\nIzkljuÄi: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* +VkljuÄi: *.doc;*.zip;*.exe\nIzkljuÄi: temp\\* Info Info Information @@ -496,8 +534,8 @@ Initialization of Recycle Bin failed! Inicializacija KoÅ¡a ni uspela! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) Ni bilo mogoÄe inicializirati KoÅ¡a!\n\nZgleda, da ne uporabljate Windowsov.\nÄŒe želite imeti vkljuÄeno to lastnost, prosimo kontaktirajte avtorja. :) -Left: -Levo: +Left +Levo Load configuration from file Naloži konfiguracijo iz datoteke Load configuration history (press DEL to delete items) @@ -516,8 +554,14 @@ Move column down Premakni stolpec dol Move column up Premakni stolpec gor +Move files to a custom directory. +Premakni datoteke v imenik po meri. +Move to custom directory +Premakni v imenik po meri Moving %x to Recycle Bin Premikam %x v KoÅ¡ +Moving %x to custom directory +Premikam %x v imenik po meri Not all items have been synchronized! Have a look at the list. Vse stvari niso bile sinhronizirane! Preglejte seznam. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Prosim prekopirajte ustrezno \"Shadow.dll\" (ki se nahaja v \"Shadow.zip\" arhivu) v FreeFileSync namestitveni imenik, da omogoÄite to lastnost. Please fill all empty directory fields. Prosim izpolnite vse imenike s praznimi polji. +Please specify alternate directory for deletion! +Prosim navedite alternativen imenik za brisanje! Press button to activate filter Kliknite za aktivacijo filtra Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question VpraÅ¡anje Quit Zapusti +RealtimeSync - Automated Synchronization +RealtimeSync - Avtomatizirana sinhronizacija +RealtimeSync configuration +RealtimeSync nastavitve Relative path Relativna pot +Remove folder +Odstrani v mapo Remove folder pair Odstrani par imenikov +Report translation error +PoroÄaj o napaki prevoda Reset Ponastavi Reset all warning messages @@ -570,8 +624,8 @@ Reset all warning messages? Ponastavim vsa obvestila z opozorili? Result Rezultat -Right: -Desno: +Right +Desno S&ave configuration Shr&ani konfiguracijo S&witch view @@ -610,6 +664,14 @@ Show files that will be copied to the left side Prikaži datoteke, ki bodo kopirane na levo stran Show files that will be copied to the right side Prikaži datoteke, ki bodo kopirane na desno stran +Show files that will be created on the left side +Prikaži datoteke, ki bodo ustvarjene na levi strani +Show files that will be created on the right side +Prikaži datoteke, ki bodo ustvarjene na desni strani +Show files that will be deleted on the left side +Prikaži datoteke, ki bodo izbrisane na levi strani +Show files that will be deleted on the right side +Prikaži datoteke, ki bodo izbrisane na desni strani Show files that won't be copied Prikaži datoteke, ki ne bodo kopirane Show popup @@ -660,12 +722,14 @@ Synchronizing... Sinhroniziram... System out of memory! Sistemu je zmanjkalo pomnilnika! +Target directory already existing! + Target file already existing! Ciljna datoteka že obstaja! The file does not contain a valid configuration: Datoteka ne vsebuje veljavne konfiguracije: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Ta ukaz bo izveden vsakiÄ, ko boste dvokliknili na ime datoteke. %name služi kot rezerviran prostor za izbrano datoteko. +This commandline will be executed on each doubleclick. The following macros are available: +Ta ukazna vrstica bo izvedena ob vsakem dvokliku. Na voljo so naslednji makri: This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Ta varianta oceni dve datoteki z enakim imenom kot enaki, ko imata enako velikost IN enak datum ter Äas zadnjega spreminjanja. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Obstajajo nereÅ¡eni spori! \n\nLahko ignorirate spore in nadaljujete s sinhronizacijo. Update -> Posodobi -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. +Uporaba: Izberite imenike za nadzorovanje in vnesite ukazno vrstico. VsakiÄ ko se spremenijo datoteke znotraj teh imenikov (ali podimenikov) se izvrÅ¡i ukazna vrstica. Use Recycle Bin Uporabi KoÅ¡ -Use Recycle Bin when deleting or overwriting files during synchronization -Uporabi KoÅ¡, ko se briÅ¡e ali prepisuje datoteke med sinhronizacijo +Use Recycle Bin when deleting or overwriting files. +Uporabi KoÅ¡ pri brisanju ali prepisovanju datotek. Variant RazliÄica Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Opozorila: When the comparison is started with this option set the following decision tree is processed: Ko se primerjava zažene s tem setom možnosti, se obdela naslednje drevo odloÄitev: +You can ignore the error to consider not existing directories as empty. +Ignoriraj napako za smatranje neobstojeÄih imenikv kot praznih. You may try to synchronize remaining items again (WITHOUT having to re-compare)! Naslednje predmete lahko ponovno poskusite sinhronizirati (BREZ ponovne primerjave) ! different razliÄni file exists on both sides datoteka obstaja na obeh straneh -flash conflict\n -strela spor\n on one side only samo na eni strani -|> file on right side only\n -|> datoteka obstaja samo na desni\n diff --git a/BUILD/Languages/spanish.lng b/BUILD/Languages/spanish.lng index 5db32640..c3029efc 100644 --- a/BUILD/Languages/spanish.lng +++ b/BUILD/Languages/spanish.lng @@ -20,8 +20,10 @@ sec -!= files are different\n -!= los ficheros son diferentes\n +%x / %y objects deleted successfully + +%x Percent + %x directories %x directorios %x files, @@ -48,6 +50,8 @@ &Crear un fichero batch &Default &Config. por defecto +&Exit + &Export file list &Exportar lista de ficheros &File @@ -72,6 +76,8 @@ &Pausa &Quit &Salir +&Restore + &Retry &Reintentar &Save @@ -80,20 +86,22 @@ , , -- do not copy\n - - conflict - conflict (same date, different size) - different - ficheros diferentes +- directory part only + - equal - ficheros iguales - exists left only - existe sólo en la izquierda - exists right only - existe sólo en la derecha +- full file or directory name + - left - izquierda - left newer @@ -102,7 +110,9 @@ - derecha - right newer - el más nuevo en la derecha --> copy to right side\n +- sibling of %dir + +- sibling of %name -Open-Source file synchronization- -Sincronización de ficheros Open-Source- @@ -124,22 +134,12 @@ 2. Usar '*' y '?' como caracteres comodÃn. 3. Exclude files directly on main grid via context menu. 3. Excluir directamente ficheros sobre la rejilla a través del menu de contexto. -<- copy to left side\n - -<< left file is newer\n -<< el fichero de la izquierda es el más nuevo\n <Directory> <Directorio> <Last session> <Última sesión> <multiple selection> <Selección múltiple> -<| file on left side only\n -<| sólamente el fichero del lado izquierdo\n -== files are equal\n - ->> right file is newer\n ->> el fichero de la derecha es el más nuevo\n A newer version of FreeFileSync is available: Abort requested: Waiting for current operation to finish... @@ -150,6 +150,8 @@ About Sobre Action Acción +Add folder + Add folder pair Añadir un par de carpetas All items have been synchronized! @@ -162,6 +164,8 @@ As the name suggests, two files which share the same name are marked as equal if Como el nombre sugiere, dos ficheros que comparten el mismo nombre son marcados como iguales sólo si tienen el mismo contenido. Esta opción es útil para los chequeos de consistencia más que en operaciones de "backup". Por tanto, las fechas de los ficheros no se tienen en cuenta de ningún modo.\n\nCon esta opción habilitada el árbol de decisiones es más pequeño: Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe <batchfile>. This can also be scheduled in your operating system's task planner. Crear un fichero "batch" para una sincronización automática. Para empezar en modo "batch" simplemente pasar el nombre del fichero al ejecutable FreeFileSyinc en la ventana de comandos (CMD): FreeFileSync.exe <nombre de fichero batch>. También puede ser planificada en el Administrador de Tareas programadas. +Auto-adjust columns + Batch execution Ejecución del "batch" Batch file created successfully! @@ -184,6 +188,10 @@ Choose to hide filtered files/directories from list Ocultar en la lista ficheros/directorios filtrados Comma separated list Lista de "items" separados por coma +Commandline + +Commandline is empty! + Compare Compare both sides @@ -202,6 +210,8 @@ Comparing content... Comparison Result +Comparison settings + Completed Terminado Configuration @@ -244,8 +254,10 @@ Copying file %x to %y overwriting target Could not determine volume name for file: -Could not set working directory: -No se pudo definir el directorio de trabajo: +Could not initialize directory monitoring: + +Could not read values for the following XML nodes: + Create a batch job Crear una tarea "batch" Creating folder %x @@ -256,12 +268,18 @@ Custom Personalizado Customize columns Personalizar columnas +Customize... + DECISION TREE ÃRBOL DE DECISIÓN Data remaining: Datos que faltan: Date Fecha +Delay + +Delay between two invocations of the commandline + Delete files/folders existing on left side only Eliminar sólo ficheros/carpetas existentes en el lado izquierdo Delete files/folders existing on right side only @@ -272,12 +290,20 @@ Delete on both sides Eliminar en ambos lados lados Delete on both sides even if the file is selected on one side only Eliminar en ambos lados incluso si el fichero es seleccionado en un solo lado +Delete or overwrite files permanently. + +Delete permanently + Deleting file %x Borrar fichero %x Deleting folder %x Borrar carpeta %x +Deletion handling + Directories are dependent! Be careful when setting up synchronization rules: ¡Los directorios son dependientes! Cuidado al establecer las reglas de sincronización: +Directories to watch + Directory Directory does not exist: @@ -306,6 +332,8 @@ Email Email Enable filter to exclude files from synchronization +Endless loop when traversing directory: + Error Error Error changing modification time: @@ -324,6 +352,10 @@ Error handling Controlador de errores Error loading library function: Error al descargar función de biblioteca: +Error moving directory: + +Error moving file: + Error moving to Recycle Bin: Error al mover a la Papelera: Error opening file: @@ -336,12 +368,12 @@ Error reading file: Error al leer el fichero: Error resolving symbolic link: Error al resolver enlace simbólico: -Error retrieving full path: - Error starting Volume Shadow Copy Service! Error traversing directory: Error al trasladar directorio: +Error when monitoring directories. + Error writing file attributes: Error al escribir atributos del fichero: Error writing file: @@ -458,14 +490,20 @@ Hide files that will be copied to the left side Hide files that will be copied to the right side +Hide files that will be created on the left side + +Hide files that will be created on the right side + +Hide files that will be deleted on the left side + +Hide files that will be deleted on the right side + Hide files that won't be copied Hide filtered items Ocultar items filtrados Hide further error messages during the current process Ocultar próximos mensajes de error durante este processo -Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process -Ocultar mensajes de error durante la sincronización:\nSerán recopilados y mostrados como una lista al final del proceso Hints: Consejos: Homepage @@ -486,7 +524,7 @@ Include Incluir Include temporarily Incluir temporalmente -Include: *.doc;*.zip;*.exe\nExclude: \\temp\\* +Include: *.doc;*.zip;*.exe\nExclude: temp\\* Info Info @@ -496,7 +534,7 @@ Initialization of Recycle Bin failed! ¡El inicio de la Papelera falló! It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :) ¡No fue posible iniciar la Papelera!\n\nEs probable que no esté usando Windows.\nSi quiere que este hecho sea considerado, por favor, contactate con el autor :) -Left: +Left Load configuration from file Cargar configuración desde fichero @@ -516,8 +554,14 @@ Move column down Mover columna abajo Move column up Mover columna arriba +Move files to a custom directory. + +Move to custom directory + Moving %x to Recycle Bin +Moving %x to custom directory + Not all items have been synchronized! Have a look at the list. Not enough free disk space available in: @@ -550,6 +594,8 @@ Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) i Please fill all empty directory fields. Por favor, rellene todos los campos del directorio vacÃos. +Please specify alternate directory for deletion! + Press button to activate filter Presione el botón para activar el filtro Published under the GNU General Public License: @@ -558,10 +604,18 @@ Question Quit Salir +RealtimeSync - Automated Synchronization + +RealtimeSync configuration + Relative path Camino relativo +Remove folder + Remove folder pair Eliminar par de carpetas +Report translation error + Reset Reiniciar Reset all warning messages @@ -570,7 +624,7 @@ Reset all warning messages? ¿Reiniciar todos los mensajes de aviso? Result Resultado -Right: +Right S&ave configuration G&uardar configuración @@ -610,6 +664,14 @@ Show files that will be copied to the left side Show files that will be copied to the right side +Show files that will be created on the left side + +Show files that will be created on the right side + +Show files that will be deleted on the left side + +Show files that will be deleted on the right side + Show files that won't be copied Show popup @@ -660,12 +722,14 @@ Synchronizing... Sincronizando... System out of memory! Sistema sin memoria! +Target directory already existing! + Target file already existing! ¡El fichero objetivo existe ya! The file does not contain a valid configuration: El fichero no contiene una configuración válida: -This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file. -Esta lÃnea de comandos será ejecutada cada vez que haga doble click sobre un nombre de fichero. %name es el espacio reservado del fichero seleccionado. +This commandline will be executed on each doubleclick. The following macros are available: + This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Esta variante evalúa dos ficheros con el mismo nombre como iguales cuando tienen el mismo tamaño Y la misma fecha de modificación. Time @@ -696,10 +760,12 @@ Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchro Update -> Actualizar -> +Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed. + Use Recycle Bin Utilizar la Papelera -Use Recycle Bin when deleting or overwriting files during synchronization -Utilizar la papelera en el borrado o sustitución de ficheros durante la sincronización. +Use Recycle Bin when deleting or overwriting files. + Variant Volume name %x not part of filename %y! @@ -712,15 +778,13 @@ Warnings: Avisos: When the comparison is started with this option set the following decision tree is processed: Cuando la comparación se inicia con este conjunto de opciones, se procesa el siguiente árbol de decisiones: +You can ignore the error to consider not existing directories as empty. + You may try to synchronize remaining items again (WITHOUT having to re-compare)! Puede intentar sincronizar los elementos restantes otra vez (SIN tener que volver a comparar) different ficheros diferentes file exists on both sides el fichero existe en ambos lados -flash conflict\n - on one side only fichero sólo en un lado -|> file on right side only\n -|> fichero en lado derecho sólo\n diff --git a/BUILD/Readme.txt b/BUILD/Readme.txt index 4bdd29f7..0e359fc5 100644 --- a/BUILD/Readme.txt +++ b/BUILD/Readme.txt @@ -1,14 +1,18 @@ -FreeFileSync v2.1 ------------------- +FreeFileSync v2.2 +----------------- + +--------- +| Usage | +--------- -Usage ------ 1. Choose left and right directories and "Compare" them. -2. Select "Synchronize..." to specify settings and begin synchronization. +2. Select synchronization settings and press "Synchronize..." to begin synchronization. -Key Features ------------- +---------------- +| Key Features | +---------------- + 1. Compare files (bytewise or by date) and synchronize them. 2. No limitations: An arbitrary number of files can be synchronized. 3. Unicode support. @@ -50,8 +54,10 @@ Key Features 28. Load file icons asynchronously for maximum display performance. -Advanced topics ---------------- +------------------- +| Advanced topics | +------------------- + 1.) Synchronize in Batch Mode and send error notification via email: - Create a FreeFileSync batch file using "silent mode". @@ -85,9 +91,9 @@ You can: - drag & drop any directory onto the main window to set the directory f - drag & drop *.ffs_batch files onto the batch dialog to display and edit the batch configuration -4.) Synchronize two folders but exclude all subfolders from synchronization +4.) Exclude all subfolders from synchronization -Assuming you plan to synchronize two folders "C:\Source" and "D:\Target", you'll want to setup a filter like this: +Assuming you plan to synchronize two folders "C:\Source" and "D:\Target", simply set up a filter like this: Include: * Exclude: *\* @@ -104,15 +110,38 @@ Example: Use the free utility NetDrive (http://www.netdrive.net/) - Use the newly created drive as if it were a regular hard disk. -Links ------- -FreeFileSync on SourceForge: +6.) Start associated program on double-click + +FreeFileSync's default is to show files in the operating system's standard file browser on double-click e.g. by invoking "explorer /select, %name" on Windows. +If the file shall be started with its associated application instead, all you have to do is the following: +On main dialog navigate to: Menu -> Advanced -> Global settings: File Manager integration. Then replace the command string by + + cmd /c start "" "%name" + + +7. Synchronize USB sticks with variable drive letter + +USB sticks often have different volume names assigned to them when plugged into two distinct computers. In order to handle this flexibility FreeFileSync is able to process directory names relative to the current working directory. Thus the following workflow is possible: + + - Replace the absolute USB directory name (variable) in your configuration by a relative one: E.g. "E:\SyncDir" -> "\SyncDir" + - Save and copy synchronization settings to the USB stick: "E:\settings.ffs_gui" + - Start FreeFileSync by double-clicking on "E:\settings.ffs_gui" + +=> Working directory automatically is set to "E:\" by the operating system so that "\SyncDir" is interpreted as "E:\SyncDir". Now start synchronization as usual. + +--------- +| Links | +--------- + +FreeFileSync on SourceForge: http://sourceforge.net/projects/freefilesync/ -Contact -------- +------------ +| Contact | +------------ + For feedback, suggestions or bug-reports you can write an email to: zhnmju123 [at] gmx [dot] de diff --git a/BUILD/Resources.dat b/BUILD/Resources.dat Binary files differindex 48d36964..b3d3376a 100644 --- a/BUILD/Resources.dat +++ b/BUILD/Resources.dat diff --git a/BUILD/styles.rc b/BUILD/styles.rc new file mode 100644 index 00000000..0b7f0b20 --- /dev/null +++ b/BUILD/styles.rc @@ -0,0 +1,6 @@ +style "no-inner-border" +{ + GtkButton::inner-border = {0, 0, 0, 0} +} + +class "GtkButton" style "no-inner-border" diff --git a/Cleanup.cmd b/Cleanup.cmd index 6104d1b7..857e3e2d 100644 --- a/Cleanup.cmd +++ b/Cleanup.cmd @@ -5,15 +5,23 @@ ::clean codeblocks garbage del FreeFileSync.layout del FreeFileSync.depend +del RealtimeSync\RealtimeSync.layout +del RealtimeSync\RealtimeSync.depend ::clean Visual C++ garbage del FreeFileSync.ncb +del RealtimeSync\RealtimeSync.ncb attrib FreeFileSync.suo -h del FreeFileSync.suo +attrib RealtimeSync\RealtimeSync.suo -h +del RealtimeSync\RealtimeSync.suo del FreeFileSync.vcproj.*.user -del FreeFileSync.sln +del RealtimeSync\RealtimeSync.vcproj.*.user + del BUILD\FreeFileSync.pdb del BUILD\FreeFileSync.ilk +del BUILD\RealtimeSync.pdb +del BUILD\RealtimeSync.ilk del library\ShadowCopy\ShadowCopy.ncb attrib library\ShadowCopy\ShadowCopy.suo -h @@ -27,3 +35,6 @@ del library\ShadowCopy\Shadow.lib del library\ShadowCopy\ShadowTest.ilk del library\ShadowCopy\ShadowTest.pdb +::remove precompiled headers +del library\pch.h.gch +del RealtimeSync\pch.h.gch
\ No newline at end of file diff --git a/FreeFileSync.cbp b/FreeFileSync.cbp index 6cb09052..aedebc95 100644 --- a/FreeFileSync.cbp +++ b/FreeFileSync.cbp @@ -3,13 +3,14 @@ <FileVersion major="1" minor="6" /> <Project> <Option title="FreeFileSync" /> + <Option makefile="makefile" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output="BUILD\FreeFileSync" prefix_auto="1" extension_auto="1" /> <Option working_dir="BUILD\" /> - <Option object_output="OBJ\Debug\" /> + <Option object_output="OBJ\Debug_FFS_GCC\" /> <Option type="0" /> <Option compiler="gcc" /> <Option projectLinkerOptionsRelation="2" /> @@ -35,7 +36,7 @@ <Target title="Release"> <Option output="BUILD\FreeFileSync" prefix_auto="1" extension_auto="1" /> <Option working_dir="BUILD\" /> - <Option object_output="OBJ\Release\" /> + <Option object_output="OBJ\Release_FFS_GCC\" /> <Option type="0" /> <Option compiler="gcc" /> <Option projectLinkerOptionsRelation="2" /> @@ -83,7 +84,10 @@ </Target> </Build> <Compiler> + <Add option="-Wshadow" /> <Add option="-Wredundant-decls" /> + <Add option="-Wcast-align" /> + <Add option="-Wswitch-enum" /> <Add option="-Wall" /> <Add option="-pipe" /> <Add option="-mthreads" /> @@ -131,13 +135,6 @@ <Unit filename="comparison.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="library\customButton.cpp"> - <Option target="Debug" /> - <Option target="Release" /> - </Unit> - <Unit filename="library\customButton.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="library\customGrid.cpp"> <Option target="Debug" /> <Option target="Release" /> @@ -145,21 +142,18 @@ <Unit filename="library\customGrid.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="library\fileError.h"> - <Option target="<{~None~}>" /> + <Unit filename="library\errorLogging.cpp"> + <Option target="Debug" /> + <Option target="Release" /> </Unit> - <Unit filename="library\fileHandling.cpp" /> - <Unit filename="library\fileHandling.h"> - <Option target="<{~None~}>" /> + <Unit filename="library\errorLogging.h"> + <Option target="Debug" /> + <Option target="Release" /> </Unit> <Unit filename="library\filter.cpp" /> <Unit filename="library\filter.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="library\globalFunctions.cpp" /> - <Unit filename="library\globalFunctions.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="library\gtest\main.cpp"> <Option target="Unit Test" /> </Unit> @@ -198,10 +192,6 @@ <Option target="Debug" /> <Option target="Release" /> </Unit> - <Unit filename="library\localization.cpp" /> - <Unit filename="library\localization.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="library\multithreading.cpp"> <Option target="Unit Test" /> </Unit> @@ -219,10 +209,6 @@ <Unit filename="library\resources.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="library\shadow.cpp" /> - <Unit filename="library\shadow.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="library\statistics.cpp"> <Option target="Debug" /> <Option target="Release" /> @@ -234,19 +220,60 @@ <Unit filename="library\statusHandler.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="library\tinyxml\tinystr.cpp" /> - <Unit filename="library\tinyxml\tinyxml.cpp" /> - <Unit filename="library\tinyxml\tinyxmlerror.cpp" /> - <Unit filename="library\tinyxml\tinyxmlparser.cpp" /> - <Unit filename="library\zstring.cpp" /> - <Unit filename="library\zstring.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="resource.rc"> <Option compilerVar="WINDRES" /> <Option target="Debug" /> <Option target="Release" /> </Unit> + <Unit filename="shared\customButton.cpp"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\customButton.h"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\customTooltip.cpp"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\customTooltip.h"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\dragAndDrop.cpp"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\dragAndDrop.h"> + <Option target="Debug" /> + <Option target="Release" /> + </Unit> + <Unit filename="shared\fileError.h" /> + <Unit filename="shared\fileHandling.cpp" /> + <Unit filename="shared\fileHandling.h" /> + <Unit filename="shared\fileTraverser.cpp" /> + <Unit filename="shared\fileTraverser.h" /> + <Unit filename="shared\globalFunctions.cpp" /> + <Unit filename="shared\globalFunctions.h" /> + <Unit filename="shared\localization.cpp" /> + <Unit filename="shared\localization.h" /> + <Unit filename="shared\shadow.cpp" /> + <Unit filename="shared\shadow.h" /> + <Unit filename="shared\shared_ptr.h" /> + <Unit filename="shared\standardPaths.cpp" /> + <Unit filename="shared\standardPaths.h" /> + <Unit filename="shared\staticAssert.h" /> + <Unit filename="shared\systemFunctions.cpp" /> + <Unit filename="shared\systemFunctions.h" /> + <Unit filename="shared\tinyxml\tinystr.cpp" /> + <Unit filename="shared\tinyxml\tinyxml.cpp" /> + <Unit filename="shared\tinyxml\tinyxmlerror.cpp" /> + <Unit filename="shared\tinyxml\tinyxmlparser.cpp" /> + <Unit filename="shared\xmlBase.cpp" /> + <Unit filename="shared\xmlBase.h" /> + <Unit filename="shared\zstring.cpp" /> + <Unit filename="shared\zstring.h" /> <Unit filename="structures.cpp" /> <Unit filename="structures.h"> <Option target="<{~None~}>" /> @@ -269,13 +296,10 @@ <Unit filename="ui\checkVersion.h"> <Option target="<{~None~}>" /> </Unit> - <Unit filename="ui\dragAndDrop.cpp"> + <Unit filename="ui\dummyPanel.h"> <Option target="Debug" /> <Option target="Release" /> </Unit> - <Unit filename="ui\dragAndDrop.h"> - <Option target="<{~None~}>" /> - </Unit> <Unit filename="ui\gridView.cpp"> <Option target="Debug" /> <Option target="Release" /> diff --git a/FreeFileSync.vcproj b/FreeFileSync.vcproj index 81692ad0..92118549 100644 --- a/FreeFileSync.vcproj +++ b/FreeFileSync.vcproj @@ -18,8 +18,8 @@ <Configurations> <Configuration Name="Debug|Win32" - OutputDirectory="OBJ\$(ConfigurationName)" - IntermediateDirectory="OBJ\$(ConfigurationName)" + OutputDirectory="OBJ\$(ConfigurationName)_FFS_VCPP" + IntermediateDirectory="OBJ\$(ConfigurationName)_FFS_VCPP" ConfigurationType="1" CharacterSet="1" > @@ -46,11 +46,10 @@ PreprocessorDefinitions="wxUSE_UNICODE;__WXMSW__;FFS_WIN;__WXDEBUG__;TIXML_USE_STL;ZSTRING_WIDE_CHAR" MinimalRebuild="true" BasicRuntimeChecks="3" - RuntimeLibrary="3" + RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" - DisableSpecificWarnings="4290" /> <Tool Name="VCManagedResourceCompilerTool" @@ -101,8 +100,8 @@ </Configuration> <Configuration Name="Release|Win32" - OutputDirectory="OBJ\$(ConfigurationName)" - IntermediateDirectory="OBJ\$(ConfigurationName)" + OutputDirectory="OBJ\$(ConfigurationName)_FFS_VCPP" + IntermediateDirectory="OBJ\$(ConfigurationName)_FFS_VCPP" ConfigurationType="1" CharacterSet="1" WholeProgramOptimization="1" @@ -129,12 +128,11 @@ FavorSizeOrSpeed="1" AdditionalIncludeDirectories=""C:\Programme\C++\wxWidgets\include";"C:\Programme\C++\wxWidgets\lib\vc_lib\mswu"" PreprocessorDefinitions="wxUSE_UNICODE;__WXMSW__;FFS_WIN;NDEBUG;TIXML_USE_STL;ZSTRING_WIDE_CHAR" - RuntimeLibrary="2" + RuntimeLibrary="0" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" - DisableSpecificWarnings="4290" /> <Tool Name="VCManagedResourceCompilerTool" @@ -212,7 +210,7 @@ > </File> <File - RelativePath=".\library\customButton.cpp" + RelativePath=".\shared\customButton.cpp" > </File> <File @@ -220,11 +218,23 @@ > </File> <File - RelativePath=".\ui\dragAndDrop.cpp" + RelativePath=".\shared\customTooltip.cpp" > </File> <File - RelativePath=".\library\fileHandling.cpp" + RelativePath=".\shared\dragAndDrop.cpp" + > + </File> + <File + RelativePath=".\library\errorLogging.cpp" + > + </File> + <File + RelativePath=".\shared\fileHandling.cpp" + > + </File> + <File + RelativePath=".\shared\fileTraverser.cpp" > </File> <File @@ -232,7 +242,7 @@ > </File> <File - RelativePath=".\library\globalFunctions.cpp" + RelativePath=".\shared\globalFunctions.cpp" > </File> <File @@ -252,7 +262,7 @@ > </File> <File - RelativePath=".\library\localization.cpp" + RelativePath=".\shared\localization.cpp" > </File> <File @@ -268,7 +278,7 @@ > </File> <File - RelativePath=".\library\shadow.cpp" + RelativePath=".\shared\shadow.cpp" > </File> <File @@ -276,6 +286,10 @@ > </File> <File + RelativePath=".\shared\standardPaths.cpp" + > + </File> + <File RelativePath=".\library\statistics.cpp" > </File> @@ -296,157 +310,31 @@ > </File> <File - RelativePath=".\library\tinyxml\tinystr.cpp" - > - </File> - <File - RelativePath=".\library\tinyxml\tinyxml.cpp" - > - </File> - <File - RelativePath=".\library\tinyxml\tinyxmlerror.cpp" - > - </File> - <File - RelativePath=".\library\tinyxml\tinyxmlparser.cpp" - > - </File> - <File - RelativePath=".\library\zstring.cpp" - > - </File> - </Filter> - <Filter - Name="Headerdateien" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\algorithm.h" - > - </File> - <File - RelativePath=".\application.h" - > - </File> - <File - RelativePath=".\ui\batchStatusHandler.h" - > - </File> - <File - RelativePath=".\ui\checkVersion.h" - > - </File> - <File - RelativePath=".\comparison.h" - > - </File> - <File - RelativePath=".\library\customButton.h" - > - </File> - <File - RelativePath=".\library\customGrid.h" - > - </File> - <File - RelativePath=".\ui\dragAndDrop.h" - > - </File> - <File - RelativePath=".\library\fileError.h" - > - </File> - <File - RelativePath=".\library\fileHandling.h" - > - </File> - <File - RelativePath=".\library\filter.h" - > - </File> - <File - RelativePath=".\library\globalFunctions.h" - > - </File> - <File - RelativePath=".\ui\gridView.h" - > - </File> - <File - RelativePath=".\ui\guiGenerated.h" - > - </File> - <File - RelativePath=".\ui\guiStatusHandler.h" - > - </File> - <File - RelativePath=".\library\iconBuffer.h" - > - </File> - <File - RelativePath=".\library\localization.h" - > - </File> - <File - RelativePath=".\ui\mainDialog.h" - > - </File> - <File - RelativePath=".\library\pch.h" - > - </File> - <File - RelativePath=".\library\processXml.h" - > - </File> - <File - RelativePath=".\library\resources.h" - > - </File> - <File - RelativePath=".\library\shadow.h" - > - </File> - <File - RelativePath=".\ui\smallDialogs.h" - > - </File> - <File - RelativePath=".\ui\sorting.h" - > - </File> - <File - RelativePath=".\library\statistics.h" - > - </File> - <File - RelativePath=".\library\statusHandler.h" + RelativePath=".\shared\systemFunctions.cpp" > </File> <File - RelativePath=".\structures.h" + RelativePath=".\shared\tinyxml\tinystr.cpp" > </File> <File - RelativePath=".\ui\syncDialog.h" + RelativePath=".\shared\tinyxml\tinyxml.cpp" > </File> <File - RelativePath=".\synchronization.h" + RelativePath=".\shared\tinyxml\tinyxmlerror.cpp" > </File> <File - RelativePath=".\library\tinyxml\tinystr.h" + RelativePath=".\shared\tinyxml\tinyxmlparser.cpp" > </File> <File - RelativePath=".\library\tinyxml\tinyxml.h" + RelativePath=".\shared\xmlBase.cpp" > </File> <File - RelativePath=".\library\zstring.h" + RelativePath=".\shared\zstring.cpp" > </File> </Filter> @@ -465,6 +353,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="_UNICODE;UNICODE;wxUSE_NO_MANIFEST" Culture="1033" + ResourceOutputFileName="$(IntDir)/Resource.res" /> </FileConfiguration> <FileConfiguration @@ -473,6 +362,7 @@ <Tool Name="VCResourceCompilerTool" PreprocessorDefinitions="_UNICODE;UNICODE;wxUSE_NO_MANIFEST" + ResourceOutputFileName="$(IntDir)/Resource.res" /> </FileConfiguration> </File> @@ -1,104 +1,66 @@ CPPFLAGS=-Wall -pipe -DNDEBUG `wx-config --cppflags` `pkg-config --cflags gtk+-2.0` -DFFS_LINUX -DTIXML_USE_STL -DZSTRING_CHAR -O3 -pthread -c -ENDFLAGS=`wx-config --libs` -O3 -pthread +LINKFLAGS=`wx-config --libs` -O3 -pthread + +FILE_LIST= #internal list of all *.cpp files needed for compilation +FILE_LIST+=structures.cpp +FILE_LIST+=algorithm.cpp +FILE_LIST+=comparison.cpp +FILE_LIST+=synchronization.cpp +FILE_LIST+=application.cpp +FILE_LIST+=ui/guiGenerated.cpp +FILE_LIST+=ui/gridView.cpp +FILE_LIST+=ui/mainDialog.cpp +FILE_LIST+=ui/syncDialog.cpp +FILE_LIST+=ui/checkVersion.cpp +FILE_LIST+=ui/batchStatusHandler.cpp +FILE_LIST+=ui/guiStatusHandler.cpp +FILE_LIST+=library/customGrid.cpp +FILE_LIST+=library/errorLogging.cpp +FILE_LIST+=library/statusHandler.cpp +FILE_LIST+=library/resources.cpp +FILE_LIST+=ui/smallDialogs.cpp +FILE_LIST+=library/processXml.cpp +FILE_LIST+=library/statistics.cpp +FILE_LIST+=library/filter.cpp +FILE_LIST+=shared/dragAndDrop.cpp +FILE_LIST+=shared/localization.cpp +FILE_LIST+=shared/tinyxml/tinyxml.cpp +FILE_LIST+=shared/tinyxml/tinystr.cpp +FILE_LIST+=shared/tinyxml/tinyxmlerror.cpp +FILE_LIST+=shared/tinyxml/tinyxmlparser.cpp +FILE_LIST+=shared/globalFunctions.cpp +FILE_LIST+=shared/systemFunctions.cpp +FILE_LIST+=shared/customTooltip.cpp +FILE_LIST+=shared/fileHandling.cpp +FILE_LIST+=shared/fileTraverser.cpp +FILE_LIST+=shared/standardPaths.cpp +FILE_LIST+=shared/zstring.cpp +FILE_LIST+=shared/xmlBase.cpp +FILE_LIST+=shared/customButton.cpp + +#list of all *.o files +OBJECT_LIST=$(foreach file, $(FILE_LIST), OBJ/$(subst .cpp,.o,$(notdir $(file)))) + +#build list of all dependencies +DEP_LIST=$(foreach file, $(FILE_LIST), $(subst .cpp,.dep,$(file))) + all: FreeFileSync -init: +init: if [ ! -d OBJ ]; then mkdir OBJ; fi -structures.o: structures.cpp - g++ $(CPPFLAGS) structures.cpp -o OBJ/structures.o - -algorithm.o: algorithm.cpp - g++ $(CPPFLAGS) algorithm.cpp -o OBJ/algorithm.o - -comparison.o: comparison.cpp - g++ $(CPPFLAGS) comparison.cpp -o OBJ/comparison.o - -synchronization.o: synchronization.cpp - g++ $(CPPFLAGS) synchronization.cpp -o OBJ/synchronization.o - -application.o: application.cpp - g++ $(CPPFLAGS) application.cpp -o OBJ/application.o - -globalFunctions.o: library/globalFunctions.cpp - g++ $(CPPFLAGS) library/globalFunctions.cpp -o OBJ/globalFunctions.o - -guiGenerated.o: ui/guiGenerated.cpp - g++ $(CPPFLAGS) ui/guiGenerated.cpp -o OBJ/guiGenerated.o - -gridView.o: ui/gridView.cpp - g++ $(CPPFLAGS) ui/gridView.cpp -o OBJ/gridView.o - -mainDialog.o: ui/mainDialog.cpp - g++ $(CPPFLAGS) ui/mainDialog.cpp -o OBJ/mainDialog.o - -syncDialog.o: ui/syncDialog.cpp - g++ $(CPPFLAGS) ui/syncDialog.cpp -o OBJ/syncDialog.o - -checkVersion.o: ui/checkVersion.cpp - g++ $(CPPFLAGS) ui/checkVersion.cpp -o OBJ/checkVersion.o - -batchStatusHandler.o: ui/batchStatusHandler.cpp - g++ $(CPPFLAGS) ui/batchStatusHandler.cpp -o OBJ/batchStatusHandler.o - -guiStatusHandler.o: ui/guiStatusHandler.cpp - g++ $(CPPFLAGS) ui/guiStatusHandler.cpp -o OBJ/guiStatusHandler.o - -customGrid.o: library/customGrid.cpp - g++ $(CPPFLAGS) library/customGrid.cpp -o OBJ/customGrid.o - -fileHandling.o: library/fileHandling.cpp - g++ $(CPPFLAGS) library/fileHandling.cpp -o OBJ/fileHandling.o - -statusHandler.o: library/statusHandler.cpp - g++ $(CPPFLAGS) library/statusHandler.cpp -o OBJ/statusHandler.o - -resources.o: library/resources.cpp - g++ $(CPPFLAGS) library/resources.cpp -o OBJ/resources.o - -smallDialogs.o: ui/smallDialogs.cpp - g++ $(CPPFLAGS) ui/smallDialogs.cpp -o OBJ/smallDialogs.o - -dragAndDrop.o: ui/dragAndDrop.cpp - g++ $(CPPFLAGS) ui/dragAndDrop.cpp -o OBJ/dragAndDrop.o - +#remove byte ordering mark: needed by Visual C++ but an error with GCC removeBOM: tools/removeBOM.cpp - g++ -o removeBOM tools/removeBOM.cpp - -localization.o: library/localization.cpp removeBOM - ./removeBOM library/localization.cpp - g++ $(CPPFLAGS) library/localization.cpp -o OBJ/localization.o - -tinyxml.o: library/tinyxml/tinyxml.cpp - g++ $(CPPFLAGS) library/tinyxml/tinyxml.cpp -o OBJ/tinyxml.o - -tinystr.o: library/tinyxml/tinystr.cpp - g++ $(CPPFLAGS) library/tinyxml/tinystr.cpp -o OBJ/tinystr.o - -tinyxmlerror.o: library/tinyxml/tinyxmlerror.cpp - g++ $(CPPFLAGS) library/tinyxml/tinyxmlerror.cpp -o OBJ/tinyxmlerror.o - -tinyxmlparser.o: library/tinyxml/tinyxmlparser.cpp - g++ $(CPPFLAGS) library/tinyxml/tinyxmlparser.cpp -o OBJ/tinyxmlparser.o - -processXml.o: library/processXml.cpp - g++ $(CPPFLAGS) library/processXml.cpp -o OBJ/processXml.o - -statistics.o: library/statistics.cpp - g++ $(CPPFLAGS) library/statistics.cpp -o OBJ/statistics.o - -zstring.o: library/zstring.cpp - g++ $(CPPFLAGS) library/zstring.cpp -o OBJ/zstring.o - -customButton.o: library/customButton.cpp - g++ $(CPPFLAGS) library/customButton.cpp -o OBJ/customButton.o + g++ -o removeBOM tools/removeBOM.cpp + ./removeBOM shared/localization.cpp -filter.o: library/filter.cpp - g++ $(CPPFLAGS) library/filter.cpp -o OBJ/filter.o +%.dep : %.cpp + #strip path information + g++ $(CPPFLAGS) $< -o OBJ/$(subst .cpp,.o,$(notdir $<)) -FreeFileSync: init application.o structures.o algorithm.o comparison.o customButton.o filter.o checkVersion.o batchStatusHandler.o guiStatusHandler.o synchronization.o globalFunctions.o guiGenerated.o gridView.o mainDialog.o syncDialog.o customGrid.o fileHandling.o resources.o smallDialogs.o dragAndDrop.o statusHandler.o localization.o tinyxml.o tinystr.o tinyxmlerror.o tinyxmlparser.o processXml.o statistics.o zstring.o - g++ $(ENDFLAGS) -o BUILD/FreeFileSync OBJ/application.o OBJ/structures.o OBJ/algorithm.o OBJ/comparison.o OBJ/customButton.o OBJ/filter.o OBJ/batchStatusHandler.o OBJ/guiStatusHandler.o OBJ/checkVersion.o OBJ/synchronization.o OBJ/globalFunctions.o OBJ/guiGenerated.o OBJ/gridView.o OBJ/mainDialog.o OBJ/syncDialog.o OBJ/customGrid.o OBJ/fileHandling.o OBJ/resources.o OBJ/smallDialogs.o OBJ/dragAndDrop.o OBJ/statusHandler.o OBJ/localization.o OBJ/tinyxml.o OBJ/tinystr.o OBJ/tinyxmlerror.o OBJ/tinyxmlparser.o OBJ/processXml.o OBJ/statistics.o OBJ/zstring.o +FreeFileSync: init removeBOM $(DEP_LIST) + g++ $(LINKFLAGS) -o BUILD/FreeFileSync $(OBJECT_LIST) clean: - find obj -type f -exec rm {} \; + find OBJ -type f -exec rm {} \; diff --git a/RealtimeSync/RealtimeSync.cbp b/RealtimeSync/RealtimeSync.cbp new file mode 100644 index 00000000..75c1d189 --- /dev/null +++ b/RealtimeSync/RealtimeSync.cbp @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> +<CodeBlocks_project_file> + <FileVersion major="1" minor="6" /> + <Project> + <Option title="RealtimeSync" /> + <Option makefile="makefile" /> + <Option pch_mode="2" /> + <Option compiler="gcc" /> + <Build> + <Target title="Debug"> + <Option output="..\BUILD\RealtimeSync" prefix_auto="1" extension_auto="1" /> + <Option working_dir="..\BUILD" /> + <Option object_output="..\OBJ\Debug_RTS_GCC" /> + <Option type="0" /> + <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> + <Compiler> + <Add option="-g" /> + <Add option="-Winvalid-pch" /> + <Add option='-include "pch.h"' /> + <Add option="-D__WXDEBUG__" /> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib\mswud" /> + </Compiler> + <ResourceCompiler> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib\mswud" /> + </ResourceCompiler> + <Linker> + <Add library="libwxmsw28ud_core.a" /> + <Add library="libwxmsw28ud_adv.a" /> + <Add library="libwxbase28ud.a" /> + <Add library="libwxpngd.a" /> + <Add library="libwxzlibd.a" /> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib" /> + </Linker> + </Target> + <Target title="Release"> + <Option output="..\BUILD\RealtimeSync" prefix_auto="1" extension_auto="1" /> + <Option working_dir="..\BUILD" /> + <Option object_output="..\OBJ\Release_RTS_GCC" /> + <Option type="0" /> + <Option compiler="gcc" /> + <Option projectLinkerOptionsRelation="2" /> + <Compiler> + <Add option="-O3" /> + <Add option="-DNDEBUG" /> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib\mswu" /> + </Compiler> + <ResourceCompiler> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib\mswu" /> + </ResourceCompiler> + <Linker> + <Add option="-s" /> + <Add library="libwxmsw28u_core.a" /> + <Add library="libwxmsw28u_adv.a" /> + <Add library="libwxbase28u.a" /> + <Add library="libwxpng.a" /> + <Add library="libwxzlib.a" /> + <Add directory="C:\Programme\C++\wxWidgets\lib\gcc_lib" /> + </Linker> + </Target> + </Build> + <Compiler> + <Add option="-Wall" /> + <Add option="-pipe" /> + <Add option="-mthreads" /> + <Add option='[[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]' /> + <Add option="-D__GNUWIN32__" /> + <Add option="-D__WXMSW__" /> + <Add option="-DwxUSE_UNICODE" /> + <Add option="-DFFS_WIN" /> + <Add option="-DZSTRING_WIDE_CHAR" /> + <Add option="-DTIXML_USE_STL" /> + <Add directory="C:\Programme\C++\wxWidgets\include" /> + <Add directory="C:\Programme\C++\wxWidgets\contrib\include" /> + </Compiler> + <ResourceCompiler> + <Add directory="C:\Programme\C++\wxWidgets\include" /> + </ResourceCompiler> + <Linker> + <Add option="-mthreads" /> + <Add library="libkernel32.a" /> + <Add library="libuser32.a" /> + <Add library="libuuid.a" /> + <Add library="libcomctl32.a" /> + <Add library="libgdi32.a" /> + <Add library="libole32.a" /> + <Add library="liboleaut32.a" /> + <Add library="libcomdlg32.a" /> + <Add library="libws2_32.a" /> + </Linker> + <Unit filename="WxWizDialog.fbp" /> + <Unit filename="application.cpp" /> + <Unit filename="application.h" /> + <Unit filename="functions.cpp" /> + <Unit filename="functions.h" /> + <Unit filename="guiGenerated.cpp" /> + <Unit filename="guiGenerated.h" /> + <Unit filename="mainDialog.cpp" /> + <Unit filename="mainDialog.h" /> + <Unit filename="pch.h"> + <Option compile="1" /> + <Option weight="0" /> + <Option target="Debug" /> + </Unit> + <Unit filename="resource.rc"> + <Option compilerVar="WINDRES" /> + </Unit> + <Unit filename="resources.cpp" /> + <Unit filename="resources.h" /> + <Unit filename="trayMenu.cpp" /> + <Unit filename="trayMenu.h" /> + <Unit filename="watcher.cpp" /> + <Unit filename="watcher.h" /> + <Unit filename="xmlFreeFileSync.cpp" /> + <Unit filename="xmlFreeFileSync.h" /> + <Unit filename="xmlProcessing.cpp" /> + <Unit filename="xmlProcessing.h" /> + <Unit filename="..\Shared\customButton.cpp" /> + <Unit filename="..\Shared\customButton.h" /> + <Unit filename="..\Shared\dragAndDrop.cpp" /> + <Unit filename="..\Shared\dragAndDrop.h" /> + <Unit filename="..\Shared\zstring.cpp" /> + <Unit filename="..\Shared\zstring.h" /> + <Unit filename="..\library\processXml.cpp" /> + <Unit filename="..\shared\fileError.h" /> + <Unit filename="..\shared\fileHandling.cpp" /> + <Unit filename="..\shared\fileHandling.h" /> + <Unit filename="..\shared\fileTraverser.cpp" /> + <Unit filename="..\shared\globalFunctions.cpp" /> + <Unit filename="..\shared\globalFunctions.h" /> + <Unit filename="..\shared\localization.cpp" /> + <Unit filename="..\shared\localization.h" /> + <Unit filename="..\shared\shadow.cpp" /> + <Unit filename="..\shared\standardPaths.cpp" /> + <Unit filename="..\shared\standardPaths.h" /> + <Unit filename="..\shared\systemFunctions.cpp" /> + <Unit filename="..\shared\systemFunctions.h" /> + <Unit filename="..\shared\tinyxml\tinystr.cpp" /> + <Unit filename="..\shared\tinyxml\tinyxml.cpp" /> + <Unit filename="..\shared\tinyxml\tinyxmlerror.cpp" /> + <Unit filename="..\shared\tinyxml\tinyxmlparser.cpp" /> + <Unit filename="..\shared\xmlBase.cpp" /> + <Unit filename="..\shared\xmlBase.h" /> + <Unit filename="..\structures.cpp" /> + <Extensions> + <code_completion /> + <envvars /> + <debugger /> + </Extensions> + </Project> +</CodeBlocks_project_file> diff --git a/RealtimeSync/RealtimeSync.ico b/RealtimeSync/RealtimeSync.ico Binary files differnew file mode 100644 index 00000000..8e4e556e --- /dev/null +++ b/RealtimeSync/RealtimeSync.ico diff --git a/RealtimeSync/RealtimeSync.vcproj b/RealtimeSync/RealtimeSync.vcproj new file mode 100644 index 00000000..72bb7f61 --- /dev/null +++ b/RealtimeSync/RealtimeSync.vcproj @@ -0,0 +1,326 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="RealtimeSync" + ProjectGUID="{517129D6-622F-4432-95A2-C4571276CE18}" + RootNamespace="FreeFileSync" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="..\OBJ\$(ConfigurationName)_RTS_VCPP" + IntermediateDirectory="..\OBJ\$(ConfigurationName)_RTS_VCPP" + ConfigurationType="1" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + CommandLine="" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories=""C:\Programme\C++\wxWidgets\include";"C:\Programme\C++\wxWidgets\lib\vc_lib\mswud"" + PreprocessorDefinitions="wxUSE_UNICODE;__WXMSW__;FFS_WIN;__WXDEBUG__;TIXML_USE_STL;ZSTRING_WIDE_CHAR" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="0" + AdditionalIncludeDirectories="C:\Programme\C++\wxWidgets\include;C:\Programme\C++\wxWidgets\lib\vc_lib\mswud" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wxmsw28ud_adv.lib 
wxmsw28ud_core.lib 
wxbase28ud.lib 
wxpngd.lib
 wxzlibd.lib 
wxbase28ud_net.lib comctl32.lib ws2_32.lib Rpcrt4.lib" + OutputFile="..\BUILD\$(ProjectName).exe" + LinkIncremental="2" + AdditionalLibraryDirectories="C:\Programme\C++\wxWidgets\lib\vc_lib" + GenerateManifest="true" + GenerateDebugInformation="true" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + EmbedManifest="true" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + Description="clean up" + CommandLine="" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="..\OBJ\$(ConfigurationName)_RTS_VCPP" + IntermediateDirectory="..\OBJ\$(ConfigurationName)_RTS_VCPP" + ConfigurationType="1" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + FavorSizeOrSpeed="1" + AdditionalIncludeDirectories=""C:\Programme\C++\wxWidgets\include";"C:\Programme\C++\wxWidgets\lib\vc_lib\mswu"" + PreprocessorDefinitions="wxUSE_UNICODE;__WXMSW__;FFS_WIN;NDEBUG;TIXML_USE_STL;ZSTRING_WIDE_CHAR" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + Culture="1033" + AdditionalIncludeDirectories=""C:\Programme\C++\wxWidgets\include";"C:\Programme\C++\wxWidgets\lib\vc_lib\mswu"" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="wxmsw28u_adv.lib 
wxmsw28u_core.lib 
wxbase28u.lib 
wxpng.lib 
wxzlib.lib 
wxbase28u_net.lib comctl32.lib ws2_32.lib" + OutputFile="..\BUILD\$(ProjectName).exe" + LinkIncremental="1" + AdditionalLibraryDirectories="C:\Programme\C++\wxWidgets\lib\vc_lib" + GenerateDebugInformation="false" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + CommandLine="" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Quelldateien" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\application.cpp" + > + </File> + <File + RelativePath="..\shared\customButton.cpp" + > + </File> + <File + RelativePath="..\shared\dragAndDrop.cpp" + > + </File> + <File + RelativePath="..\shared\fileHandling.cpp" + > + </File> + <File + RelativePath="..\shared\fileTraverser.cpp" + > + </File> + <File + RelativePath=".\functions.cpp" + > + </File> + <File + RelativePath="..\shared\globalFunctions.cpp" + > + </File> + <File + RelativePath=".\guiGenerated.cpp" + > + </File> + <File + RelativePath="..\shared\localization.cpp" + > + </File> + <File + RelativePath=".\mainDialog.cpp" + > + </File> + <File + RelativePath="..\library\processXml.cpp" + > + </File> + <File + RelativePath=".\resources.cpp" + > + </File> + <File + RelativePath="..\shared\shadow.cpp" + > + </File> + <File + RelativePath="..\shared\standardPaths.cpp" + > + </File> + <File + RelativePath="..\structures.cpp" + > + </File> + <File + RelativePath="..\shared\systemFunctions.cpp" + > + </File> + <File + RelativePath="..\shared\tinyxml\tinystr.cpp" + > + </File> + <File + RelativePath="..\shared\tinyxml\tinyxml.cpp" + > + </File> + <File + RelativePath="..\shared\tinyxml\tinyxmlerror.cpp" + > + </File> + <File + RelativePath="..\shared\tinyxml\tinyxmlparser.cpp" + > + </File> + <File + RelativePath=".\trayMenu.cpp" + > + </File> + <File + RelativePath=".\watcher.cpp" + > + </File> + <File + RelativePath="..\shared\xmlBase.cpp" + > + </File> + <File + RelativePath=".\xmlFreeFileSync.cpp" + > + </File> + <File + RelativePath=".\xmlProcessing.cpp" + > + </File> + <File + RelativePath="..\shared\zstring.cpp" + > + </File> + </Filter> + <Filter + Name="Ressourcendateien" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + <File + RelativePath=".\resource.rc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_UNICODE;UNICODE;wxUSE_NO_MANIFEST" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_UNICODE;UNICODE;wxUSE_NO_MANIFEST" + /> + </FileConfiguration> + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/RealtimeSync/RealtimeSync.xpm b/RealtimeSync/RealtimeSync.xpm new file mode 100644 index 00000000..557ef973 --- /dev/null +++ b/RealtimeSync/RealtimeSync.xpm @@ -0,0 +1,312 @@ +/* XPM */ +static const char* RealtimeSync_xpm[] = { +"32 32 277 2", +" c None", +"! c black", +"# c #2A0404", +"$ c #330505", +"% c #3D0707", +"& c #360606", +"' c #340606", +"( c #500909", +") c #630B0B", +"* c #890F0F", +"+ c #AC1414", +", c #AB1414", +"- c #9F1212", +". c #820F0F", +"0 c #510909", +"1 c #2F0505", +"2 c #530A0A", +"3 c #8B1010", +"4 c #E83E3E", +"5 c #F39494", +"6 c #F6ADAD", +"7 c #F49B9B", +"8 c #F07E7E", +"9 c #EC5C5C", +": c #E73636", +"; c #D71818", +"< c #AD1414", +"= c #7C0E0E", +"> c #410707", +"? c #E73232", +"@ c #FACECE", +"A c #FCDFDF", +"B c #F7B8B8", +"C c #F39090", +"D c #EF6E6E", +"E c #EA4D4D", +"F c #E72D2D", +"G c #E41E1E", +"H c #E31F1F", +"I c #E52121", +"J c #E31C1C", +"K c #670C0C", +"L c #380606", +"M c #420808", +"N c #6D0C0C", +"O c #F07777", +"P c #FEEEEE", +"Q c #F9C6C6", +"R c #F49D9D", +"S c #EC5D5D", +"T c #E83C3C", +"U c #E62121", +"V c #E41A1A", +"W c #E41D1D", +"X c #E21E1E", +"Y c #E41C1C", +"Z c #E51C1C", +"[ c #C71717", +"] c #720C0C", +"^ c #330606", +"_ c #640C0C", +"` c #EF7171", +"a c #FCE3E3", +"b c #F6AFAF", +"c c #F28D8D", +"d c #E72E2E", +"e c #E62020", +"f c #E51A1A", +"g c #E51F1F", +"h c #CA1818", +"i c #680C0C", +"j c #260404", +"k c #4F0909", +"l c #540A0A", +"m c #520909", +"n c #E72F2F", +"o c #FAD3D3", +"p c #F4A0A0", +"q c #F17E7E", +"r c #ED5E5E", +"s c #E93E3E", +"t c #E62525", +"u c #E51B1B", +"v c #BD1616", +"w c #941111", +"x c #810E0E", +"y c #830F0F", +"z c #991111", +"{ c #E21A1A", +"| c #B41515", +"} c #420707", +"~ c #8C1010", +" ! c #E62323", +"!! c #C91717", +"#! c #B21515", +"$! c #EB5050", +"%! c #E73030", +"&! c #DC1919", +"'! c #250404", +"(! c #550A0A", +")! c #7B0E0E", +"*! c #BC1616", +"+! c #860F0F", +",! c #310505", +"-! c #3F0707", +".! c #F07676", +"0! c #EB5656", +"1! c #E62727", +"2! c #E62424", +"3! c #E21D1D", +"4! c #DE1919", +"5! c #7A0E0E", +"6! c #470808", +"7! c #350606", +"8! c #5B0A0A", +"9! c #971111", +":! c #DF1919", +";! c #BF1616", +"<! c #951111", +"=! c #EA4E4E", +">! c #E61F1F", +"?! c #E41B1B", +"@! c #E31A1A", +"A! c #D41919", +"B! c #8D1010", +"C! c #5D0B0B", +"D! c #390606", +"E! c #1F0303", +"F! c #4E0909", +"G! c #D61818", +"H! c #750D0D", +"I! c #270404", +"J! c #6A0C0C", +"K! c #E62222", +"L! c #C81717", +"M! c #790D0D", +"N! c #290404", +"O! c #460808", +"P! c #770D0D", +"Q! c #D81818", +"R! c #A21212", +"S! c #E52020", +"T! c #931111", +"U! c #7D0E0E", +"V! c #A61313", +"W! c #450808", +"X! c #3A0606", +"Y! c #570A0A", +"Z! c #2E0505", +"[! c #440808", +"]! c #580A0A", +"^! c #630C0C", +"_! c #BA1616", +"`! c #D51818", +"a! c #180202", +"b! c #EC5959", +"c! c #F39292", +"d! c #3C0707", +"e! c #DF1A1A", +"f! c #6C0C0C", +"g! c #300505", +"h! c #D11818", +"i! c #FFFEFE", +"j! c white", +"k! c #FCDDDD", +"l! c #8A1010", +"m! c #D41818", +"n! c #A91313", +"o! c #730D0D", +"p! c #1D0303", +"q! c #4B0909", +"r! c #AF1414", +"s! c #F39797", +"t! c #FFFBFB", +"u! c #FFFAFA", +"v! c #FDEBEB", +"w! c #FCDEDE", +"x! c #FBD4D4", +"y! c #FBDADA", +"z! c #EB4E4E", +"{! c #880F0F", +"|! c #200303", +"}! c #600B0B", +"~! c #F9CBCB", +" # c #FBD7D7", +"!# c #F8BEBE", +"## c #F5A5A5", +"$# c #F49C9C", +"%# c #F39191", +"&# c #F28989", +"'# c #F07B7B", +"(# c #A71313", +")# c #700D0D", +"*# c #140202", +"+# c #E73333", +",# c #F5A8A8", +"-# c #F39393", +".# c #F18282", +"0# c #F07878", +"1# c #EE6C6C", +"2# c #ED6262", +"3# c #EC5757", +"4# c #E94242", +"5# c #E94141", +"6# c #DA1919", +"7# c #F38E8E", +"8# c #690C0C", +"9# c #760D0D", +":# c #EC5A5A", +";# c #EA4949", +"<# c #E93F3F", +"=# c #E62626", +"># c #DD1919", +"?# c #6F0C0C", +"@# c #2C0505", +"A# c #FEEBEB", +"B# c #F07D7D", +"C# c #6B0C0C", +"D# c #911010", +"E# c #D21818", +"F# c #E31B1B", +"G# c #E11D1D", +"H# c #400707", +"I# c #EE6666", +"J# c #7F0E0E", +"K# c #5C0B0B", +"L# c #E62828", +"M# c #B11414", +"N# c #F39A9A", +"O# c #ED6565", +"P# c #A31313", +"Q# c #370606", +"R# c #840F0F", +"S# c #E21B1B", +"T# c #E31D1D", +"U# c #B61515", +"V# c #ED6161", +"W# c #EB5555", +"X# c #490808", +"Y# c #3B0707", +"Z# c #650C0C", +"[# c #9E1212", +"]# c #E41F1F", +"^# c #E51D1D", +"_# c #800E0E", +"`# c #921111", +"a# c #4A0808", +"b# c #320505", +"c# c #E73535", +"d# c #E72A2A", +"e# c #E72B2B", +"f# c #E42020", +"g# c #B11515", +"h# c #E51E1E", +"i# c #E31E1E", +"j# c #530909", +"k# c #E42121", +"l# c #610B0B", +"m# c #4D0909", +"n# c #DB1A1A", +"o# c #AA1414", +"p# c #620B0B", +"q# c #720D0D", +"r# c #B31515", +"s# c #E11919", +"t# c #C61717", +"u# c #5A0A0A", +"v# c #BB1616", +"w# c #CC1818", +"x# c #C11717", +"y# c #850F0F", +"z# c #1E0303", +"{# c #2B0505", +"|# c #560A0A", +"}# c #5F0B0B", +"~# c #210303", +" $ c #170202", +" ", +" # $ % & # ", +" ' ( ) * + , - . ) 0 $ ", +" 1 2 3 4 5 6 7 8 9 : ; < = 2 # ", +" > ) ? @ A B C D E F G H I J < K L ", +" M N O P Q R 8 S T U V W X Y Z I [ ] & ", +" ^ _ ` a b c D E d e G f Y g e W Y f h i j ", +" k l l m 2 n o p q r s t u v w x y z v { f f f | 2 ", +"} ~ d !!!#!q C ` $!%!g &!~ 0 1 '!j L (!)!*!f f f +!,! ", +"-!*!.!0!4 1!Y 2!d 2!3!4!5!6! 7!8!9!:!f ;!2 ", +"% <!=!: >!?!V @!{ V W A!B!C!D! E!F!x G!f H!E! ", +"I!J!e K!?!f ?!u ?!J f f f L!M!N! O!P!Q!R!1 ", +" l < S!f ?!u ?!J f f f f f T!# } U!V!W! ", +" X!= V Z u ?!J f f f f f + Y! Z![!]!^!]! ", +" 8!_!I ?!J f f f f `!T!0 a! ,!Y!#!b!c!;!l ", +" d!P!e!Z f f f 4!+ f!X! g!]!h!R i!j!j!k!l!& ", +" 2 +!{ f m!n!o!W!p! q!r!s!t!u!v!w!x!y!z!Y! ", +" O!]!x {!_ > |! }!F ~! #!#b ##$#%#&#'#~ X! ", +" & (#)#6!*# 8!+#,#-#.#0#1#2#3#=!4#5#;!(! ", +" '!6#7#8#Z! 9#S :#;#<#: F =#I Z 3!Y >#?#@# ", +" U!A#B#C#X! m D#E#X F#G#V G#F#J Y 3!Y T!H# ", +" ( 2#y!I#J#O! W!K#v L#Y J f f f f f f M#0 ", +" ,!r!$#N#O#P#]!Q# W!R#S#U T#?!T#X ?!V f f U#Y! ", +" 8!? 1#V#W#h!y C!X#Y#q!Z#[#S#]#W G ^#G ?!* _#`#w P!a# ", +" b#J#? c#d#e#f#h g#+ | `!g h#Y Y i#Y f V!j#^ & D!' ", +" 6!l!J h#J W k#U K!U ]#Y ?!f f f f U#l#g! ", +" m#{!n#e h#i#J u f f f f f f f o#p#X! ", +" W!q#r#s#f f f f f f f f t#{!u#b# ", +" Z!2 P!- v#w#G!h!x#o#y#p#O!z# ", +" {#> |#}#p#}!8!m#X!~# ", +" $ $ ", +" "};
\ No newline at end of file diff --git a/RealtimeSync/application.cpp b/RealtimeSync/application.cpp new file mode 100644 index 00000000..5515ded5 --- /dev/null +++ b/RealtimeSync/application.cpp @@ -0,0 +1,89 @@ +/*************************************************************** + * Purpose: Code for Application Class + * Author: ZenJu (zhnmju123@gmx.de) + * Created: 2009-07-06 + * Copyright: ZenJu (http://sourceforge.net/projects/freefilesync/) + **************************************************************/ + +#include "application.h" +#include "mainDialog.h" +#include <wx/event.h> +#include "resources.h" +#include <wx/msgdlg.h> +#include "../shared/localization.h" +#include "xmlFreeFileSync.h" +#include "../shared/standardPaths.h" + +#ifdef FFS_LINUX +#include <gtk/gtk.h> +#endif + +IMPLEMENT_APP(Application); + +bool Application::OnInit() +{ +//do not call wxApp::OnInit() to avoid using default commandline parser + +//Note: initialization is done in the FIRST idle event instead of OnInit. Reason: Commandline mode requires the wxApp eventhandler to be established +//for UI update events. This is not the case at the time of OnInit(). + Connect(wxEVT_IDLE, wxIdleEventHandler(Application::OnStartApplication), NULL, this); + + return true; +} + + +void Application::OnStartApplication(wxIdleEvent& event) +{ + Disconnect(wxEVT_IDLE, wxIdleEventHandler(Application::OnStartApplication), NULL, this); + + //if appname is not set, the default is the executable's name! + SetAppName(wxT("FreeFileSync")); //use a different app name, to have "GetUserDataDir()" return the same directory as for FreeFileSync + +#ifdef FFS_LINUX + ::gtk_rc_parse("styles.rc"); //remove inner border from bitmap buttons +#endif + + //set program language + try + { + FreeFileSync::CustomLocale::getInstance().setLanguage(RealtimeSync::getProgramLanguage()); + } + catch (const xmlAccess::XmlError& error) + { + if (wxFileExists(FreeFileSync::getGlobalConfigFile())) + { + SetExitOnFrameDelete(false); //prevent error messagebox from becoming top-level window + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + SetExitOnFrameDelete(true); + + } + } + + //try to set config/batch-filename set by %1 parameter + wxString cfgFilename; + if (argc > 1) + { + const wxString filename(argv[1]); + + if (wxFileExists(filename)) //load file specified by %1 parameter: + cfgFilename = filename; + else if (wxFileExists(filename + wxT(".ffs_real"))) + cfgFilename = filename + wxT(".ffs_real"); + else if (wxFileExists(filename + wxT(".ffs_batch"))) + cfgFilename = filename + wxT(".ffs_batch"); + else + { + wxMessageBox(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\""), _("Error"), wxOK | wxICON_ERROR); + return; + } + } + + GlobalResources::getInstance().load(); //loads bitmap resources on program startup + + MainDialog* frame = new MainDialog(NULL, cfgFilename); + frame->SetIcon(*GlobalResources::getInstance().programIcon); //set application icon + frame->Show(); +} diff --git a/RealtimeSync/application.h b/RealtimeSync/application.h new file mode 100644 index 00000000..f6bfdd37 --- /dev/null +++ b/RealtimeSync/application.h @@ -0,0 +1,22 @@ +/*************************************************************** + * Purpose: Defines Application Class + * Author: ZenJu (zhnmju123@gmx.de) + * Created: 2009-07-06 + * Copyright: ZenJu (http://sourceforge.net/projects/freefilesync/) + **************************************************************/ + +#ifndef REALTIMESYNCAPP_H +#define REALTIMESYNCAPP_H + +#include <wx/app.h> + +class Application : public wxApp +{ +public: + virtual bool OnInit(); + +private: + void OnStartApplication(wxIdleEvent& event); +}; + +#endif // REALTIMESYNCAPP_H diff --git a/RealtimeSync/functions.cpp b/RealtimeSync/functions.cpp new file mode 100644 index 00000000..f966187e --- /dev/null +++ b/RealtimeSync/functions.cpp @@ -0,0 +1,15 @@ +#include "functions.h" +#include <wx/textctrl.h> +#include <wx/filepicker.h> +//#include "../shared/globalFunctions.h" +#include "../shared/fileHandling.h" + + +void RealtimeSync::setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker) +{ + txtCtrl->SetValue(dirname); + const Zstring leftDirFormatted = FreeFileSync::getFormattedDirectoryName(dirname.c_str()); + if (wxDirExists(leftDirFormatted.c_str())) + dirPicker->SetPath(leftDirFormatted.c_str()); +} + diff --git a/RealtimeSync/functions.h b/RealtimeSync/functions.h new file mode 100644 index 00000000..3d7d522f --- /dev/null +++ b/RealtimeSync/functions.h @@ -0,0 +1,15 @@ +#ifndef FUNCTIONS_H_INCLUDED +#define FUNCTIONS_H_INCLUDED + +#include <wx/string.h> + +class wxTextCtrl; +class wxDirPickerCtrl; + + +namespace RealtimeSync +{ + void setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker); +} + +#endif // FUNCTIONS_H_INCLUDED diff --git a/RealtimeSync/guiGenerated.cpp b/RealtimeSync/guiGenerated.cpp new file mode 100644 index 00000000..1150ae1b --- /dev/null +++ b/RealtimeSync/guiGenerated.cpp @@ -0,0 +1,212 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "../shared/customButton.h" + +#include "guiGenerated.h" + +/////////////////////////////////////////////////////////////////////////// + +MainDlgGenerated::MainDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + m_menubar1 = new wxMenuBar( 0 ); + m_menuFile = new wxMenu(); + wxMenuItem* m_menuItem14; + m_menuItem14 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&ave configuration") ) + wxT('\t') + wxT("CTRL-S"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem14 ); + + wxMenuItem* m_menuItem13; + m_menuItem13 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&Load configuration") ) + wxT('\t') + wxT("CTRL-L"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem13 ); + + m_menuFile->AppendSeparator(); + + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("CTRL-Q"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem4 ); + + m_menubar1->Append( m_menuFile, _("&File") ); + + m_menuHelp = new wxMenu(); + m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemAbout ); + + m_menubar1->Append( m_menuHelp, _("&Help") ); + + this->SetMenuBar( m_menubar1 ); + + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + m_panelMain = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1; + bSizer1 = new wxBoxSizer( wxVERTICAL ); + + + bSizer1->Add( 0, 10, 0, 0, 5 ); + + m_staticText2 = new wxStaticText( m_panelMain, wxID_ANY, _("Usage: Select directories for monitoring and enter a commandline. Each time files are modified within these directories (or subdirectories) the commandline is executed."), wxDefaultPosition, wxDefaultSize, 0|wxDOUBLE_BORDER ); + m_staticText2->Wrap( 350 ); + bSizer1->Add( m_staticText2, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 40 ); + + m_staticline2 = new wxStaticLine( m_panelMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer1->Add( m_staticline2, 0, wxTOP|wxBOTTOM|wxEXPAND, 10 ); + + wxBoxSizer* bSizer8; + bSizer8 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer5; + sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( m_panelMain, wxID_ANY, _("Directories to watch") ), wxVERTICAL ); + + m_panelMainFolder = new wxPanel( m_panelMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer114; + bSizer114 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer781; + bSizer781 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonAddFolder = new wxBitmapButton( m_panelMainFolder, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonAddFolder->SetToolTip( _("Add folder") ); + + m_bpButtonAddFolder->SetToolTip( _("Add folder") ); + + bSizer781->Add( m_bpButtonAddFolder, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRemoveTopFolder = new wxBitmapButton( m_panelMainFolder, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemoveTopFolder->SetToolTip( _("Remove folder") ); + + m_bpButtonRemoveTopFolder->SetToolTip( _("Remove folder") ); + + bSizer781->Add( m_bpButtonRemoveTopFolder, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer114->Add( bSizer781, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_txtCtrlDirectoryMain = new wxTextCtrl( m_panelMainFolder, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer114->Add( m_txtCtrlDirectoryMain, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerMain = new wxDirPickerCtrl( m_panelMainFolder, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerMain->SetToolTip( _("Select a folder") ); + + bSizer114->Add( m_dirPickerMain, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelMainFolder->SetSizer( bSizer114 ); + m_panelMainFolder->Layout(); + bSizer114->Fit( m_panelMainFolder ); + sbSizer5->Add( m_panelMainFolder, 0, wxEXPAND, 5 ); + + m_scrolledWinFolders = new wxScrolledWindow( m_panelMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_scrolledWinFolders->SetScrollRate( 5, 5 ); + bSizerFolders = new wxBoxSizer( wxVERTICAL ); + + m_scrolledWinFolders->SetSizer( bSizerFolders ); + m_scrolledWinFolders->Layout(); + bSizerFolders->Fit( m_scrolledWinFolders ); + sbSizer5->Add( m_scrolledWinFolders, 0, wxEXPAND, 5 ); + + bSizer8->Add( sbSizer5, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizer1->Add( bSizer8, 1, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer3; + sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelMain, wxID_ANY, _("Commandline") ), wxVERTICAL ); + + m_textCtrlCommand = new wxTextCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer3->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM, 5 ); + + bSizer1->Add( sbSizer3, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_staticline1 = new wxStaticLine( m_panelMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer1->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + + wxStaticBoxSizer* sbSizer4; + sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( m_panelMain, wxID_ANY, _("Delay") ), wxVERTICAL ); + + m_spinCtrlDelay = new wxSpinCtrl( m_panelMain, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 2000000000, 0 ); + m_spinCtrlDelay->SetToolTip( _("Delay between two invocations of the commandline") ); + + sbSizer4->Add( m_spinCtrlDelay, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer1->Add( sbSizer4, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_buttonStart = new wxButtonWithImage( m_panelMain, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonStart->SetDefault(); + m_buttonStart->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + + bSizer1->Add( m_buttonStart, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonCancel = new wxButton( m_panelMain, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); + bSizer1->Add( m_buttonCancel, 0, 0, 5 ); + + m_panelMain->SetSizer( bSizer1 ); + m_panelMain->Layout(); + bSizer1->Fit( m_panelMain ); + bSizerMain->Add( m_panelMain, 1, wxEXPAND, 5 ); + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDlgGenerated::OnClose ) ); + this->Connect( m_menuItem14->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnSaveConfig ) ); + this->Connect( m_menuItem13->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnLoadConfig ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnQuit ) ); + this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnMenuAbout ) ); + m_bpButtonAddFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnAddFolder ), NULL, this ); + m_bpButtonRemoveTopFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnRemoveTopFolder ), NULL, this ); + m_buttonStart->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnStart ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnQuit ), NULL, this ); +} + +MainDlgGenerated::~MainDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDlgGenerated::OnClose ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnSaveConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnLoadConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnQuit ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDlgGenerated::OnMenuAbout ) ); + m_bpButtonAddFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnAddFolder ), NULL, this ); + m_bpButtonRemoveTopFolder->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnRemoveTopFolder ), NULL, this ); + m_buttonStart->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnStart ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDlgGenerated::OnQuit ), NULL, this ); +} + +FolderGenerated::FolderGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizer114; + bSizer114 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonRemoveFolder = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemoveFolder->SetToolTip( _("Remove folder") ); + + m_bpButtonRemoveFolder->SetToolTip( _("Remove folder") ); + + bSizer114->Add( m_bpButtonRemoveFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer20; + bSizer20 = new wxBoxSizer( wxHORIZONTAL ); + + m_txtCtrlDirectory = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer20->Add( m_txtCtrlDirectory, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPicker = new wxDirPickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPicker->SetToolTip( _("Select a folder") ); + + bSizer20->Add( m_dirPicker, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer114->Add( bSizer20, 1, 0, 5 ); + + this->SetSizer( bSizer114 ); + this->Layout(); + bSizer114->Fit( this ); +} + +FolderGenerated::~FolderGenerated() +{ +} diff --git a/RealtimeSync/guiGenerated.h b/RealtimeSync/guiGenerated.h new file mode 100644 index 00000000..f62410a1 --- /dev/null +++ b/RealtimeSync/guiGenerated.h @@ -0,0 +1,128 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __guiGenerated__ +#define __guiGenerated__ + +#include <wx/intl.h> + +class wxButtonWithImage; + +#include <wx/string.h> +#include <wx/bitmap.h> +#include <wx/image.h> +#include <wx/icon.h> +#include <wx/menu.h> +#include <wx/gdicmn.h> +#include <wx/font.h> +#include <wx/colour.h> +#include <wx/settings.h> +#include <wx/stattext.h> +#include <wx/statline.h> +#include <wx/bmpbuttn.h> +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/textctrl.h> +#include <wx/filepicker.h> +#include <wx/panel.h> +#include <wx/scrolwin.h> +#include <wx/statbox.h> +#include <wx/spinctrl.h> +#include <wx/frame.h> + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class MainDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class MainDlgGenerated : public wxFrame +{ +private: + +protected: + wxMenuBar* m_menubar1; + wxMenu* m_menuFile; + wxMenu* m_menuHelp; + wxMenuItem* m_menuItemAbout; + wxBoxSizer* bSizerMain; + wxPanel* m_panelMain; + + wxStaticText* m_staticText2; + wxStaticLine* m_staticline2; + wxPanel* m_panelMainFolder; + wxBitmapButton* m_bpButtonAddFolder; + wxBitmapButton* m_bpButtonRemoveTopFolder; + wxTextCtrl* m_txtCtrlDirectoryMain; + wxScrolledWindow* m_scrolledWinFolders; + wxBoxSizer* bSizerFolders; + wxTextCtrl* m_textCtrlCommand; + wxStaticLine* m_staticline1; + wxSpinCtrl* m_spinCtrlDelay; + wxButtonWithImage* m_buttonStart; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) + { + event.Skip(); + } + virtual void OnSaveConfig( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnLoadConfig( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnQuit( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnMenuAbout( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnAddFolder( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnRemoveTopFolder( wxCommandEvent& event ) + { + event.Skip(); + } + virtual void OnStart( wxCommandEvent& event ) + { + event.Skip(); + } + + +public: + wxDirPickerCtrl* m_dirPickerMain; + MainDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("RealtimeSync - Automated Synchronization"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + ~MainDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class FolderGenerated +/////////////////////////////////////////////////////////////////////////////// +class FolderGenerated : public wxPanel +{ +private: + +protected: + +public: + wxBitmapButton* m_bpButtonRemoveFolder; + wxTextCtrl* m_txtCtrlDirectory; + wxDirPickerCtrl* m_dirPicker; + FolderGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~FolderGenerated(); + +}; + +#endif //__guiGenerated__ diff --git a/RealtimeSync/mainDialog.cpp b/RealtimeSync/mainDialog.cpp new file mode 100644 index 00000000..a3496b35 --- /dev/null +++ b/RealtimeSync/mainDialog.cpp @@ -0,0 +1,427 @@ +#include "mainDialog.h" +#include "resources.h" +#include "../shared/customButton.h" +#include "../shared/standardPaths.h" +#include "../shared/globalFunctions.h" +#include <wx/msgdlg.h> +#include <wx/wupdlock.h> +#include "watcher.h" +#include <wx/utils.h> +#include "xmlProcessing.h" +#include "trayMenu.h" +#include "../shared/fileHandling.h" +#include "xmlFreeFileSync.h" + + +MainDialog::MainDialog(wxDialog *dlg, const wxString& cfgFilename) + : MainDlgGenerated(dlg) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + m_bpButtonRemoveTopFolder->Hide(); + m_panelMainFolder->Layout(); + + m_bpButtonAddFolder->SetBitmapLabel(*GlobalResources::getInstance().bitmapAddFolderPair); + m_bpButtonRemoveTopFolder->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); + m_buttonStart->setBitmapFront(*GlobalResources::getInstance().bitmapStart); + m_buttonStart->SetFocus(); + + //register key event + Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnKeyPressed), NULL, this); + + //prepare drag & drop + dragDropOnFolder.reset(new FreeFileSync::DragDropOnDlg(m_panelMainFolder, m_dirPickerMain, m_txtCtrlDirectoryMain)); + + //load config values + xmlAccess::XmlRealConfig newConfig; + bool startWatchingImmediately = false; + + + if (cfgFilename.empty()) + try + { + RealtimeSync::readRealOrBatchConfig(lastConfigFileName(), newConfig); + } + catch (const xmlAccess::XmlError& error) + { + if (wxFileExists(lastConfigFileName())) //show error only if it's a parsing problem + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + } + } + else + try + { + RealtimeSync::readRealOrBatchConfig(cfgFilename, newConfig); + startWatchingImmediately = true; + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + } + + setConfiguration(newConfig); + + m_buttonStart->SetFocus(); + Fit(); + Center(); + + if (startWatchingImmediately) //start watch mode directly + { + wxCommandEvent dummy(wxEVT_COMMAND_BUTTON_CLICKED); + this->OnStart(dummy); + } +} + + +MainDialog::~MainDialog() +{ + //save current configuration + const xmlAccess::XmlRealConfig currentCfg = getConfiguration(); + + try //write config to XML + { + writeRealConfig(currentCfg, lastConfigFileName()); + } + catch (const FreeFileSync::FileError& error) + { + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + } +} + + +void MainDialog::OnClose(wxCloseEvent &event) +{ + Destroy(); +} + + +void MainDialog::OnQuit(wxCommandEvent &event) +{ + Destroy(); +} + + +const wxString& MainDialog::lastConfigFileName() +{ + static wxString instance = FreeFileSync::getConfigDir().EndsWith(wxString(globalFunctions::FILE_NAME_SEPARATOR)) ? + FreeFileSync::getConfigDir() + wxT("LastRun.ffs_real") : + FreeFileSync::getConfigDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("LastRun.ffs_real"); + return instance; +} + + +void MainDialog::OnMenuAbout(wxCommandEvent& event) +{ + //build information + wxString build = wxString(wxT("(")) + _("Build:") + wxT(" ") + __TDATE__; +#if wxUSE_UNICODE + build += wxT(" - Unicode)"); +#else + build += wxT(" - ANSI)"); +#endif //wxUSE_UNICODE + + wxMessageDialog* aboutDlg = new wxMessageDialog(this, wxString(wxT("RealtimeSync")) + wxT("\n\n") + build, _("About"), wxOK); + aboutDlg->ShowModal(); +} + + +void MainDialog::OnKeyPressed(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + + if (keyCode == WXK_ESCAPE) + Destroy(); + + event.Skip(); +} + + +void MainDialog::OnStart(wxCommandEvent& event) +{ + xmlAccess::XmlRealConfig currentCfg = getConfiguration(); + + Hide(); + + wxWindowDisabler dummy; //avoid unwanted re-entrance in the following process + + switch (RealtimeSync::startDirectoryMonitor(currentCfg)) + { + case RealtimeSync::QUIT: + { + Destroy(); + return; + } + break; + + case RealtimeSync::RESUME: + break; + } + + Show(); +} + + +void MainDialog::OnSaveConfig(wxCommandEvent& event) +{ + const wxString defaultFileName = wxT("Realtime.ffs_real"); + + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("RealtimeSync configuration")) + wxT(" (*.ffs_real)|*.ffs_real"), wxFD_SAVE); + if (filePicker->ShowModal() == wxID_OK) + { + const wxString newFileName = filePicker->GetPath(); + + if (wxFileExists(newFileName)) + { + wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\""), _("Warning") , wxOK | wxCANCEL); + + if (messageDlg->ShowModal() != wxID_OK) + { + OnSaveConfig(event); //retry + return; + } + } + + const xmlAccess::XmlRealConfig currentCfg = getConfiguration(); + + try //write config to XML + { + writeRealConfig(currentCfg, newFileName); + } + catch (const FreeFileSync::FileError& error) + { + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + } + } +} + + +void MainDialog::loadConfig(const wxString& filename) +{ + xmlAccess::XmlRealConfig newConfig; + + try + { + RealtimeSync::readRealOrBatchConfig(filename, newConfig); + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + return; + } + } + + setConfiguration(newConfig); +} + + +void MainDialog::OnLoadConfig(wxCommandEvent& event) +{ + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, wxEmptyString, + wxString(_("RealtimeSync configuration")) + wxT(" (*.ffs_real;*.ffs_batch)|*.ffs_real;*.ffs_batch"), + wxFD_OPEN); + if (filePicker->ShowModal() == wxID_OK) + loadConfig(filePicker->GetPath()); +} + + +void MainDialog::setConfiguration(const xmlAccess::XmlRealConfig& cfg) +{ + //clear existing folders + m_txtCtrlDirectoryMain->ChangeValue(wxEmptyString); + m_dirPickerMain->SetPath(wxEmptyString); + + clearAddFolders(); + + if (!cfg.directories.empty()) + { + //fill top folder + m_txtCtrlDirectoryMain->SetValue(*cfg.directories.begin()); + + const wxString dirFormatted = FreeFileSync::getFormattedDirectoryName(cfg.directories.begin()->c_str()).c_str(); + if (wxDirExists(dirFormatted)) + m_dirPickerMain->SetPath(dirFormatted); + + //fill additional folders + addFolder(std::vector<wxString>(cfg.directories.begin() + 1, cfg.directories.end())); + } + + //fill commandline + m_textCtrlCommand->SetValue(cfg.commandline); + + //set delay + m_spinCtrlDelay->SetValue(cfg.delay); +} + + +xmlAccess::XmlRealConfig MainDialog::getConfiguration() +{ + xmlAccess::XmlRealConfig output; + + output.directories.push_back(m_txtCtrlDirectoryMain->GetValue()); + for (std::vector<FolderPanel*>::const_iterator i = additionalFolders.begin(); i != additionalFolders.end(); ++i) + output.directories.push_back((*i)->m_txtCtrlDirectory->GetValue()); + + output.commandline = m_textCtrlCommand->GetValue(); + output.delay = m_spinCtrlDelay->GetValue();; + + return output; +} + + +void MainDialog::OnAddFolder(wxCommandEvent& event) +{ + const wxString topFolder = m_txtCtrlDirectoryMain->GetValue(); + + //clear existing top folder first + RealtimeSync::setDirectoryName(wxEmptyString, m_txtCtrlDirectoryMain, m_dirPickerMain); + + std::vector<wxString> newFolders; + newFolders.push_back(topFolder.c_str()); + + addFolder(newFolders, true); //add pair in front of additonal pairs +} + + +void MainDialog::OnRemoveFolder(wxCommandEvent& event) +{ + //find folder pair originating the event + const wxObject* const eventObj = event.GetEventObject(); + for (std::vector<FolderPanel*>::const_iterator i = additionalFolders.begin(); i != additionalFolders.end(); ++i) + { + if (eventObj == static_cast<wxObject*>((*i)->m_bpButtonRemoveFolder)) + { + removeAddFolder(i - additionalFolders.begin()); + return; + } + } +} + + +void MainDialog::OnRemoveTopFolder(wxCommandEvent& event) +{ + if (additionalFolders.size() > 0) + { + const wxString topDir = (*additionalFolders.begin())->m_txtCtrlDirectory->GetValue().c_str(); + RealtimeSync::setDirectoryName(topDir, m_txtCtrlDirectoryMain, m_dirPickerMain); + + removeAddFolder(0); //remove first of additional folders + } +} + + +#ifdef FFS_WIN +static const size_t MAX_ADD_FOLDERS = 8; +#elif defined FFS_LINUX +static const size_t MAX_ADD_FOLDERS = 6; +#endif + + +void MainDialog::addFolder(const std::vector<wxString>& newFolders, bool addFront) +{ + if (newFolders.size() == 0) + return; + + wxWindowUpdateLocker dummy(this); //avoid display distortion + + int folderHeight = 0; + for (std::vector<wxString>::const_iterator i = newFolders.begin(); i != newFolders.end(); ++i) + { + //add new folder pair + FolderPanel* newFolder = new FolderPanel(m_scrolledWinFolders); + newFolder->m_bpButtonRemoveFolder->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); + + //get size of scrolled window + folderHeight = newFolder->GetSize().GetHeight(); + + if (addFront) + { + bSizerFolders->Insert(0, newFolder, 0, wxEXPAND, 5); + additionalFolders.insert(additionalFolders.begin(), newFolder); + } + else + { + bSizerFolders->Add(newFolder, 0, wxEXPAND, 5); + additionalFolders.push_back(newFolder); + } + + //register events + newFolder->m_bpButtonRemoveFolder->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolder), NULL, this ); + + //insert directory name + RealtimeSync::setDirectoryName(*i, newFolder->m_txtCtrlDirectory, newFolder->m_dirPicker); + } + + //set size of scrolled window + const int additionalRows = std::min(additionalFolders.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown + m_scrolledWinFolders->SetMinSize(wxSize( -1, folderHeight * additionalRows)); + + //adapt delete top folder pair button + m_bpButtonRemoveTopFolder->Show(); + m_panelMainFolder->Layout(); + + //update controls + m_scrolledWinFolders->Fit(); //adjust scrolled window size + m_scrolledWinFolders->Layout(); //fix small layout problem + m_panelMain->Layout(); //adjust stuff inside scrolled window + Fit(); //adapt dialog size +} + + +void MainDialog::removeAddFolder(const int pos) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + if (0 <= pos && pos < int(additionalFolders.size())) + { + //remove folder pairs from window + FolderPanel* dirToDelete = additionalFolders[pos]; + const int folderHeight = dirToDelete->GetSize().GetHeight(); + + bSizerFolders->Detach(dirToDelete); //Remove() does not work on Window*, so do it manually + dirToDelete->Destroy(); // + additionalFolders.erase(additionalFolders.begin() + pos); //remove last element in vector + + + //set size of scrolled window + const int additionalRows = std::min(additionalFolders.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown + m_scrolledWinFolders->SetMinSize(wxSize( -1, folderHeight * additionalRows)); + + //adapt delete top folder pair button + if (additionalFolders.size() == 0) + { + m_bpButtonRemoveTopFolder->Hide(); + m_panelMainFolder->Layout(); + } + + //update controls + m_scrolledWinFolders->Fit(); //adjust scrolled window size + m_panelMain->Layout(); //adjust stuff inside scrolled window + Fit(); //adapt dialog size + } +} + + +void MainDialog::clearAddFolders() +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + additionalFolders.clear(); + bSizerFolders->Clear(true); + + m_bpButtonRemoveTopFolder->Hide(); + m_panelMainFolder->Layout(); + + m_scrolledWinFolders->SetMinSize(wxSize(-1, 0)); + Fit(); //adapt dialog size +} diff --git a/RealtimeSync/mainDialog.h b/RealtimeSync/mainDialog.h new file mode 100644 index 00000000..9cf44a67 --- /dev/null +++ b/RealtimeSync/mainDialog.h @@ -0,0 +1,75 @@ +/*************************************************************** + * Purpose: Defines Application Frame + * Author: ZenJu (zhnmju123@gmx.de) + * Created: 2009-07-06 + * Copyright: ZenJu (http://sourceforge.net/projects/freefilesync/) + **************************************************************/ + +#ifndef REALTIMESYNCMAIN_H +#define REALTIMESYNCMAIN_H + +#include "guiGenerated.h" +#include <vector> +#include <memory> +#include "../shared/dragAndDrop.h" + +namespace xmlAccess +{ + struct XmlRealConfig; +} + + +class FolderPanel : public FolderGenerated +{ +public: + FolderPanel(wxWindow* parent) : + FolderGenerated(parent), + dragDropOnFolder(new FreeFileSync::DragDropOnDlg(this, m_dirPicker, m_txtCtrlDirectory)) {} + +private: + //support for drag and drop + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnFolder; +}; + + + +class MainDialog: public MainDlgGenerated +{ +public: + MainDialog(wxDialog *dlg, const wxString& cfgFilename); + ~MainDialog(); + + void loadConfig(const wxString& filename); + +private: + virtual void OnClose( wxCloseEvent& event); + virtual void OnQuit( wxCommandEvent& event); + virtual void OnMenuAbout( wxCommandEvent& event); + virtual void OnAddFolder( wxCommandEvent& event); + virtual void OnRemoveFolder( wxCommandEvent& event); + virtual void OnRemoveTopFolder( wxCommandEvent& event); + virtual void OnKeyPressed( wxKeyEvent& event); + virtual void OnStart( wxCommandEvent& event); + virtual void OnSaveConfig( wxCommandEvent& event); + virtual void OnLoadConfig( wxCommandEvent& event); + + void setConfiguration(const xmlAccess::XmlRealConfig& cfg); + xmlAccess::XmlRealConfig getConfiguration(); + + void layoutAsync(); //call Layout() asynchronously + + void addFolder(const wxString& dirname, bool addFront = false); + void addFolder(const std::vector<wxString>& newFolders, bool addFront = false); + void removeAddFolder(const int pos); //keep it an int, allow negative values! + void clearAddFolders(); + + static const wxString& lastConfigFileName(); + + //additional folders + std::vector<FolderPanel*> additionalFolders; //additional pairs to the standard pair + + //support for drag and drop on main folder + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnFolder; +}; + +#endif // REALTIMESYNCMAIN_H diff --git a/RealtimeSync/makefile b/RealtimeSync/makefile new file mode 100644 index 00000000..02303ba9 --- /dev/null +++ b/RealtimeSync/makefile @@ -0,0 +1,57 @@ +CPPFLAGS=-Wall -pipe -DNDEBUG `wx-config --cppflags` `pkg-config --cflags gtk+-2.0` -DFFS_LINUX -DTIXML_USE_STL -DZSTRING_CHAR -O3 -pthread -c +LINKFLAGS=`wx-config --libs` -O3 -pthread + +FILE_LIST= #internal list of all *.cpp files needed for compilation +FILE_LIST+=application.cpp +FILE_LIST+=functions.cpp +FILE_LIST+=guiGenerated.cpp +FILE_LIST+=mainDialog.cpp +FILE_LIST+=resources.cpp +FILE_LIST+=trayMenu.cpp +FILE_LIST+=watcher.cpp +FILE_LIST+=xmlProcessing.cpp +FILE_LIST+=xmlFreeFileSync.cpp +FILE_LIST+=../library/processXml.cpp +FILE_LIST+=../structures.cpp +FILE_LIST+=../shared/inotify/inotify-cxx.cpp +FILE_LIST+=../shared/tinyxml/tinyxml.cpp +FILE_LIST+=../shared/tinyxml/tinystr.cpp +FILE_LIST+=../shared/tinyxml/tinyxmlerror.cpp +FILE_LIST+=../shared/tinyxml/tinyxmlparser.cpp +FILE_LIST+=../shared/globalFunctions.cpp +FILE_LIST+=../shared/systemFunctions.cpp +FILE_LIST+=../shared/dragAndDrop.cpp +FILE_LIST+=../shared/zstring.cpp +FILE_LIST+=../shared/xmlBase.cpp +FILE_LIST+=../shared/customButton.cpp +FILE_LIST+=../shared/fileHandling.cpp +FILE_LIST+=../shared/fileTraverser.cpp +FILE_LIST+=../shared/localization.cpp +FILE_LIST+=../shared/standardPaths.cpp + +#list of all *.o files +OBJECT_LIST=$(foreach file, $(FILE_LIST), OBJ/$(subst .cpp,.o,$(notdir $(file)))) + +#build list of all dependencies +DEP_LIST=$(foreach file, $(FILE_LIST), $(subst .cpp,.dep,$(file))) + + +all: RealtimeSync + +init: + if [ ! -d OBJ ]; then mkdir OBJ; fi + +#remove byte ordering mark: needed by Visual C++ but an error with GCC +removeBOM: ../tools/removeBOM.cpp + g++ -o removeBOM ../tools/removeBOM.cpp + ./removeBOM ../shared/localization.cpp + +%.dep : %.cpp + #strip path information + g++ $(CPPFLAGS) $< -o OBJ/$(subst .cpp,.o,$(notdir $<)) + +RealtimeSync: init removeBOM $(DEP_LIST) + g++ $(LINKFLAGS) -o ../BUILD/RealtimeSync $(OBJECT_LIST) + +clean: + find OBJ -type f -exec rm {} \; diff --git a/RealtimeSync/pch.h b/RealtimeSync/pch.h new file mode 100644 index 00000000..22ed251f --- /dev/null +++ b/RealtimeSync/pch.h @@ -0,0 +1,97 @@ +#ifndef FFS_PRECOMPILED_HEADER +#define FFS_PRECOMPILED_HEADER + +//pay attention when using this file: might cause issues! +#ifndef __WXDEBUG__ +do NOT use in release build! +#endif + +//##################################################### +// basic wxWidgets headers +#ifndef WX_PRECOMP +#define WX_PRECOMP +#endif + +#include <wx/wxprec.h> + +//##################################################### +// #include other rarely changing headers here + +//STL headers +#include <string> +#include <algorithm> +#include <vector> +#include <queue> +#include <stack> +#include <set> +#include <map> +#include <memory> +#include <fstream> + +#ifdef FFS_LINUX +#include <utime.h> +#endif //FFS_LINUX + +//other wxWidgets headers +#include <wx/grid.h> +#include <wx/animate.h> +#include <wx/app.h> +#include <wx/arrstr.h> +#include <wx/bitmap.h> +#include <wx/bmpbuttn.h> +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/choice.h> +#include <wx/clipbrd.h> +#include <wx/cmdline.h> +#include <wx/colour.h> +#include <wx/config.h> +#include <wx/dc.h> +#include <wx/dialog.h> +#include <wx/dir.h> +#include <wx/dnd.h> +#include <wx/file.h> +#include <wx/filename.h> +#include <wx/filepicker.h> +#include <wx/font.h> +#include <wx/frame.h> +#include <wx/gauge.h> +#include <wx/gdicmn.h> +#include <wx/grid.h> +#include <wx/hyperlink.h> +#include <wx/icon.h> +#include <wx/image.h> +#include <wx/intl.h> +#include <wx/log.h> +#include <wx/menu.h> +#include <wx/msgdlg.h> +#include <wx/panel.h> +#include <wx/radiobut.h> +#include <wx/settings.h> +#include <wx/sizer.h> +#include <wx/statbmp.h> +#include <wx/statbox.h> +#include <wx/statline.h> +#include <wx/stattext.h> +#include <wx/stdpaths.h> +#include <wx/stopwatch.h> +#include <wx/stream.h> +#include <wx/string.h> +#include <wx/textctrl.h> +#include <wx/thread.h> +#include <wx/utils.h> +#include <wx/wfstream.h> +#include <wx/zipstrm.h> +#include <wx/scrolwin.h> +#include <wx/notebook.h> + +//other +#include "../shared/tinyxml/tinyxml.h" +#include <sys/stat.h> + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" +#endif //FFS_WIN +//##################################################### + +#endif //FFS_PRECOMPILED_HEADER diff --git a/RealtimeSync/resource.rc b/RealtimeSync/resource.rc new file mode 100644 index 00000000..616ea49d --- /dev/null +++ b/RealtimeSync/resource.rc @@ -0,0 +1,4 @@ +#include "wx/msw/wx.rc" + +//naming convention to set icon sequence in executable file +A_PROGRAM_ICON ICON DISCARDABLE "RealtimeSync.ico" diff --git a/RealtimeSync/resources.cpp b/RealtimeSync/resources.cpp new file mode 100644 index 00000000..638df0f6 --- /dev/null +++ b/RealtimeSync/resources.cpp @@ -0,0 +1,81 @@ +#include "resources.h" +#include <wx/wfstream.h> +#include <wx/zipstrm.h> +#include <wx/image.h> +#include <wx/icon.h> +#include "../shared/globalFunctions.h" +#include "../shared/standardPaths.h" + + +const GlobalResources& GlobalResources::getInstance() +{ + static GlobalResources instance; + return instance; +} + + +GlobalResources::GlobalResources() +{ + //map, allocate and initialize pictures + bitmapResource[wxT("start red.png")] = (bitmapStart = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("add pair.png")] = (bitmapAddFolderPair = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("remove pair.png")] = (bitmapRemoveFolderPair = new wxBitmap(wxNullBitmap)); + + programIcon = new wxIcon(wxNullIcon); +} + + +GlobalResources::~GlobalResources() +{ + //free bitmap resources + for (std::map<wxString, wxBitmap*>::iterator i = bitmapResource.begin(); i != bitmapResource.end(); ++i) + delete i->second; + + //free other resources + delete programIcon; +} + + +void GlobalResources::load() const +{ + wxFFileInputStream input(FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("Resources.dat")); + if (input.IsOk()) //if not... we don't want to react too harsh here + { + //activate support for .png files + wxImage::AddHandler(new wxPNGHandler); //ownership passed + + wxZipInputStream resourceFile(input); + + std::map<wxString, wxBitmap*>::iterator bmp; + while (true) + { + std::auto_ptr<wxZipEntry> entry(resourceFile.GetNextEntry()); + if (entry.get() == NULL) + break; + + const wxString name = entry->GetName(); + + //search if entry is available in map + if ((bmp = bitmapResource.find(name)) != bitmapResource.end()) + *(bmp->second) = wxBitmap(wxImage(resourceFile, wxBITMAP_TYPE_PNG)); + } + } + +#ifdef FFS_WIN + *programIcon = wxIcon(wxT("A_PROGRAM_ICON")); +#else +#include "RealtimeSync.xpm" + *programIcon = wxIcon(RealtimeSync_xpm); +#endif +} + + +const wxBitmap& GlobalResources::getImageByName(const wxString& imageName) const +{ + std::map<wxString, wxBitmap*>::const_iterator bmp = bitmapResource.find(imageName); + if (bmp != bitmapResource.end()) + return *bmp->second; + else + return wxNullBitmap; +} + diff --git a/RealtimeSync/resources.h b/RealtimeSync/resources.h new file mode 100644 index 00000000..3a0cde7b --- /dev/null +++ b/RealtimeSync/resources.h @@ -0,0 +1,33 @@ +#ifndef RESOURCES_H_INCLUDED +#define RESOURCES_H_INCLUDED + +#include <wx/bitmap.h> +#include <wx/string.h> +#include <map> + + +class GlobalResources +{ +public: + static const GlobalResources& getInstance(); + + const wxBitmap& getImageByName(const wxString& imageName) const; + + //image resource objects + wxBitmap* bitmapStart; + wxBitmap* bitmapAddFolderPair; + wxBitmap* bitmapRemoveFolderPair; + + wxIcon* programIcon; + + void load() const; //loads bitmap resources on program startup: logical const! + +private: + GlobalResources(); + ~GlobalResources(); + + //resource mapping + mutable std::map<wxString, wxBitmap*> bitmapResource; +}; + +#endif // RESOURCES_H_INCLUDED diff --git a/RealtimeSync/trayMenu.cpp b/RealtimeSync/trayMenu.cpp new file mode 100644 index 00000000..5d9d2430 --- /dev/null +++ b/RealtimeSync/trayMenu.cpp @@ -0,0 +1,209 @@ +#include "trayMenu.h" +#include <wx/msgdlg.h> +#include <wx/taskbar.h> +#include <wx/app.h> +#include "resources.h" +#include <memory> +#include <wx/utils.h> +#include <wx/menu.h> +#include "watcher.h" +#include <wx/timer.h> +#include <wx/utils.h> +#include <wx/log.h> + +class RtsTrayIcon; + + +class WaitCallbackImpl : public RealtimeSync::WaitCallback +{ +public: + WaitCallbackImpl(); + + virtual void requestUiRefresh(); + + void requestAbort() + { + m_abortRequested = true; + } + + void requestResume() + { + m_resumeRequested = true; + } + +private: + std::auto_ptr<RtsTrayIcon> trayMenu; + bool m_abortRequested; + bool m_resumeRequested; +}; + + +class RtsTrayIcon : public wxTaskBarIcon +{ +public: + RtsTrayIcon(WaitCallbackImpl* callback) : + m_callback(callback) + { + wxTaskBarIcon::SetIcon(*GlobalResources::getInstance().programIcon, wxT("RealtimeSync")); + + //register double-click + Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(RtsTrayIcon::resumeToMain), NULL, this); + } + + void updateSysTray() + { + wxTheApp->Yield(); + } + +private: + enum Selection + { + CONTEXT_ABORT, + CONTEXT_RESTORE, + CONTEXT_ABOUT + }; + + virtual wxMenu* CreatePopupMenu() + { + wxMenu* contextMenu = new wxMenu; + contextMenu->Append(CONTEXT_RESTORE, _("&Restore")); + contextMenu->Append(CONTEXT_ABOUT, _("&About...")); + contextMenu->AppendSeparator(); + contextMenu->Append(CONTEXT_ABORT, _("&Exit")); + //event handling + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(RtsTrayIcon::OnContextMenuSelection), NULL, this); + + return contextMenu; //ownership transferred to library + } + + void OnContextMenuSelection(wxCommandEvent& event) + { + const int eventId = event.GetId(); + switch (static_cast<Selection>(eventId)) + { + case CONTEXT_ABORT: + m_callback->requestAbort(); + break; + case CONTEXT_ABOUT: + { + //build information + wxString build = wxString(wxT("(")) + _("Build:") + wxT(" ") + __TDATE__; +#if wxUSE_UNICODE + build += wxT(" - Unicode)"); +#else + build += wxT(" - ANSI)"); +#endif //wxUSE_UNICODE + + wxMessageDialog* aboutDlg = new wxMessageDialog(NULL, wxString(wxT("RealtimeSync")) + wxT("\n\n") + build, _("About"), wxOK); + aboutDlg->ShowModal(); + aboutDlg->Destroy(); + } + break; + case CONTEXT_RESTORE: + m_callback->requestResume(); + break; + } + } + + void resumeToMain(wxCommandEvent& event) + { + m_callback->requestResume(); + } + + WaitCallbackImpl* m_callback; +}; + + +bool updateUiIsAllowed() +{ + static wxLongLong lastExec = 0; + const wxLongLong newExec = wxGetLocalTimeMillis(); + + if (newExec - lastExec >= RealtimeSync::UI_UPDATE_INTERVAL) //perform ui updates not more often than necessary + { + lastExec = newExec; + return true; + } + return false; +} + + +class AbortThisProcess //exception class +{ +public: + AbortThisProcess(bool backToMain) : m_backToMain(backToMain) {} + + bool backToMainMenu() const + { + return m_backToMain; + } + +private: + bool m_backToMain; +}; + + + +WaitCallbackImpl::WaitCallbackImpl() : + m_abortRequested(false), + m_resumeRequested(false) +{ + trayMenu.reset(new RtsTrayIcon(this)); +} + + +void WaitCallbackImpl::requestUiRefresh() +{ + if (updateUiIsAllowed()) + trayMenu->updateSysTray(); + + if (m_abortRequested) + throw ::AbortThisProcess(false); + + if (m_resumeRequested) + throw ::AbortThisProcess(true); +} + + +RealtimeSync::MonitorResponse RealtimeSync::startDirectoryMonitor(const xmlAccess::XmlRealConfig& config) +{ + try + { + WaitCallbackImpl callback; + + if (config.commandline.empty()) + throw FreeFileSync::FileError(_("Commandline is empty!")); + + long lastExec = 0; + while (true) + { + wxExecute(config.commandline, wxEXEC_SYNC); //execute command + wxLog::FlushActive(); //show wxWidgets error messages (if any) + + //wait + waitForChanges(config.directories, &callback); + lastExec = wxGetLocalTime(); + + //some delay + while (wxGetLocalTime() - lastExec < static_cast<long>(config.delay)) + { + callback.requestUiRefresh(); + wxMilliSleep(RealtimeSync::UI_UPDATE_INTERVAL); + } + } + } + catch (const ::AbortThisProcess& ab) + { + if (ab.backToMainMenu()) + return RESUME; + else + return QUIT; + } + catch (const FreeFileSync::FileError& error) + { + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + return RESUME; + } + + return RESUME; +} diff --git a/RealtimeSync/trayMenu.h b/RealtimeSync/trayMenu.h new file mode 100644 index 00000000..04b07f8a --- /dev/null +++ b/RealtimeSync/trayMenu.h @@ -0,0 +1,20 @@ +#ifndef TRAYMENU_H_INCLUDED +#define TRAYMENU_H_INCLUDED + +#include "watcher.h" +#include "xmlProcessing.h" + + +namespace RealtimeSync +{ + enum MonitorResponse + { + RESUME, + QUIT + }; + + MonitorResponse startDirectoryMonitor(const xmlAccess::XmlRealConfig& config); +} + + +#endif // TRAYMENU_H_INCLUDED diff --git a/RealtimeSync/watcher.cpp b/RealtimeSync/watcher.cpp new file mode 100644 index 00000000..4949f01a --- /dev/null +++ b/RealtimeSync/watcher.cpp @@ -0,0 +1,198 @@ +#include "watcher.h" +#include "../shared/systemFunctions.h" +#include "functions.h" +#include <wx/intl.h> +#include <wx/filefn.h> +#include "../shared/fileHandling.h" + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" + +#elif defined FFS_LINUX +#include <wx/timer.h> +#include <exception> +#include "../shared/inotify/inotify-cxx.h" +#include "../shared/fileTraverser.h" +#endif + + +#ifdef FFS_WIN +class ChangeNotifications +{ +public: + ~ChangeNotifications() + { + for (std::vector<HANDLE>::const_iterator i = arrayHandle.begin(); i != arrayHandle.end(); ++i) + if (*i != INVALID_HANDLE_VALUE) + ::FindCloseChangeNotification(*i); + } + + void addHandle(const HANDLE hndl) + { + arrayHandle.push_back(hndl); + } + + size_t getSize() + { + return arrayHandle.size(); + } + + const HANDLE* getArray() + { + return &arrayHandle[0]; //client needs to check getSize() before calling this method! + } + +private: + std::vector<HANDLE> arrayHandle; +}; + +#elif defined FFS_LINUX +class DirsOnlyTraverser : public FreeFileSync::TraverseCallback +{ +public: + DirsOnlyTraverser(std::vector<std::string>& dirs) : m_dirs(dirs) {} + + virtual ReturnValue onFile(const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) + { + return TRAVERSING_CONTINUE; + } + virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) + { + m_dirs.push_back(fullName.c_str()); + return ReturnValDir(ReturnValDir::Continue(), this); + } + virtual ReturnValue onError(const wxString& errorText) + { + throw FreeFileSync::FileError(errorText); + } + +private: + std::vector<std::string>& m_dirs; +}; +#endif + + +void RealtimeSync::waitForChanges(const std::vector<wxString>& dirNames, WaitCallback* statusHandler) +{ + if (dirNames.empty()) //pathological case, but check is needed later + return; + +#ifdef FFS_WIN + ChangeNotifications notifications; + + for (std::vector<wxString>::const_iterator i = dirNames.begin(); i != dirNames.end(); ++i) + { + const Zstring formattedDir = FreeFileSync::getFormattedDirectoryName(i->c_str()); + + if (formattedDir.empty()) + throw FreeFileSync::FileError(_("Please fill all empty directory fields.")); + else if (!FreeFileSync::dirExists(formattedDir)) + throw FreeFileSync::FileError(wxString(_("Directory does not exist:")) + wxT("\n") + + wxT("\"") + formattedDir + wxT("\"") + wxT("\n\n") + + FreeFileSync::getLastErrorFormatted()); + + const HANDLE rv = ::FindFirstChangeNotification( + formattedDir.c_str(), //__in LPCTSTR lpPathName, + true, //__in BOOL bWatchSubtree, + FILE_NOTIFY_CHANGE_FILE_NAME | + FILE_NOTIFY_CHANGE_DIR_NAME | + FILE_NOTIFY_CHANGE_SIZE | + FILE_NOTIFY_CHANGE_LAST_WRITE); //__in DWORD dwNotifyFilter + + if (rv == INVALID_HANDLE_VALUE) + { + const wxString errorMessage = wxString(_("Could not initialize directory monitoring:")) + wxT("\n\"") + *i + wxT("\""); + throw FreeFileSync::FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + notifications.addHandle(rv); + } + + + while (true) + { + const DWORD rv = ::WaitForMultipleObjects( //NOTE: notifications.getArray() returns valid pointer, because it cannot be empty in this context + notifications.getSize(), //__in DWORD nCount, + notifications.getArray(), //__in const HANDLE *lpHandles, + false, //__in BOOL bWaitAll, + UI_UPDATE_INTERVAL); //__in DWORD dwMilliseconds + if (WAIT_OBJECT_0 <= rv && rv < WAIT_OBJECT_0 + notifications.getSize()) + return; //directory change detected + else if (rv == WAIT_FAILED) + throw FreeFileSync::FileError(wxString(_("Error when monitoring directories.")) + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + else if (rv == WAIT_TIMEOUT) + statusHandler->requestUiRefresh(); + } + +#elif defined FFS_LINUX + std::vector<std::string> fullDirList; + + //add all subdirectories + for (std::vector<wxString>::const_iterator i = dirNames.begin(); i != dirNames.end(); ++i) + { + const Zstring formattedDir = FreeFileSync::getFormattedDirectoryName(i->c_str()); + + if (formattedDir.empty()) + throw FreeFileSync::FileError(_("Please fill all empty directory fields.")); + + else if (!FreeFileSync::dirExists(formattedDir)) + throw FreeFileSync::FileError(wxString(_("Directory does not exist:")) + wxT("\n") + + wxT("\"") + formattedDir + wxT("\"") + wxT("\n\n") + + FreeFileSync::getLastErrorFormatted()); + + fullDirList.push_back(formattedDir.c_str()); + //get all subdirectories + DirsOnlyTraverser traverser(fullDirList); + FreeFileSync::traverseFolder(formattedDir, false, &traverser); //don't traverse into symlinks (analog to windows build) + } + + try + { + Inotify notifications; + notifications.SetNonBlock(true); + + for (std::vector<std::string>::const_iterator i = fullDirList.begin(); i != fullDirList.end(); ++i) + { + try + { + InotifyWatch newWatch(*i, //dummy object: InotifyWatch may be destructed safely after Inotify::Add() + IN_DONT_FOLLOW | //don't follow symbolic links + IN_ONLYDIR | //watch directories only + IN_CLOSE_WRITE | + IN_CREATE | + IN_DELETE | + IN_DELETE_SELF | + IN_MODIFY | + IN_MOVE_SELF | + IN_MOVED_FROM | + IN_MOVED_TO ); + notifications.Add(newWatch); + } + catch (const InotifyException& e) + { + const wxString errorMessage = wxString(_("Could not initialize directory monitoring:")) + wxT("\n\"") + *i + wxT("\""); + throw FreeFileSync::FileError(errorMessage + wxT("\n\n") + e.GetMessage().c_str()); + } + } + + while (true) + { + notifications.WaitForEvents(); //called in non-blocking mode + + if (notifications.GetEventCount() > 0) + return; //directory change detected + + wxMilliSleep(RealtimeSync::UI_UPDATE_INTERVAL); + statusHandler->requestUiRefresh(); + } + } + catch (const InotifyException& e) + { + throw FreeFileSync::FileError(wxString(_("Error when monitoring directories.")) + wxT("\n\n") + e.GetMessage().c_str()); + } + catch (const std::exception& e) + { + throw FreeFileSync::FileError(wxString(_("Error when monitoring directories.")) + wxT("\n\n") + e.what()); + } +#endif +} diff --git a/RealtimeSync/watcher.h b/RealtimeSync/watcher.h new file mode 100644 index 00000000..1655eebf --- /dev/null +++ b/RealtimeSync/watcher.h @@ -0,0 +1,23 @@ +#ifndef WATCHER_H_INCLUDED +#define WATCHER_H_INCLUDED + +#include "functions.h" +#include <vector> +#include "../shared/fileError.h" + + +namespace RealtimeSync +{ + const int UI_UPDATE_INTERVAL = 100; //perform ui updates not more often than necessary, 100 seems to be a good value with only a minimal performance loss + + class WaitCallback + { + public: + virtual ~WaitCallback() {} + virtual void requestUiRefresh() = 0; //opportunity to abort must be implemented in a frequently executed method like requestUiRefresh() + }; + + void waitForChanges(const std::vector<wxString>& dirNames, WaitCallback* statusHandler); //throw(FreeFileSync::FileError); +} + +#endif // WATCHER_H_INCLUDED diff --git a/RealtimeSync/xmlFreeFileSync.cpp b/RealtimeSync/xmlFreeFileSync.cpp new file mode 100644 index 00000000..36f0e2f8 --- /dev/null +++ b/RealtimeSync/xmlFreeFileSync.cpp @@ -0,0 +1,68 @@ +#include "xmlFreeFileSync.h" +#include "../shared/standardPaths.h" +#include "../shared/globalFunctions.h" +#include "../shared/zstring.h" +#include "functions.h" +#include "../shared/xmlBase.h" + +//include FreeFileSync xml headers +#include "../library/processXml.h" + + +#ifdef FFS_WIN +class CmpNoCase +{ +public: + bool operator()(const wxString& a, const wxString& b) + { + return FreeFileSync::compareStringsWin32(a.c_str(), b.c_str(), a.length(), b.length()) < 0; + } +}; +#endif + + +void RealtimeSync::readRealOrBatchConfig(const wxString& filename, xmlAccess::XmlRealConfig& config) //throw (xmlAccess::XmlError); +{ + if (xmlAccess::getXmlType(filename) != xmlAccess::XML_BATCH_CONFIG) + { + xmlAccess::readRealConfig(filename, config); + return; + } + + //convert batch config to RealtimeSync config + xmlAccess::XmlBatchConfig batchCfg; + try + { + xmlAccess::readBatchConfig(filename, batchCfg); //throw (xmlAccess::XmlError); + } + catch (const xmlAccess::XmlError& e) + { + if (e.getSeverity() != xmlAccess::XmlError::WARNING) //ignore parsing errors + throw; + } + +#ifdef FFS_WIN + std::set<wxString, CmpNoCase> uniqueFolders; +#elif defined FFS_LINUX + std::set<wxString> uniqueFolders; +#endif + + for (std::vector<FreeFileSync::FolderPair>::const_iterator i = batchCfg.directoryPairs.begin(); i != batchCfg.directoryPairs.end(); ++i) + { + uniqueFolders.insert(i->leftDirectory.c_str()); + uniqueFolders.insert(i->rightDirectory.c_str()); + } + + config.directories.insert(config.directories.end(), uniqueFolders.begin(), uniqueFolders.end()); + + config.commandline = FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("FreeFileSync.exe ") + + wxT("\"") + filename + wxT("\""); +} + + +int RealtimeSync::getProgramLanguage() +{ + xmlAccess::XmlGlobalSettings settings; + xmlAccess::readGlobalSettings(settings); + return settings.programLanguage; +} diff --git a/RealtimeSync/xmlFreeFileSync.h b/RealtimeSync/xmlFreeFileSync.h new file mode 100644 index 00000000..e4e0be76 --- /dev/null +++ b/RealtimeSync/xmlFreeFileSync.h @@ -0,0 +1,16 @@ +#ifndef XMLFREEFILESYNC_H_INCLUDED +#define XMLFREEFILESYNC_H_INCLUDED + +#include "xmlProcessing.h" + + +//reuse (some of) FreeFileSync's xml files + +namespace RealtimeSync +{ + void readRealOrBatchConfig(const wxString& filename, xmlAccess::XmlRealConfig& config); //throw (xmlAccess::XmlError); + + int getProgramLanguage(); //throw (xmlAccess::XmlError); +} + +#endif // XMLFREEFILESYNC_H_INCLUDED diff --git a/RealtimeSync/xmlProcessing.cpp b/RealtimeSync/xmlProcessing.cpp new file mode 100644 index 00000000..7b640455 --- /dev/null +++ b/RealtimeSync/xmlProcessing.cpp @@ -0,0 +1,86 @@ +#include "xmlProcessing.h" +#include <wx/filefn.h> +#include <wx/intl.h> + + +class RtsXmlParser : public xmlAccess::XmlParser +{ +public: + RtsXmlParser(const TiXmlElement* rootElement) : xmlAccess::XmlParser(rootElement) {} + + void readXmlRealConfig(xmlAccess::XmlRealConfig& outputCfg); +}; + + + +void readXmlRealConfig(const TiXmlDocument& doc, xmlAccess::XmlRealConfig& outputCfg); +bool writeXmRealSettings(const xmlAccess::XmlRealConfig& outputCfg, TiXmlDocument& doc); + + +void xmlAccess::readRealConfig(const wxString& filename, XmlRealConfig& config) +{ + //load XML + if (!wxFileExists(filename)) + throw XmlError(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\"")); + + TiXmlDocument doc; + if (!loadXmlDocument(filename, XML_REAL_CONFIG, doc)) + throw XmlError(wxString(_("Error reading file:")) + wxT(" \"") + filename + wxT("\"")); + + RtsXmlParser parser(doc.RootElement()); + parser.readXmlRealConfig(config); //read GUI layout configuration + + if (parser.errorsOccured()) + throw XmlError(wxString(_("Error parsing configuration file:")) + wxT(" \"") + filename + wxT("\"\n\n") + + parser.getErrorMessageFormatted(), XmlError::WARNING); +} + + +void xmlAccess::writeRealConfig(const XmlRealConfig& outputCfg, const wxString& filename) +{ + TiXmlDocument doc; + getDefaultXmlDocument(XML_REAL_CONFIG, doc); + + //populate and write XML tree + if ( !writeXmRealSettings(outputCfg, doc) || //add GUI layout configuration settings + !saveXmlDocument(filename, doc)) //save XML + throw XmlError(wxString(_("Error writing file:")) + wxT(" \"") + filename + wxT("\"")); + return; +} + +//-------------------------------------------------------------------------------- + + +void RtsXmlParser::readXmlRealConfig(xmlAccess::XmlRealConfig& outputCfg) +{ + //read directories for monitoring + const TiXmlElement* directoriesToWatch = TiXmlHandleConst(root).FirstChild("Directories").ToElement(); + + readXmlElementLogging("Folder", directoriesToWatch, outputCfg.directories); + + //commandline to execute + readXmlElementLogging("Commandline", root, outputCfg.commandline); + + //delay + readXmlElementLogging("Delay", root, outputCfg.delay); +} + + +bool writeXmRealSettings(const xmlAccess::XmlRealConfig& outputCfg, TiXmlDocument& doc) +{ + TiXmlElement* root = doc.RootElement(); + if (!root) return false; + + //directories to monitor + TiXmlElement* directoriesToWatch = new TiXmlElement("Directories"); + root->LinkEndChild(directoriesToWatch); + xmlAccess::addXmlElement("Folder", outputCfg.directories, directoriesToWatch); + + //commandline to execute + xmlAccess::addXmlElement("Commandline", outputCfg.commandline, root); + + //delay + xmlAccess::addXmlElement("Delay", outputCfg.delay, root); + + return true; +} diff --git a/RealtimeSync/xmlProcessing.h b/RealtimeSync/xmlProcessing.h new file mode 100644 index 00000000..90842abf --- /dev/null +++ b/RealtimeSync/xmlProcessing.h @@ -0,0 +1,23 @@ +#ifndef XMLPROCESSING_H_INCLUDED +#define XMLPROCESSING_H_INCLUDED + +#include <vector> +#include <wx/string.h> +#include "../shared/xmlBase.h" + + +namespace xmlAccess +{ + struct XmlRealConfig + { + XmlRealConfig() : delay(5) {} + std::vector<wxString> directories; + wxString commandline; + unsigned int delay; + }; + + void readRealConfig(const wxString& filename, XmlRealConfig& config); //throw (xmlAccess::XmlError); + void writeRealConfig(const XmlRealConfig& outputCfg, const wxString& filename); //throw (xmlAccess::XmlError); +} + +#endif // XMLPROCESSING_H_INCLUDED diff --git a/algorithm.cpp b/algorithm.cpp index 4ce2c911..40636e83 100644 --- a/algorithm.cpp +++ b/algorithm.cpp @@ -1,21 +1,21 @@ #include "algorithm.h" #include <wx/intl.h> -#include <cmath> #include <wx/log.h> #include "library/resources.h" -#include "library/globalFunctions.h" -#include "library/statusHandler.h" -#include "library/fileHandling.h" +#include "shared/globalFunctions.h" +#include "shared/systemFunctions.h" +#include "shared/fileHandling.h" #include <wx/msgdlg.h> +#include <wx/textctrl.h> +#include <wx/combobox.h> +#include <wx/filepicker.h> +#include "shared/localization.h" #ifdef FFS_WIN #include <wx/msw/wrapwin.h> //includes "windows.h" - -#elif defined FFS_LINUX -#include <string.h> -#include <errno.h> #endif + using namespace FreeFileSync; @@ -36,96 +36,89 @@ wxString FreeFileSync::formatFilesizeToShortString(const double filesize) if (filesize < 0) return _("Error"); + if (filesize <= 999) + return wxString::Format(wxT("%i"), static_cast<int>(filesize)) + _(" Byte"); //no decimal places in case of bytes + double nrOfBytes = filesize; - bool unitByte = true; - wxString unit = _(" Byte"); + nrOfBytes /= 1024; + wxString unit = _(" kB"); if (nrOfBytes > 999) { - unitByte = false; nrOfBytes /= 1024; - unit = _(" kB"); + unit = _(" MB"); if (nrOfBytes > 999) { nrOfBytes /= 1024; - unit = _(" MB"); + unit = _(" GB"); if (nrOfBytes > 999) { nrOfBytes /= 1024; - unit = _(" GB"); + unit = _(" TB"); if (nrOfBytes > 999) { nrOfBytes /= 1024; - unit = _(" TB"); - if (nrOfBytes > 999) - { - nrOfBytes /= 1024; - unit = _(" PB"); - } + unit = _(" PB"); } } } } - wxString temp; - if (unitByte) //no decimal places in case of bytes + //print just three significant digits: 0,01 | 0,11 | 1,11 | 11,1 | 111 + + const unsigned int leadDigitCount = globalFunctions::getDigitCount(static_cast<unsigned int>(nrOfBytes)); //number of digits before decimal point + if (leadDigitCount == 0 || leadDigitCount > 3) + return _("Error"); + + if (leadDigitCount == 3) + return wxString::Format(wxT("%i"), static_cast<int>(nrOfBytes)) + unit; + else if (leadDigitCount == 2) { - double integer = 0; - modf(nrOfBytes, &integer); //get integer part of nrOfBytes - temp = globalFunctions::numberToWxString(int(integer)); + wxString output = wxString::Format(wxT("%i"), static_cast<int>(nrOfBytes * 10)); + output.insert(leadDigitCount, FreeFileSync::DECIMAL_POINT); + return output + unit; } - else + else //leadDigitCount == 1 { - nrOfBytes*= 100; //we want up to two decimal places - double integer = 0; - modf(nrOfBytes, &integer); //get integer part of nrOfBytes + wxString output = wxString::Format(wxT("%03i"), static_cast<int>(nrOfBytes * 100)); + output.insert(leadDigitCount, FreeFileSync::DECIMAL_POINT); + return output + unit; + } - temp = globalFunctions::numberToWxString(int(integer)); + //return wxString::Format(wxT("%.*f"), 3 - leadDigitCount, nrOfBytes) + unit; +} - switch (temp.length()) - { - case 0: - return _("Error"); - case 1: - temp = wxString(wxT("0")) + FreeFileSync::DECIMAL_POINT + wxT("0") + temp; - break; //0,01 - case 2: - temp = wxString(wxT("0")) + FreeFileSync::DECIMAL_POINT + temp; - break; //0,11 - case 3: - temp.insert(1, FreeFileSync::DECIMAL_POINT); - break; //1,11 - case 4: - temp = temp.substr(0, 3); - temp.insert(2, FreeFileSync::DECIMAL_POINT); - break; //11,1 - case 5: - temp = temp.substr(0, 3); - break; //111 - default: - return _("Error"); - } - } - return (temp + unit); + +wxString FreeFileSync::includeNumberSeparator(const wxString& number) +{ + wxString output(number); + for (int i = output.size() - 3; i > 0; i -= 3) + output.insert(i, FreeFileSync::THOUSANDS_SEPARATOR); + + return output; } -Zstring FreeFileSync::getFormattedDirectoryName(const Zstring& dirname) -{ //Formatting is needed since functions expect the directory to end with '\' to be able to split the relative names. - //Also improves usability. +template <class T> +void setDirectoryNameImpl(const wxString& dirname, T* txtCtrl, wxDirPickerCtrl* dirPicker) +{ + txtCtrl->SetValue(dirname); + const Zstring leftDirFormatted = FreeFileSync::getFormattedDirectoryName(dirname.c_str()); + if (wxDirExists(leftDirFormatted.c_str())) + dirPicker->SetPath(leftDirFormatted.c_str()); +} - Zstring dirnameTmp = dirname; - dirnameTmp.Trim(true); //remove whitespace characters from right - dirnameTmp.Trim(false); //remove whitespace characters from left - if (dirnameTmp.empty()) //an empty string is interpreted as "\"; this is not desired - return Zstring(); +void FreeFileSync::setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker) +{ + setDirectoryNameImpl(dirname, txtCtrl, dirPicker); +} - if (!endsWithPathSeparator(dirnameTmp)) - dirnameTmp += FreeFileSync::FILE_NAME_SEPARATOR; - //don't do directory formatting with wxFileName, as it doesn't respect //?/ - prefix - return dirnameTmp; +void FreeFileSync::setDirectoryName(const wxString& dirname, wxComboBox* txtCtrl, wxDirPickerCtrl* dirPicker) +{ + txtCtrl->SetSelection(wxNOT_FOUND); + setDirectoryNameImpl(dirname, txtCtrl, dirPicker); } @@ -162,7 +155,6 @@ void FreeFileSync::redetermineSyncDirection(const SyncConfiguration& config, Fol { //do not handle i->selectedForSynchronization in this method! handled in synchronizeFile(), synchronizeFolder()! - for (FolderComparison::iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) { FileComparison& fileCmp = j->fileCmp; @@ -171,31 +163,31 @@ void FreeFileSync::redetermineSyncDirection(const SyncConfiguration& config, Fol switch (i->cmpResult) { case FILE_LEFT_SIDE_ONLY: - i->direction = config.exLeftSideOnly; + i->syncDir = convertToSyncDirection(config.exLeftSideOnly); break; case FILE_RIGHT_SIDE_ONLY: - i->direction = config.exRightSideOnly; + i->syncDir = convertToSyncDirection(config.exRightSideOnly); break; case FILE_RIGHT_NEWER: - i->direction = config.rightNewer; + i->syncDir = convertToSyncDirection(config.rightNewer); break; case FILE_LEFT_NEWER: - i->direction = config.leftNewer; + i->syncDir = convertToSyncDirection(config.leftNewer); break; case FILE_DIFFERENT: - i->direction = config.different; + i->syncDir = convertToSyncDirection(config.different); break; case FILE_CONFLICT: - i->direction = SYNC_UNRESOLVED_CONFLICT; + i->syncDir = SYNC_UNRESOLVED_CONFLICT; break; case FILE_EQUAL: - i->direction = SYNC_DIR_NONE; + i->syncDir = SYNC_DIR_NONE; } } } @@ -216,7 +208,7 @@ void FreeFileSync::addSubElements(const FileComparison& fileCmp, const FileCompa else return; - relevantDirectory += FreeFileSync::FILE_NAME_SEPARATOR; //FILE_NAME_SEPARATOR needed to exclude subfile/dirs only + relevantDirectory += globalFunctions::FILE_NAME_SEPARATOR; //FILE_NAME_SEPARATOR needed to exclude subfile/dirs only for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) { @@ -249,11 +241,14 @@ struct SortedFileName //assemble message containing all files to be deleted -wxString FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, +std::pair<wxString, int> FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, const std::set<int>& rowsToDeleteOnLeft, const std::set<int>& rowsToDeleteOnRight, const bool deleteOnBothSides) { + wxString filesToDelete; + int totalDelCount = 0; + if (deleteOnBothSides) { //mix selected rows from left and right @@ -261,21 +256,26 @@ wxString FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, for (std::set<int>::const_iterator i = rowsToDeleteOnRight.begin(); i != rowsToDeleteOnRight.end(); ++i) rowsToDelete.insert(*i); - wxString filesToDelete; for (std::set<int>::const_iterator i = rowsToDelete.begin(); i != rowsToDelete.end(); ++i) { const FileCompareLine& currentCmpLine = fileCmp[*i]; if (currentCmpLine.fileDescrLeft.objType != FileDescrLine::TYPE_NOTHING) + { filesToDelete += (currentCmpLine.fileDescrLeft.fullName + wxT("\n")).c_str(); + ++totalDelCount; + } if (currentCmpLine.fileDescrRight.objType != FileDescrLine::TYPE_NOTHING) + { filesToDelete += (currentCmpLine.fileDescrRight.fullName + wxT("\n")).c_str(); + ++totalDelCount; + } filesToDelete+= wxT("\n"); } - return filesToDelete; + return std::pair<wxString, int>(filesToDelete, totalDelCount); } else //delete selected files only { @@ -291,6 +291,7 @@ wxString FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, newEntry.position = *i * 10; newEntry.name = currentCmpLine.fileDescrLeft.fullName; outputTable.insert(newEntry); + ++totalDelCount; } } @@ -303,14 +304,14 @@ wxString FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, newEntry.position = *i * 10 + 1; //ensure files on left are before files on right for the same row number newEntry.name = currentCmpLine.fileDescrRight.fullName; outputTable.insert(newEntry); + ++totalDelCount; } } - wxString filesToDelete; for (std::set<SortedFileName>::const_iterator i = outputTable.begin(); i != outputTable.end(); ++i) filesToDelete += (i->name + wxT("\n")).c_str(); - return filesToDelete; + return std::pair<wxString, int>(filesToDelete, totalDelCount); } } @@ -318,7 +319,7 @@ wxString FreeFileSync::deleteFromGridAndHDPreview(const FileComparison& fileCmp, class RemoveAtExit //this class ensures, that the result of the method below is ALWAYS written on exit, even if exceptions are thrown! { public: - RemoveAtExit(FileComparison& fileCmp) : + RemoveAtExit(FreeFileSync::FileComparison& fileCmp) : gridToWrite(fileCmp) {} ~RemoveAtExit() @@ -332,7 +333,7 @@ public: } private: - FileComparison& gridToWrite; + FreeFileSync::FileComparison& gridToWrite; std::set<int> rowsProcessed; }; @@ -369,12 +370,12 @@ void updateCmpLineAfterDeletion(const int rowNr, const SyncConfiguration& syncCo if (leftSide) //again evaluated at compile time { currentLine.cmpResult = FILE_RIGHT_SIDE_ONLY; - currentLine.direction = syncConfig.exRightSideOnly; + currentLine.syncDir = convertToSyncDirection(syncConfig.exRightSideOnly); } else { currentLine.cmpResult = FILE_LEFT_SIDE_ONLY; - currentLine.direction = syncConfig.exLeftSideOnly; + currentLine.syncDir = convertToSyncDirection(syncConfig.exLeftSideOnly); } } } @@ -387,7 +388,7 @@ void deleteFromGridAndHDOneSide(FileComparison& fileCmp, const bool useRecycleBin, RemoveAtExit& markForRemoval, const SyncConfiguration& syncConfig, - ErrorHandler* errorHandler) + DeleteFilesHandler* statusHandler) { for (std::set<int>::const_iterator i = rowsToDeleteOneSide.begin(); i != rowsToDeleteOneSide.end(); ++i) { @@ -403,10 +404,12 @@ void deleteFromGridAndHDOneSide(FileComparison& fileCmp, case FileDescrLine::TYPE_FILE: FreeFileSync::removeFile(fileDescr->fullName, useRecycleBin); updateCmpLineAfterDeletion<leftSide>(*i, syncConfig, fileCmp, markForRemoval); //remove entries from fileCmp + statusHandler->deletionSuccessful(); //notify successful file/folder deletion break; case FileDescrLine::TYPE_DIRECTORY: FreeFileSync::removeDirectory(fileDescr->fullName, useRecycleBin); updateCmpLineAfterDeletion<leftSide>(*i, syncConfig, fileCmp, markForRemoval); //remove entries from fileCmp + statusHandler->deletionSuccessful(); //notify successful file/folder deletion break; case FileDescrLine::TYPE_NOTHING: break; @@ -416,12 +419,12 @@ void deleteFromGridAndHDOneSide(FileComparison& fileCmp, } catch (const FileError& error) { - ErrorHandler::Response rv = errorHandler->reportError(error.show()); + DeleteFilesHandler::Response rv = statusHandler->reportError(error.show()); - if (rv == ErrorHandler::IGNORE_ERROR) + if (rv == DeleteFilesHandler::IGNORE_ERROR) break; - else if (rv == ErrorHandler::RETRY) + else if (rv == DeleteFilesHandler::RETRY) ; //continue in loop else assert (false); @@ -437,7 +440,7 @@ void FreeFileSync::deleteFromGridAndHD(FileComparison& fileCmp, const bool deleteOnBothSides, const bool useRecycleBin, const SyncConfiguration& syncConfig, - ErrorHandler* errorHandler) + DeleteFilesHandler* statusHandler) { //remove deleted rows from fileCmp (AFTER all rows to be deleted are known: consider row references! RemoveAtExit markForRemoval(fileCmp); //ensure that fileCmp is always written to, even if method is exitted via exceptions @@ -454,14 +457,14 @@ void FreeFileSync::deleteFromGridAndHD(FileComparison& fileCmp, useRecycleBin, markForRemoval, syncConfig, - errorHandler); + statusHandler); deleteFromGridAndHDOneSide<false>(fileCmp, rowsToDeleteBothSides, useRecycleBin, markForRemoval, syncConfig, - errorHandler); + statusHandler); } else { @@ -470,14 +473,14 @@ void FreeFileSync::deleteFromGridAndHD(FileComparison& fileCmp, useRecycleBin, markForRemoval, syncConfig, - errorHandler); + statusHandler); deleteFromGridAndHDOneSide<false>(fileCmp, rowsToDeleteOnRight, useRecycleBin, markForRemoval, syncConfig, - errorHandler); + statusHandler); } } //############################################################################################################ @@ -527,7 +530,7 @@ wxString FreeFileSync::utcTimeToLocalString(const wxLongLong& utcTime, const Zst FILETIME localFileTime; - if (::FileTimeToLocalFileTime( //convert to local time + if (::FileTimeToLocalFileTime( //convert to local time &lastWriteTimeUtc, //pointer to UTC file time to convert &localFileTime //pointer to converted file time ) == 0) @@ -581,32 +584,6 @@ wxString FreeFileSync::utcTimeToLocalString(const wxLongLong& utcTime, const Zst } -#ifdef FFS_WIN -Zstring FreeFileSync::getLastErrorFormatted(const unsigned long lastError) //try to get additional Windows error information -{ - //determine error code if none was specified - const unsigned long lastErrorCode = lastError == 0 ? GetLastError() : lastError; - - Zstring output = Zstring(wxT("Windows Error Code ")) + wxString::Format(wxT("%u"), lastErrorCode).c_str(); - - WCHAR buffer[1001]; - if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, lastErrorCode, 0, buffer, 1001, NULL) != 0) - output += Zstring(wxT(": ")) + buffer; - return output; -} - -#elif defined FFS_LINUX -Zstring FreeFileSync::getLastErrorFormatted(const int lastError) //try to get additional Linux error information -{ - //determine error code if none was specified - const int lastErrorCode = lastError == 0 ? errno : lastError; - - Zstring output = Zstring(wxT("Linux Error Code ")) + wxString::Format(wxT("%i"), lastErrorCode).c_str(); - output += Zstring(wxT(": ")) + strerror(lastErrorCode); - return output; -} -#endif - /*Statistical theory: detect daylight saving time (DST) switch by comparing files that exist on both sides (and have same filesizes). If there are "enough" that have a shift by +-1h then assert that DST switch occured. What is "enough" =: N? N should be large enough AND small enough that the following two errors remain small: diff --git a/algorithm.h b/algorithm.h index 13d3d0fc..a61859bf 100644 --- a/algorithm.h +++ b/algorithm.h @@ -2,9 +2,11 @@ #define ALGORITHM_H_INCLUDED #include "structures.h" -#include "library/resources.h" class ErrorHandler; +class wxComboBox; +class wxTextCtrl; +class wxDirPickerCtrl; namespace FreeFileSync @@ -13,9 +15,10 @@ namespace FreeFileSync wxString formatFilesizeToShortString(const wxULongLong& filesize); wxString formatFilesizeToShortString(const double filesize); - Zstring getFormattedDirectoryName(const Zstring& dirname); + wxString includeNumberSeparator(const wxString& number); - bool endsWithPathSeparator(const Zstring& name); + void setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker); + void setDirectoryName(const wxString& dirname, wxComboBox* txtCtrl, wxDirPickerCtrl* dirPicker); void swapGrids(const SyncConfiguration& config, FolderComparison& folderCmp); @@ -24,18 +27,35 @@ namespace FreeFileSync void addSubElements(const FileComparison& fileCmp, const FileCompareLine& relevantRow, std::set<int>& subElements); //manual deletion of files on main grid: runs at individual directory pair level - wxString deleteFromGridAndHDPreview(const FileComparison& fileCmp, - const std::set<int>& rowsToDeleteOnLeft, - const std::set<int>& rowsToDeleteOnRight, - const bool deleteOnBothSides); + std::pair<wxString, int> deleteFromGridAndHDPreview(const FileComparison& fileCmp, //returns wxString with elements to be deleted and total count + const std::set<int>& rowsToDeleteOnLeft, + const std::set<int>& rowsToDeleteOnRight, + const bool deleteOnBothSides); + class DeleteFilesHandler + { + public: + DeleteFilesHandler() {} + virtual ~DeleteFilesHandler() {} + + enum Response + { + IGNORE_ERROR = 10, + RETRY + }; + virtual Response reportError(const wxString& errorMessage) = 0; + + //virtual void totalFilesToDelete(int objectsTotal) = 0; //informs about the total number of files to be deleted + virtual void deletionSuccessful() = 0; //called for each file/folder that has been deleted + + }; void deleteFromGridAndHD(FileComparison& fileCmp, const std::set<int>& rowsToDeleteOnLeft, const std::set<int>& rowsToDeleteOnRight, const bool deleteOnBothSides, const bool useRecycleBin, const SyncConfiguration& syncConfig, - ErrorHandler* errorHandler); + DeleteFilesHandler* statusHandler); wxString utcTimeToLocalString(const wxLongLong& utcTime, const Zstring& filename); @@ -51,22 +71,6 @@ namespace FreeFileSync else return last; } - -#ifdef FFS_WIN - Zstring getLastErrorFormatted(const unsigned long lastError = 0); //try to get additional Windows error information -#elif defined FFS_LINUX - Zstring getLastErrorFormatted(const int lastError = 0); //try to get additional Linux error information -#endif } - -inline -bool FreeFileSync::endsWithPathSeparator(const Zstring& name) -{ - const size_t len = name.length(); - return len && (name[len - 1] == FreeFileSync::FILE_NAME_SEPARATOR); -} - - - #endif // ALGORITHM_H_INCLUDED diff --git a/comparison.cpp b/comparison.cpp index 3305a510..843990a8 100644 --- a/comparison.cpp +++ b/comparison.cpp @@ -1,7 +1,7 @@ #include "comparison.h" -#include "library/globalFunctions.h" +#include "shared/globalFunctions.h" #include <wx/intl.h> -#include "library/globalFunctions.h" +#include <wx/timer.h> #include <wx/ffile.h> #include <wx/msgdlg.h> #include <wx/log.h> @@ -9,15 +9,15 @@ #include <wx/thread.h> #include <memory> #include "library/statusHandler.h" -#include "library/fileHandling.h" -#include "synchronization.h" +#include "shared/fileHandling.h" +#include "shared/systemFunctions.h" +#include "shared/fileTraverser.h" #include "library/filter.h" -#include "library/processXml.h" using namespace FreeFileSync; -class GetAllFilesFull : public FullDetailFileTraverser +class GetAllFilesFull : public FreeFileSync::TraverseCallback { public: GetAllFilesFull(DirectoryDescrType& output, const Zstring& dirThatIsSearched, const FilterProcess* filter, StatusHandler* handler) : @@ -39,34 +39,34 @@ public: } - wxDirTraverseResult OnFile(const Zstring& fullFileName, const FileInfo& details) //virtual impl. + virtual ReturnValue onFile(const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) { //apply filter before processing (use relative name!) if (filterInstance) - if ( !filterInstance->matchesFileFilterIncl(fullFileName.c_str() + prefixLength) || - filterInstance->matchesFileFilterExcl(fullFileName.c_str() + prefixLength)) + if ( !filterInstance->matchesFileFilterIncl(fullName.c_str() + prefixLength) || + filterInstance->matchesFileFilterExcl(fullName.c_str() + prefixLength)) { statusHandler->requestUiRefresh(); - return wxDIR_CONTINUE; + return TRAVERSING_CONTINUE; } FileDescrLine fileDescr; - fileDescr.fullName = fullFileName; - fileDescr.relativeName = fullFileName.zsubstr(prefixLength); + fileDescr.fullName = fullName; + fileDescr.relativeName = fullName.zsubstr(prefixLength); fileDescr.lastWriteTimeRaw = details.lastWriteTimeRaw; fileDescr.fileSize = details.fileSize; fileDescr.objType = FileDescrLine::TYPE_FILE; m_output.push_back(fileDescr); - //assemble status message (performance optimized) = textScanning + wxT("\"") + fullFileName + wxT("\"") + //assemble status message (performance optimized) = textScanning + wxT("\"") + fullName + wxT("\"") const unsigned int statusTextMaxLen = 2000; wxChar statusText[statusTextMaxLen]; wxChar* position = statusText; - if (textScanning.length() + fullFileName.length() + 2 < statusTextMaxLen) //leave room for 0 terminating char! + if (textScanning.length() + fullName.length() + 2 < statusTextMaxLen) //leave room for 0 terminating char! { writeText(textScanning.c_str(), textScanning.length(), position); writeText(wxT("\""), 1, position); - writeText(fullFileName.c_str(), fullFileName.length(), position); + writeText(fullName.c_str(), fullName.length(), position); writeText(wxT("\""), 1, position); } *position = 0; @@ -78,52 +78,52 @@ public: //trigger display refresh statusHandler->requestUiRefresh(); - return wxDIR_CONTINUE; + return TRAVERSING_CONTINUE; } - wxDirTraverseResult OnDir(const Zstring& fullDirName) //virtual impl. + virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) { //apply filter before processing (use relative name!) if (filterInstance) { - if (!filterInstance->matchesDirFilterIncl(fullDirName.c_str() + prefixLength)) + if (!filterInstance->matchesDirFilterIncl(fullName.c_str() + prefixLength)) { statusHandler->requestUiRefresh(); //if not included: CONTINUE traversing subdirs - return wxDIR_CONTINUE; + return ReturnValDir(ReturnValDir::Continue(), this); } - else if (filterInstance->matchesDirFilterExcl(fullDirName.c_str() + prefixLength)) + else if (filterInstance->matchesDirFilterExcl(fullName.c_str() + prefixLength)) { statusHandler->requestUiRefresh(); //if excluded: do NOT traverse subdirs - return wxDIR_IGNORE; + return ReturnValDir::Ignore(); } } #ifdef FFS_WIN - if ( fullDirName.EndsWith(wxT("\\RECYCLER")) || - fullDirName.EndsWith(wxT("\\System Volume Information"))) + if ( fullName.EndsWith(wxT("\\RECYCLER")) || + fullName.EndsWith(wxT("\\System Volume Information"))) { statusHandler->requestUiRefresh(); - return wxDIR_IGNORE; + return ReturnValDir::Ignore(); } #endif // FFS_WIN FileDescrLine fileDescr; - fileDescr.fullName = fullDirName; - fileDescr.relativeName = fullDirName.zsubstr(prefixLength); + fileDescr.fullName = fullName; + fileDescr.relativeName = fullName.zsubstr(prefixLength); fileDescr.lastWriteTimeRaw = 0; //irrelevant for directories fileDescr.fileSize = 0; //currently used by getBytesToTransfer fileDescr.objType = FileDescrLine::TYPE_DIRECTORY; m_output.push_back(fileDescr); - //assemble status message (performance optimized) = textScanning + wxT("\"") + fullDirName + wxT("\"") + //assemble status message (performance optimized) = textScanning + wxT("\"") + fullName + wxT("\"") const unsigned int statusTextMaxLen = 2000; wxChar statusText[statusTextMaxLen]; wxChar* position = statusText; - if (textScanning.length() + fullDirName.length() + 2 < statusTextMaxLen) //leave room for 0 terminating char! + if (textScanning.length() + fullName.length() + 2 < statusTextMaxLen) //leave room for 0 terminating char! { writeText(textScanning.c_str(), textScanning.length(), position); writeText(wxT("\""), 1, position); - writeText(fullDirName.c_str(), fullDirName.length(), position); + writeText(fullName.c_str(), fullName.length(), position); writeText(wxT("\""), 1, position); } *position = 0; @@ -135,27 +135,24 @@ public: //trigger display refresh statusHandler->requestUiRefresh(); - return wxDIR_CONTINUE; + return ReturnValDir(ReturnValDir::Continue(), this); } - wxDirTraverseResult OnError(const Zstring& errorText) //virtual impl. + virtual ReturnValue onError(const wxString& errorText) { while (true) { - ErrorHandler::Response rv = statusHandler->reportError(errorText); - if (rv == ErrorHandler::IGNORE_ERROR) - return wxDIR_CONTINUE; - else if (rv == ErrorHandler::RETRY) - ; //I have to admit "retry" is a bit of a fake here... at least the user has opportunity to abort! - else + switch (statusHandler->reportError(errorText)) { - assert (false); - return wxDIR_CONTINUE; + case ErrorHandler::IGNORE_ERROR: + return TRAVERSING_CONTINUE; + case ErrorHandler::RETRY: + break; //I have to admit "retry" is a bit of a fake here... at least the user has opportunity to abort! } } - return wxDIR_CONTINUE; + return TRAVERSING_CONTINUE; } private: @@ -216,9 +213,12 @@ public: bufferEntry.directoryDesc = new DirectoryDescrType; buffer.insert(bufferEntry); //exception safety: insert into buffer right after creation! - //get all files and folders from directoryFormatted (and subdirectories) - GetAllFilesFull traverser(*bufferEntry.directoryDesc, directoryFormatted, filterInstance, m_statusUpdater); //exceptions may be thrown! - traverseInDetail(directoryFormatted, m_traverseDirectorySymlinks, &traverser); + if (FreeFileSync::dirExists(directoryFormatted)) //folder existence already checked in startCompareProcess(): do not treat as error when arriving here! + { + //get all files and folders from directoryFormatted (and subdirectories) + GetAllFilesFull traverser(*bufferEntry.directoryDesc, directoryFormatted, filterInstance, m_statusUpdater); //exceptions may be thrown! + traverseFolder(directoryFormatted, m_traverseDirectorySymlinks, &traverser); + } return bufferEntry.directoryDesc; } @@ -233,9 +233,10 @@ private: }; -bool foldersAreValidForComparison(const std::vector<FolderPair>& folderPairs, wxString& errorMessage) +void foldersAreValidForComparison(const std::vector<FolderPair>& folderPairs, StatusHandler* statusUpdater) { - errorMessage.Clear(); + bool checkEmptyDirnameActive = true; //check for empty dirs just once + const wxString additionalInfo = _("You can ignore the error to consider not existing directories as empty."); for (std::vector<FolderPair>::const_iterator i = folderPairs.begin(); i != folderPairs.end(); ++i) { @@ -245,38 +246,71 @@ bool foldersAreValidForComparison(const std::vector<FolderPair>& folderPairs, wx //check if folder name is empty if (leftFolderName.empty() || rightFolderName.empty()) { - errorMessage = _("Please fill all empty directory fields."); - return false; + if (checkEmptyDirnameActive) + { + checkEmptyDirnameActive = false; + while (true) + { + const ErrorHandler::Response rv = statusUpdater->reportError(wxString(_("Please fill all empty directory fields.")) + wxT("\n\n") + + + wxT("(") + additionalInfo + wxT(")")); + if (rv == ErrorHandler::IGNORE_ERROR) + break; + else if (rv == ErrorHandler::RETRY) + ; //continue with loop + else + assert (false); + } + } } - //check if folder exists - if (!wxDirExists(leftFolderName)) - { - errorMessage = wxString(_("Directory does not exist:")) + wxT(" \"") + leftFolderName + wxT("\""); - return false; - } - if (!wxDirExists(rightFolderName)) - { - errorMessage = wxString(_("Directory does not exist:")) + wxT(" \"") + rightFolderName + wxT("\""); - return false; - } + //check if folders exist + if (!leftFolderName.empty()) + while (!FreeFileSync::dirExists(leftFolderName)) + { + ErrorHandler::Response rv = statusUpdater->reportError(wxString(_("Directory does not exist:")) + wxT("\n") + + wxT("\"") + leftFolderName + wxT("\"") + wxT("\n\n") + + FreeFileSync::getLastErrorFormatted() + wxT(" ") + additionalInfo); + if (rv == ErrorHandler::IGNORE_ERROR) + break; + else if (rv == ErrorHandler::RETRY) + ; //continue with loop + else + assert (false); + } + + if (!rightFolderName.empty()) + while (!FreeFileSync::dirExists(rightFolderName)) + { + ErrorHandler::Response rv = statusUpdater->reportError(wxString(_("Directory does not exist:")) + wxT("\n") + + wxT("\"") + rightFolderName + wxT("\"") + wxT("\n\n") + + FreeFileSync::getLastErrorFormatted() + wxT(" ") + additionalInfo); + if (rv == ErrorHandler::IGNORE_ERROR) + break; + else if (rv == ErrorHandler::RETRY) + ; //continue with loop + else + assert (false); + } } - return true; } bool dependencyExists(const std::vector<Zstring>& folders, const Zstring& newFolder, wxString& warningMessage) { - warningMessage.Clear(); + if (!newFolder.empty()) //empty folders names might be accepted by user + { + warningMessage.Clear(); - for (std::vector<Zstring>::const_iterator i = folders.begin(); i != folders.end(); ++i) - if (newFolder.StartsWith(*i) || i->StartsWith(newFolder)) - { - warningMessage = wxString(_("Directories are dependent! Be careful when setting up synchronization rules:")) + wxT("\n") + - wxT("\"") + *i + wxT("\",\n") + - wxT("\"") + newFolder + wxT("\""); - return true; - } + for (std::vector<Zstring>::const_iterator i = folders.begin(); i != folders.end(); ++i) + if (!i->empty()) //empty folders names might be accepted by user + if (newFolder.StartsWith(*i) || i->StartsWith(newFolder)) + { + warningMessage = wxString(_("Directories are dependent! Be careful when setting up synchronization rules:")) + wxT("\n") + + wxT("\"") + i->c_str() + wxT("\",\n") + + wxT("\"") + newFolder.c_str() + wxT("\""); + return true; + } + } return false; } @@ -346,49 +380,35 @@ struct MemoryAllocator }; -//callback functionality -struct CallBackData +//callback functionality for status updates while comparing +class CompareCallback { - StatusHandler* handler; - wxLongLong bytesComparedLast; +public: + virtual ~CompareCallback() {} + virtual void updateCompareStatus(const wxLongLong& totalBytesTransferred) = 0; }; -//callback function for status updates whily comparing -typedef void (*CompareCallback)(const wxLongLong&, void*); - - -void compareContentCallback(const wxLongLong& totalBytesTransferred, void* data) -{ //called every 512 kB - CallBackData* sharedData = static_cast<CallBackData*>(data); - - //inform about the (differential) processed amount of data - sharedData->handler->updateProcessedData(0, totalBytesTransferred - sharedData->bytesComparedLast); - sharedData->bytesComparedLast = totalBytesTransferred; - sharedData->handler->requestUiRefresh(); //exceptions may be thrown here! -} - - -bool filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, CompareCallback callback, void* data) +bool filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, CompareCallback* callback) { static MemoryAllocator memory; wxFFile file1(filename1.c_str(), wxT("rb")); if (!file1.IsOpened()) - throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename1 + wxT("\"")); + throw FileError(wxString(_("Error reading file:")) + wxT(" \"") + filename1.c_str() + wxT("\"")); wxFFile file2(filename2.c_str(), wxT("rb")); if (!file2.IsOpened()) //NO cleanup necessary for (wxFFile) file1 - throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename2 + wxT("\"")); + throw FileError(wxString(_("Error reading file:")) + wxT(" \"") + filename2.c_str() + wxT("\"")); wxLongLong bytesCompared; do { const size_t length1 = file1.Read(memory.buffer1, MemoryAllocator::bufferSize); - if (file1.Error()) throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename1 + wxT("\"")); + if (file1.Error()) throw FileError(wxString(_("Error reading file:")) + wxT(" \"") + filename1.c_str() + wxT("\"")); const size_t length2 = file2.Read(memory.buffer2, MemoryAllocator::bufferSize); - if (file2.Error()) throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename2 + wxT("\"")); + if (file2.Error()) throw FileError(wxString(_("Error reading file:")) + wxT(" \"") + filename2.c_str() + wxT("\"")); if (length1 != length2 || memcmp(memory.buffer1, memory.buffer2, length1) != 0) return false; @@ -396,7 +416,7 @@ bool filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, Co bytesCompared += length1 * 2; //send progress updates - callback(bytesCompared, data); + callback->updateCompareStatus(bytesCompared); } while (!file1.Eof()); @@ -407,27 +427,51 @@ bool filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, Co } +//callback implementation +class CmpCallbackImpl : public CompareCallback +{ +public: + CmpCallbackImpl(StatusHandler* handler, wxLongLong& bytesComparedLast) : + m_handler(handler), + m_bytesComparedLast(bytesComparedLast) {} + + virtual void updateCompareStatus(const wxLongLong& totalBytesTransferred) + { //called every 512 kB + + //inform about the (differential) processed amount of data + m_handler->updateProcessedData(0, totalBytesTransferred - m_bytesComparedLast); + m_bytesComparedLast = totalBytesTransferred; + + m_handler->requestUiRefresh(); //exceptions may be thrown here! + } + +private: + StatusHandler* m_handler; + wxLongLong& m_bytesComparedLast; +}; + + bool filesHaveSameContentUpdating(const Zstring& filename1, const Zstring& filename2, const wxULongLong& totalBytesToCmp, StatusHandler* handler) { - CallBackData sharedData; - sharedData.handler = handler; -//data.bytesTransferredLast = //amount of bytes that have been compared and communicated to status handler + wxLongLong bytesComparedLast; //amount of bytes that have been compared and communicated to status handler + + CmpCallbackImpl callback(handler, bytesComparedLast); bool sameContent = true; try { - sameContent = filesHaveSameContent(filename1, filename2, compareContentCallback, &sharedData); + sameContent = filesHaveSameContent(filename1, filename2, &callback); } catch (...) { //error situation: undo communication of processed amount of data - handler->updateProcessedData(0, sharedData.bytesComparedLast * -1); + handler->updateProcessedData(0, bytesComparedLast * -1); throw; } //inform about the (remaining) processed amount of data - handler->updateProcessedData(0, globalFunctions::convertToSigned(totalBytesToCmp) - sharedData.bytesComparedLast); + handler->updateProcessedData(0, globalFunctions::convertToSigned(totalBytesToCmp) - bytesComparedLast); return sameContent; } @@ -502,7 +546,7 @@ void CompareProcess::startCompareProcess(const std::vector<FolderPair>& director //init process: keep at beginning so that all gui elements are initialized properly statusUpdater->initNewProcess(-1, 0, StatusHandler::PROCESS_SCANNING); //it's not known how many files will be scanned => -1 objects - //format directory pairs: ensure they end with FreeFileSync::FILE_NAME_SEPARATOR! + //format directory pairs: ensure they end with globalFunctions::FILE_NAME_SEPARATOR! std::vector<FolderPair> directoryPairsFormatted; for (std::vector<FolderPair>::const_iterator i = directoryPairs.begin(); i != directoryPairs.end(); ++i) directoryPairsFormatted.push_back( @@ -512,24 +556,13 @@ void CompareProcess::startCompareProcess(const std::vector<FolderPair>& director //-------------------some basic checks:------------------------------------------ //check if folders are valid - wxString errorMessage; - if (!foldersAreValidForComparison(directoryPairsFormatted, errorMessage)) - { - statusUpdater->reportFatalError(errorMessage.c_str()); - return; //should be obsolete! - } + foldersAreValidForComparison(directoryPairsFormatted, statusUpdater); //check if folders have dependencies - if (m_warnings.warningDependentFolders) //test if check should be executed { wxString warningMessage; if (foldersHaveDependencies(directoryPairsFormatted, warningMessage)) - { - bool dontShowAgain = false; - statusUpdater->reportWarning(warningMessage.c_str(), - dontShowAgain); - m_warnings.warningDependentFolders = !dontShowAgain; - } + statusUpdater->reportWarning(warningMessage.c_str(), m_warnings.warningDependentFolders); } //-------------------end of basic checks------------------------------------------ @@ -568,57 +601,57 @@ void CompareProcess::startCompareProcess(const std::vector<FolderPair>& director } +//--------------------assemble conflict descriptions--------------------------- + //check for very old dates or dates in the future -void CompareProcess::issueWarningInvalidDate(const Zstring& fileNameFull, const wxLongLong& utcTime) +wxString getConflictInvalidDate(const Zstring& fileNameFull, const wxLongLong& utcTime) { - if (m_warnings.warningInvalidDate) - { - bool dontShowAgain = false; - Zstring msg = Zstring(_("File %x has an invalid date!")).Replace(wxT("%x"), Zstring(wxT("\"")) + fileNameFull + wxT("\"")); - msg += Zstring(wxT("\n\n")) + _("Date") + wxT(": ") + utcTimeToLocalString(utcTime, fileNameFull).c_str(); - statusUpdater->reportWarning(Zstring(_("Conflict detected:")) + wxT("\n") + msg, - dontShowAgain); - m_warnings.warningInvalidDate = !dontShowAgain; - } + wxString msg = _("File %x has an invalid date!"); + msg.Replace(wxT("%x"), wxString(wxT("\"")) + fileNameFull.c_str() + wxT("\"")); + msg += wxString(wxT("\n\n")) + _("Date") + wxT(": ") + utcTimeToLocalString(utcTime, fileNameFull); + return wxString(_("Conflict detected:")) + wxT("\n") + msg; } //check for changed files with same modification date -void CompareProcess::issueWarningSameDateDiffSize(const FileCompareLine& cmpLine) +wxString getConflictSameDateDiffSize(const FileCompareLine& cmpLine) { - if (m_warnings.warningSameDateDiffSize) - { - bool dontShowAgain = false; - Zstring msg = Zstring(_("Files %x have the same date but a different size!")).Replace(wxT("%x"), Zstring(wxT("\"")) + cmpLine.fileDescrLeft.relativeName.c_str() + wxT("\"")); - msg += wxT("\n\n"); - msg += Zstring(_("Left:")) + wxT(" \t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrLeft.lastWriteTimeRaw, - cmpLine.fileDescrLeft.fullName).c_str() + wxT(" \t") + _("Size") + wxT(": ") + cmpLine.fileDescrLeft.fileSize.ToString().c_str() + wxT("\n"); - msg += Zstring(_("Right:")) + wxT(" \t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrRight.lastWriteTimeRaw, - cmpLine.fileDescrRight.fullName).c_str() + wxT(" \t") + _("Size") + wxT(": ") + cmpLine.fileDescrRight.fileSize.ToString().c_str(); - - statusUpdater->reportWarning(Zstring(_("Conflict detected:")) + wxT("\n") + msg, - dontShowAgain); - m_warnings.warningSameDateDiffSize = !dontShowAgain; - } + //some beautification... + wxString left = wxString(_("Left")) + wxT(": "); + wxString right = wxString(_("Right")) + wxT(": "); + const int maxPref = std::max(left.length(), right.length()); + left.Pad(maxPref - left.length(), wxT(' '), true); + right.Pad(maxPref - right.length(), wxT(' '), true); + + wxString msg = _("Files %x have the same date but a different size!"); + msg.Replace(wxT("%x"), wxString(wxT("\"")) + cmpLine.fileDescrLeft.relativeName.c_str() + wxT("\"")); + msg += wxT("\n\n"); + msg += left + wxT("\t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrLeft.lastWriteTimeRaw, + cmpLine.fileDescrLeft.fullName) + wxT(" \t") + _("Size") + wxT(": ") + cmpLine.fileDescrLeft.fileSize.ToString() + wxT("\n"); + msg += right + wxT("\t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrRight.lastWriteTimeRaw, + cmpLine.fileDescrRight.fullName) + wxT(" \t") + _("Size") + wxT(": ") + cmpLine.fileDescrRight.fileSize.ToString(); + return wxString(_("Conflict detected:")) + wxT("\n") + msg; } //check for files that have a difference in file modification date below 1 hour when DST check is active -void CompareProcess::issueWarningChangeWithinHour(const FileCompareLine& cmpLine) +wxString getConflictChangeWithinHour(const FileCompareLine& cmpLine) { - if (m_warnings.warningDSTChangeWithinHour) - { - bool dontShowAgain = false; - Zstring msg = Zstring(_("Files %x have a file time difference of less than 1 hour! It's not safe to decide which one is newer due to Daylight Saving Time issues.")).Replace(wxT("%x"), Zstring(wxT("\"")) + cmpLine.fileDescrLeft.relativeName.c_str() + wxT("\"")); - msg += wxT("\n\n"); - msg += Zstring(_("Left:")) + wxT(" \t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrLeft.lastWriteTimeRaw, cmpLine.fileDescrLeft.fullName).c_str() + wxT("\n"); - msg += Zstring(_("Right:")) + wxT(" \t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrRight.lastWriteTimeRaw, cmpLine.fileDescrRight.fullName).c_str(); - - statusUpdater->reportWarning(Zstring(_("Conflict detected:")) + wxT("\n") + msg, - dontShowAgain); - m_warnings.warningDSTChangeWithinHour = !dontShowAgain; - } + //some beautification... + wxString left = wxString(_("Left")) + wxT(": "); + wxString right = wxString(_("Right")) + wxT(": "); + const int maxPref = std::max(left.length(), right.length()); + left.Pad(maxPref - left.length(), wxT(' '), true); + right.Pad(maxPref - right.length(), wxT(' '), true); + + wxString msg = _("Files %x have a file time difference of less than 1 hour! It's not safe to decide which one is newer due to Daylight Saving Time issues."); + msg.Replace(wxT("%x"), wxString(wxT("\"")) + cmpLine.fileDescrLeft.relativeName.c_str() + wxT("\"")); + msg += wxT("\n\n"); + msg += left + wxT("\t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrLeft.lastWriteTimeRaw, cmpLine.fileDescrLeft.fullName) + wxT("\n"); + msg += right + wxT("\t") + _("Date") + wxT(": ") + utcTimeToLocalString(cmpLine.fileDescrRight.lastWriteTimeRaw, cmpLine.fileDescrRight.fullName); + return wxString(_("Conflict detected:")) + wxT("\n") + msg; } +//----------------------------------------------------------------------------- const CompareFilesResult FILE_UNDEFINED = CompareFilesResult(42); @@ -665,9 +698,9 @@ void CompareProcess::compareByTimeSize(const std::vector<FolderPair>& directoryP { i->cmpResult = FILE_CONFLICT; if (i->fileDescrLeft.lastWriteTimeRaw < 0 || i->fileDescrLeft.lastWriteTimeRaw > oneYearFromNow) - issueWarningInvalidDate(i->fileDescrLeft.fullName, i->fileDescrLeft.lastWriteTimeRaw); + i->conflictDescription = OptionalString(getConflictInvalidDate(i->fileDescrLeft.fullName, i->fileDescrLeft.lastWriteTimeRaw)); else - issueWarningInvalidDate(i->fileDescrRight.fullName, i->fileDescrRight.lastWriteTimeRaw); + i->conflictDescription = OptionalString(getConflictInvalidDate(i->fileDescrRight.fullName, i->fileDescrRight.lastWriteTimeRaw)); } else //from this block on all dates are at least "valid" { @@ -679,7 +712,7 @@ void CompareProcess::compareByTimeSize(const std::vector<FolderPair>& directoryP else { i->cmpResult = FILE_CONFLICT; //same date, different filesize - issueWarningSameDateDiffSize(*i); + i->conflictDescription = OptionalString(getConflictSameDateDiffSize(*i)); } } else @@ -691,7 +724,7 @@ void CompareProcess::compareByTimeSize(const std::vector<FolderPair>& directoryP if (sameFileTime(i->fileDescrLeft.lastWriteTimeRaw, i->fileDescrRight.lastWriteTimeRaw, 3600 - 2 - 1)) { i->cmpResult = FILE_CONFLICT; - issueWarningChangeWithinHour(*i); + i->conflictDescription = OptionalString(getConflictChangeWithinHour(*i)); } else //exact +/- 1-hour detected: treat as equal { @@ -700,7 +733,7 @@ void CompareProcess::compareByTimeSize(const std::vector<FolderPair>& directoryP else { i->cmpResult = FILE_CONFLICT; //same date, different filesize - issueWarningSameDateDiffSize(*i); + i->conflictDescription = OptionalString(getConflictSameDateDiffSize(*i)); } } } @@ -721,7 +754,7 @@ void CompareProcess::compareByTimeSize(const std::vector<FolderPair>& directoryP else { i->cmpResult = FILE_CONFLICT; //same date, different filesize - issueWarningSameDateDiffSize(*i); + i->conflictDescription = OptionalString(getConflictSameDateDiffSize(*i)); } } } @@ -950,10 +983,11 @@ void CompareProcess::performBaseComparison(const FolderPair& pair, FileCompariso //begin base comparison FileCompareLine newline(FILE_UNDEFINED, SYNC_DIR_NONE, true); - DirectoryDescrType::iterator j; for (DirectoryDescrType::const_iterator i = directoryLeft->begin(); i != directoryLeft->end(); ++i) - { //find files/folders that exist in left file tree but not in right one - if ((j = custom_binary_search(directoryRight->begin(), directoryRight->end(), *i)) == directoryRight->end()) + { + //find files/folders that exist in left file tree but not in right one + DirectoryDescrType::const_iterator j = custom_binary_search(directoryRight->begin(), directoryRight->end(), *i); + if (j == directoryRight->end()) { newline.fileDescrLeft = *i; newline.fileDescrRight = FileDescrLine(); diff --git a/comparison.h b/comparison.h index eaa4e2c8..0833defe 100644 --- a/comparison.h +++ b/comparison.h @@ -37,12 +37,6 @@ namespace FreeFileSync //create comparison result table and fill relation except for files existing on both sides void performBaseComparison(const FolderPair& pair, FileComparison& output); - - void issueWarningInvalidDate(const Zstring& fileNameFull, const wxLongLong& utcTime); - void issueWarningSameDateDiffSize(const FileCompareLine& cmpLine); - void issueWarningChangeWithinHour(const FileCompareLine& cmpLine); - - //buffer accesses to the same directories; useful when multiple folder pairs are used DirectoryDescrBuffer* descriptionBuffer; diff --git a/library/CustomGrid.cpp b/library/CustomGrid.cpp index 591230e2..4cb82961 100644 --- a/library/CustomGrid.cpp +++ b/library/CustomGrid.cpp @@ -1,5 +1,5 @@ #include "customGrid.h" -#include "globalFunctions.h" +#include "../shared/globalFunctions.h" #include "resources.h" #include <wx/dc.h> #include "../algorithm.h" @@ -7,6 +7,7 @@ #include <typeinfo> #include "../ui/gridView.h" #include "../synchronization.h" +#include "../shared/customTooltip.h" #ifdef FFS_WIN #include <wx/timer.h> @@ -60,9 +61,9 @@ public: virtual ~CustomGridTable() {} - void setGridDataTable(const GridView* gridDataView) + void setGridDataTable(const GridView* view) { - this->gridDataView = gridDataView; + this->gridDataView = view; } @@ -275,15 +276,15 @@ public: switch (getTypeAtPos(col)) { case xmlAccess::FULL_PATH: - return wxString(gridLine->fileDescrLeft.fullName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrLeft.fullName.c_str()).BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::FILENAME: //filename - return wxString(gridLine->fileDescrLeft.relativeName.c_str()).AfterLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrLeft.relativeName.c_str()).AfterLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::REL_PATH: //relative path - return wxString(gridLine->fileDescrLeft.relativeName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrLeft.relativeName.c_str()).BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::DIRECTORY: return gridDataView->getFolderPair(row).leftDirectory.c_str(); case xmlAccess::SIZE: //file size - return globalFunctions::includeNumberSeparator(gridLine->fileDescrLeft.fileSize.ToString()); + return FreeFileSync::includeNumberSeparator(gridLine->fileDescrLeft.fileSize.ToString()); case xmlAccess::DATE: //date return FreeFileSync::utcTimeToLocalString(gridLine->fileDescrLeft.lastWriteTimeRaw, gridLine->fileDescrLeft.fullName); } @@ -355,15 +356,15 @@ public: switch (getTypeAtPos(col)) { case xmlAccess::FULL_PATH: - return wxString(gridLine->fileDescrRight.fullName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrRight.fullName.c_str()).BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::FILENAME: //filename - return wxString(gridLine->fileDescrRight.relativeName.c_str()).AfterLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrRight.relativeName.c_str()).AfterLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::REL_PATH: //relative path - return wxString(gridLine->fileDescrRight.relativeName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + return wxString(gridLine->fileDescrRight.relativeName.c_str()).BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); case xmlAccess::DIRECTORY: return gridDataView->getFolderPair(row).rightDirectory.c_str(); case xmlAccess::SIZE: //file size - return globalFunctions::includeNumberSeparator(gridLine->fileDescrRight.fileSize.ToString()); + return FreeFileSync::includeNumberSeparator(gridLine->fileDescrRight.fileSize.ToString()); case xmlAccess::DATE: //date return FreeFileSync::utcTimeToLocalString(gridLine->fileDescrRight.lastWriteTimeRaw, gridLine->fileDescrRight.fullName); } @@ -449,7 +450,7 @@ private: if (syncPreviewActive) //synchronization preview { - switch (gridLine->direction) + switch (gridLine->syncDir) { case SYNC_DIR_LEFT: return COLOR_SYNC_BLUE; @@ -904,77 +905,98 @@ public: { //############## show windows explorer file icons ###################### - if (showFileIcons) //evaluate at compile time + if ( showFileIcons && //evaluate at compile time + m_gridDataTable->getTypeAtPos(col) == xmlAccess::FILENAME) { - if ( m_gridDataTable->getTypeAtPos(col) == xmlAccess::FILENAME && - rect.GetWidth() >= IconBuffer::ICON_SIZE) + if (rect.GetWidth() >= IconBuffer::ICON_SIZE) { + // Partitioning: + // _____________________ + // | 2 pix | icon | rest | + // --------------------- + + //clear area where icon will be placed + wxRect rectShrinked(rect); + rectShrinked.SetWidth(IconBuffer::ICON_SIZE + LEFT_BORDER); //add 2 pixel border + wxGridCellRenderer::Draw(grid, attr, dc, rectShrinked, row, col, isSelected); + + //draw rest + wxRect rest(rect); //unscrolled + rest.x += IconBuffer::ICON_SIZE + LEFT_BORDER; + rest.width -= IconBuffer::ICON_SIZE + LEFT_BORDER; + wxGridCellStringRenderer::Draw(grid, attr, dc, rest, row, col, isSelected); + + //try to draw icon //retrieve grid data const Zstring fileName = m_gridDataTable->getFileName(row); if (!fileName.empty()) { - // Partitioning: - // _____________________ - // | 2 pix | icon | rest | - // --------------------- - - //clear area where icon will be placed - wxRect rectShrinked(rect); - rectShrinked.SetWidth(IconBuffer::ICON_SIZE + 2); //add 2 pixel border - wxGridCellRenderer::Draw(grid, attr, dc, rectShrinked, row, col, isSelected); - - //try to draw icon wxIcon icon; + bool iconDrawnFully = false; const bool iconLoaded = IconBuffer::getInstance().requestIcon(fileName, &icon); //returns false if icon is not in buffer if (iconLoaded) - dc.DrawIcon(icon, rectShrinked.GetX() + 2, rectShrinked.GetY()); + { + dc.DrawIcon(icon, rectShrinked.GetX() + LEFT_BORDER, rectShrinked.GetY()); - //----------------------------------------------------------------------------------------------- - //only mark as successful if icon was drawn fully! - //(attention: when scrolling, rows get partially updated, which can result in the upper half being blank!) + //----------------------------------------------------------------------------------------------- + //only mark as successful if icon was drawn fully! + //(attention: when scrolling, rows get partially updated, which can result in the upper half being blank!) - //rect where icon was placed - wxRect iconRect(rect); //unscrolled - iconRect.x += 2; - iconRect.SetWidth(IconBuffer::ICON_SIZE); + //rect where icon was placed + wxRect iconRect(rect); //unscrolled + iconRect.x += LEFT_BORDER; + iconRect.SetWidth(IconBuffer::ICON_SIZE); - //convert to scrolled coordinates - grid.CalcScrolledPosition(iconRect.x, iconRect.y, &iconRect.x, &iconRect.y); + //convert to scrolled coordinates + grid.CalcScrolledPosition(iconRect.x, iconRect.y, &iconRect.x, &iconRect.y); - bool iconDrawnFully = false; - wxRegionIterator regionsInv(grid.GetGridWindow()->GetUpdateRegion()); - while (regionsInv) - { - if (regionsInv.GetRect().Contains(iconRect)) + wxRegionIterator regionsInv(grid.GetGridWindow()->GetUpdateRegion()); + while (regionsInv) { - iconDrawnFully = true; - break; + if (regionsInv.GetRect().Contains(iconRect)) + { + iconDrawnFully = true; + break; + } + ++regionsInv; } - ++regionsInv; } //----------------------------------------------------------------------------------------------- - - //save status of last icon load -> used for async. icon loading m_loadIconSuccess[row] = iconLoaded && iconDrawnFully; - - //draw rest - wxRect rest(rect); //unscrolled - rest.x += IconBuffer::ICON_SIZE + 2; - rest.width -= IconBuffer::ICON_SIZE + 2; - - wxGridCellStringRenderer::Draw(grid, attr, dc, rest, row, col, isSelected); - return; } } + return; } + //default wxGridCellStringRenderer::Draw(grid, attr, dc, rect, row, col, isSelected); } + + virtual wxSize GetBestSize(wxGrid& grid, //adapt reported width if file icons are shown + wxGridCellAttr& attr, + wxDC& dc, + int row, int col) + { + if ( showFileIcons && //evaluate at compile time + m_gridDataTable->getTypeAtPos(col) == xmlAccess::FILENAME) + { + wxSize rv = wxGridCellStringRenderer::GetBestSize(grid, attr, dc, row, col); + rv.SetWidth(rv.GetWidth() + LEFT_BORDER + IconBuffer::ICON_SIZE); + return rv; + } + + //default + return wxGridCellStringRenderer::GetBestSize(grid, attr, dc, row, col); + } + + private: CustomGridRim::LoadSuccess& m_loadIconSuccess; const CustomGridTableRim* const m_gridDataTable; + + static const int LEFT_BORDER = 2; }; #endif @@ -1268,7 +1290,7 @@ IconUpdater::IconUpdater(CustomGridLeft* leftGrid, CustomGridRight* rightGrid) : m_timer(new wxTimer) //connect timer event for async. icon loading { m_timer->Connect(wxEVT_TIMER, wxEventHandler(IconUpdater::loadIconsAsynchronously), NULL, this); - m_timer->Start(50); //timer interval + m_timer->Start(50); //timer interval in ms } @@ -1280,7 +1302,8 @@ void IconUpdater::loadIconsAsynchronously(wxEvent& event) //loads all (not yet) std::vector<Zstring> newLoad; m_rightGrid->getIconsToBeLoaded(newLoad); - globalFunctions::mergeVectors(iconsLeft, newLoad); + //merge vectors + newLoad.insert(newLoad.end(), iconsLeft.begin(), iconsLeft.end()); FreeFileSync::IconBuffer::getInstance().setWorkload(newLoad); //attention: newLoad is invalidated after this call!!! @@ -1424,7 +1447,8 @@ CustomGridMiddle::CustomGridMiddle(wxWindow *parent, selectionPos(BLOCKPOS_CHECK_BOX), highlightedRow(-1), highlightedPos(BLOCKPOS_CHECK_BOX), - gridDataTable(NULL) + gridDataTable(NULL), + toolTip(new CustomTooltip) { //connect events for dynamic selection of sync direction GetGridWindow()->Connect(wxEVT_MOTION, wxMouseEventHandler(CustomGridMiddle::OnMouseMovement), NULL, this); @@ -1480,6 +1504,9 @@ void CustomGridMiddle::OnMouseMovement(wxMouseEvent& event) if ( highlightedRowOld >= 0 && highlightedRow != highlightedRowOld) RefreshCell(highlightedRowOld, 0); + + //handle tooltip + showToolTip(highlightedRow, GetGridWindow()->ClientToScreen(event.GetPosition())); } event.Skip(); @@ -1491,6 +1518,78 @@ void CustomGridMiddle::OnLeaveWindow(wxMouseEvent& event) highlightedRow = -1; highlightedPos = BLOCKPOS_CHECK_BOX; Refresh(); + + //handle tooltip + toolTip->hide(); +} + + +void CustomGridMiddle::showToolTip(int rowNumber, wxPoint pos) +{ + const FileCompareLine* const rowData = gridDataTable->getRawData(rowNumber); + if (rowData == NULL) //if invalid row... + { + toolTip->hide(); + return; + } + + if (gridDataTable->syncPreviewIsActive()) //synchronization preview + { + switch (getSyncOperation(*rowData)) + { + case SO_CREATE_NEW_LEFT: + toolTip->show(_("Copy from right to left"), pos, GlobalResources::getInstance().bitmapSyncCreateLeftAct); + break; + case SO_CREATE_NEW_RIGHT: + toolTip->show(_("Copy from left to right"), pos, GlobalResources::getInstance().bitmapSyncCreateRightAct); + break; + case SO_DELETE_LEFT: + toolTip->show(_("Delete files/folders existing on left side only"), pos, GlobalResources::getInstance().bitmapSyncDeleteLeftAct); + break; + case SO_DELETE_RIGHT: + toolTip->show(_("Delete files/folders existing on right side only"), pos, GlobalResources::getInstance().bitmapSyncDeleteRightAct); + break; + case SO_OVERWRITE_LEFT: + toolTip->show(_("Copy from right to left overwriting"), pos, GlobalResources::getInstance().bitmapSyncDirLeftAct); + break; + case SO_OVERWRITE_RIGHT: + toolTip->show(_("Copy from left to right overwriting"), pos, GlobalResources::getInstance().bitmapSyncDirRightAct); + break; + case SO_DO_NOTHING: + toolTip->show(_("Do nothing"), pos, GlobalResources::getInstance().bitmapSyncDirNoneAct); + break; + case SO_UNRESOLVED_CONFLICT: + toolTip->show(rowData->conflictDescription.get(), pos, GlobalResources::getInstance().bitmapConflictAct); + break; + }; + } + else + { + switch (rowData->cmpResult) + { + case FILE_LEFT_SIDE_ONLY: + toolTip->show(_("Files/folders that exist on left side only"), pos, GlobalResources::getInstance().bitmapLeftOnlyAct); + break; + case FILE_RIGHT_SIDE_ONLY: + toolTip->show(_("Files/folders that exist on right side only"), pos, GlobalResources::getInstance().bitmapRightOnlyAct); + break; + case FILE_LEFT_NEWER: + toolTip->show(_("Files that exist on both sides, left one is newer"), pos, GlobalResources::getInstance().bitmapLeftNewerAct); + break; + case FILE_RIGHT_NEWER: + toolTip->show(_("Files that exist on both sides, right one is newer"), pos, GlobalResources::getInstance().bitmapRightNewerAct); + break; + case FILE_DIFFERENT: + toolTip->show(_("Files that exist on both sides and have different content"), pos, GlobalResources::getInstance().bitmapDifferentAct); + break; + case FILE_EQUAL: + toolTip->show(_(""), pos, GlobalResources::getInstance().bitmapEqualAct); + break; + case FILE_CONFLICT: + toolTip->show(rowData->conflictDescription.get(), pos, GlobalResources::getInstance().bitmapConflictAct); + break; + } + } } @@ -1594,32 +1693,6 @@ void CustomGridMiddle::enableSyncPreview(bool value) { assert(gridDataTable); gridDataTable->enableSyncPreview(value); - - //update legend - wxString toolTip; - - if (gridDataTable->syncPreviewIsActive()) //synchronization preview - { - const wxString header = _("Synchronization Preview"); - toolTip = header + wxT("\n") + wxString().Pad(header.Len(), wxChar('-')) + wxT("\n"); - toolTip += wxString(_("<- copy to left side\n")) + - _("-> copy to right side\n") + - wxT(" ")+ _("- do not copy\n") + - _("flash conflict\n"); - } - else //compare results view - { - const wxString header = _("Comparison Result"); - toolTip = header + wxT("\n") + wxString().Pad(header.Len(), wxChar('-')) + wxT("\n"); - toolTip += wxString(_("<| file on left side only\n")) + - _("|> file on right side only\n") + - _("<< left file is newer\n") + - _(">> right file is newer\n") + - _("!= files are different\n") + - _("== files are equal\n") + - _("flash conflict\n"); - } - GetGridColLabelWindow()->SetToolTip(toolTip); } @@ -1643,6 +1716,8 @@ void GridCellRendererMiddle::Draw(wxGrid& grid, { if (rect.GetWidth() > CHECK_BOX_WIDTH) { + const bool rowIsHighlighted = row == m_gridMiddle->highlightedRow; + wxRect rectShrinked(rect); //clean first block of rect that will receive image of checkbox @@ -1651,14 +1726,17 @@ void GridCellRendererMiddle::Draw(wxGrid& grid, //print image into first block rectShrinked.SetX(rect.GetX() + 1); - bool selected = rowData->selectedForSynchronization; //HIGHLIGHTNING: - if ( row == m_gridMiddle->highlightedRow && - m_gridMiddle->highlightedPos == CustomGridMiddle::BLOCKPOS_CHECK_BOX) - selected = !selected; - - if (selected) + if (rowIsHighlighted && m_gridMiddle->highlightedPos == CustomGridMiddle::BLOCKPOS_CHECK_BOX) + { + if (rowData->selectedForSynchronization) + dc.DrawLabel(wxEmptyString, *GlobalResources::getInstance().bitmapCheckBoxTrueFocus, rectShrinked, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + else + dc.DrawLabel(wxEmptyString, *GlobalResources::getInstance().bitmapCheckBoxFalseFocus, rectShrinked, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + } + //default + else if (rowData->selectedForSynchronization) dc.DrawLabel(wxEmptyString, *GlobalResources::getInstance().bitmapCheckBoxTrue, rectShrinked, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); else dc.DrawLabel(wxEmptyString, *GlobalResources::getInstance().bitmapCheckBoxFalse, rectShrinked, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -1674,7 +1752,7 @@ void GridCellRendererMiddle::Draw(wxGrid& grid, //print sync direction into second block //HIGHLIGHTNING: - if (row == m_gridMiddle->highlightedRow && m_gridMiddle->highlightedPos != CustomGridMiddle::BLOCKPOS_CHECK_BOX) + if (rowIsHighlighted && m_gridMiddle->highlightedPos != CustomGridMiddle::BLOCKPOS_CHECK_BOX) switch (m_gridMiddle->highlightedPos) { case CustomGridMiddle::BLOCKPOS_CHECK_BOX: @@ -1691,7 +1769,7 @@ void GridCellRendererMiddle::Draw(wxGrid& grid, } else //default { - const wxBitmap& syncOpIcon = getSyncOpImage(rowData->cmpResult, rowData->selectedForSynchronization, rowData->direction); + const wxBitmap& syncOpIcon = getSyncOpImage(rowData->cmpResult, rowData->selectedForSynchronization, rowData->syncDir); dc.DrawLabel(wxEmptyString, syncOpIcon, rectShrinked, wxALIGN_CENTER | wxALIGN_CENTER_VERTICAL); } } @@ -1755,3 +1833,30 @@ void CustomGridMiddle::DrawColLabel(wxDC& dc, int col) dc.DrawLabel(wxEmptyString, *GlobalResources::getInstance().bitmapCmpViewSmall, rect, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL); } + +const wxBitmap& FreeFileSync::getSyncOpImage(const CompareFilesResult cmpResult, + const bool selectedForSynchronization, + const SyncDirection syncDir) +{ + switch (getSyncOperation(cmpResult, selectedForSynchronization, syncDir)) //evaluate comparison result and sync direction + { + case SO_CREATE_NEW_LEFT: + return *GlobalResources::getInstance().bitmapCreateLeftSmall; + case SO_CREATE_NEW_RIGHT: + return *GlobalResources::getInstance().bitmapCreateRightSmall; + case SO_DELETE_LEFT: + return *GlobalResources::getInstance().bitmapDeleteLeftSmall; + case SO_DELETE_RIGHT: + return *GlobalResources::getInstance().bitmapDeleteRightSmall; + case SO_OVERWRITE_RIGHT: + return *GlobalResources::getInstance().bitmapSyncDirRightSmall; + case SO_OVERWRITE_LEFT: + return *GlobalResources::getInstance().bitmapSyncDirLeftSmall; + case SO_DO_NOTHING: + return *GlobalResources::getInstance().bitmapSyncDirNoneSmall; + case SO_UNRESOLVED_CONFLICT: + return *GlobalResources::getInstance().bitmapConflictSmall; + } + + return wxNullBitmap; //dummy +} diff --git a/library/CustomGrid.h b/library/CustomGrid.h index 98e86e11..a71b985a 100644 --- a/library/CustomGrid.h +++ b/library/CustomGrid.h @@ -3,7 +3,6 @@ #include <vector> #include <wx/grid.h> -#include "../structures.h" #include "processXml.h" #include <map> #include <memory> @@ -14,6 +13,7 @@ class CustomGridTableRight; class CustomGridTableMiddle; class GridCellRendererMiddle; class wxTimer; +class CustomTooltip; class CustomGridRim; class CustomGridLeft; class CustomGridMiddle; @@ -22,6 +22,10 @@ class CustomGridRight; namespace FreeFileSync { class GridView; + + const wxBitmap& getSyncOpImage(const CompareFilesResult cmpResult, + const bool selectedForSynchronization, + const SyncDirection syncDir); } //################################################################################## @@ -103,7 +107,7 @@ class GridCellRenderer; //----------------------------------------------------------- #ifdef FFS_WIN -class IconUpdater : public wxEvtHandler //update file icons periodically: use SINGLE instance to coordinate left and right grid at once +class IconUpdater : private wxEvtHandler //update file icons periodically: use SINGLE instance to coordinate left and right grid at once { public: IconUpdater(CustomGridLeft* leftGrid, CustomGridRight* rightGrid); @@ -123,8 +127,8 @@ private: class CustomGridRim : public CustomGrid { friend class IconUpdater; - template <bool showFileIcons> - friend class GridCellRenderer; + template <bool showFileIcons> + friend class GridCellRenderer; public: CustomGridRim(wxWindow *parent, @@ -257,6 +261,8 @@ private: void OnLeftMouseDown(wxMouseEvent& event); void OnLeftMouseUp(wxMouseEvent& event); + void showToolTip(int rowNumber, wxPoint pos); + //small helper methods enum BlockPosition //each cell can be divided into four blocks concerning mouse selections { @@ -276,6 +282,8 @@ private: BlockPosition highlightedPos; CustomGridTableMiddle* gridDataTable; + + std::auto_ptr<CustomTooltip> toolTip; }; //custom events for middle grid: diff --git a/library/errorLogging.cpp b/library/errorLogging.cpp new file mode 100644 index 00000000..000dce4d --- /dev/null +++ b/library/errorLogging.cpp @@ -0,0 +1,48 @@ +#include "errorLogging.h" +#include <wx/datetime.h> +#include <wx/intl.h> + + +using FreeFileSync::ErrorLogging; + + +void ErrorLogging::logError(const wxString& errorMessage) +{ + ++errorCount; + + const wxString prefix = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Error") + wxT(": "); + formattedMessages.push_back(assembleMessage(prefix, errorMessage)); +} + + +void ErrorLogging::logWarning(const wxString& warningMessage) +{ + const wxString prefix = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Warning") + wxT(": "); + formattedMessages.push_back(assembleMessage(prefix, warningMessage)); +} + + +void ErrorLogging::logInfo(const wxString& infoMessage) +{ + const wxString prefix = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Info") + wxT(": "); + formattedMessages.push_back(assembleMessage(prefix, infoMessage)); +} + + +wxString ErrorLogging::assembleMessage(const wxString& prefix, const wxString& message) +{ + const size_t prefixLength = prefix.size(); + wxString formattedText = prefix; + for (wxString::const_iterator i = message.begin(); i != message.end(); ++i) + if (*i == wxChar('\n')) + { + formattedText += wxString(wxChar('\n')).Pad(prefixLength, wxChar(' '), true); + while (*++i == wxChar('\n')) //remove duplicate newlines + ; + --i; + } + else + formattedText += *i; + + return formattedText; +} diff --git a/library/errorLogging.h b/library/errorLogging.h new file mode 100644 index 00000000..5fc5dacd --- /dev/null +++ b/library/errorLogging.h @@ -0,0 +1,43 @@ +#ifndef ERRORLOGGING_H_INCLUDED +#define ERRORLOGGING_H_INCLUDED + +#include <wx/string.h> +#include <vector> + +class Zstring; + +namespace FreeFileSync +{ + class ErrorLogging + { + public: + ErrorLogging() : errorCount(0) {} + + void logError(const wxString& errorMessage); + void logWarning(const wxString& warningMessage); + void logInfo(const wxString& infoMessage); + + int errorsTotal() + { + return errorCount; + } + + const std::vector<wxString>& getFormattedMessages() + { + return formattedMessages; + } + + size_t messageCount() + { + return formattedMessages.size(); + } + + private: + wxString assembleMessage(const wxString& prefix, const wxString& message); + + std::vector<wxString> formattedMessages; //list of non-resolved errors and warnings + int errorCount; + }; +} + +#endif // ERRORLOGGING_H_INCLUDED diff --git a/library/filter.cpp b/library/filter.cpp index 65513630..bd281c7c 100644 --- a/library/filter.cpp +++ b/library/filter.cpp @@ -1,10 +1,10 @@ #include "filter.h" -#include "zstring.h" +#include "../shared/zstring.h" #include <wx/string.h> #include <set> #include <vector> -#include "resources.h" -#include "globalFunctions.h" +#include "../shared/globalFunctions.h" +#include "../structures.h" using FreeFileSync::FilterProcess; @@ -49,7 +49,7 @@ std::vector<Zstring> compoundStringToFilter(const Zstring& filterString) std::vector<Zstring> newEntries; compoundStringToTable(*i, wxT("\n"), newEntries); - globalFunctions::mergeVectors(newEntries, filterList); + filterList.insert(filterList.end(), newEntries.begin(), newEntries.end()); } return filterList; @@ -70,12 +70,12 @@ void addFilterEntry(const Zstring& filtername, std::set<Zstring>& fileFilter, st #endif //remove leading separators (keep BEFORE test for Zstring::empty()!) - if (filterFormatted.length() > 0 && *filterFormatted.c_str() == FreeFileSync::FILE_NAME_SEPARATOR) + if (filterFormatted.length() > 0 && *filterFormatted.c_str() == globalFunctions::FILE_NAME_SEPARATOR) filterFormatted = Zstring(filterFormatted.c_str() + 1); if (!filterFormatted.empty()) { - //Test if filterFormatted ends with FreeFileSync::FILE_NAME_SEPARATOR, ignoring '*' and '?'. + //Test if filterFormatted ends with globalFunctions::FILE_NAME_SEPARATOR, ignoring '*' and '?'. //If so, treat as filter for directory and add to directoryFilter. const DefaultChar* filter = filterFormatted.c_str(); int i = filterFormatted.length() - 1; @@ -87,7 +87,7 @@ void addFilterEntry(const Zstring& filtername, std::set<Zstring>& fileFilter, st break; } - if (i >= 0 && filter[i] == FreeFileSync::FILE_NAME_SEPARATOR) //last FILE_NAME_SEPARATOR found + if (i >= 0 && filter[i] == globalFunctions::FILE_NAME_SEPARATOR) //last FILE_NAME_SEPARATOR found { if (i != int(filterFormatted.length()) - 1) // "name\*" { @@ -119,7 +119,7 @@ bool matchesFilter(const DefaultChar* name, const std::set<Zstring>& filter) #endif for (std::set<Zstring>::const_iterator j = filter.begin(); j != filter.end(); ++j) - if (Zstring::Matches(nameFormatted, *j)) + if (Zstring::Matches(nameFormatted, j->c_str())) return true; return false; diff --git a/library/filter.h b/library/filter.h index 85df591c..53e4d9b1 100644 --- a/library/filter.h +++ b/library/filter.h @@ -1,6 +1,9 @@ #ifndef FFS_FILTER_H_INCLUDED #define FFS_FILTER_H_INCLUDED +#include <wx/string.h> +#include "../shared/zstring.h" +#include <set> #include "../structures.h" diff --git a/library/iconBuffer.cpp b/library/iconBuffer.cpp index a969f689..f73164e0 100644 --- a/library/iconBuffer.cpp +++ b/library/iconBuffer.cpp @@ -1,11 +1,9 @@ #include "iconBuffer.h" #include <wx/thread.h> -#include "globalFunctions.h" -#include <wx/utils.h> +#include "../shared/globalFunctions.h" #include <wx/bitmap.h> #include <wx/msw/wrapwin.h> //includes "windows.h" #include <wx/msgdlg.h> -#include "../algorithm.h" #include <wx/icon.h> #include <map> #include <queue> @@ -13,53 +11,7 @@ using FreeFileSync::IconBuffer; -class BasicString //simple thread safe string class -{ -public: - BasicString() - { - data = new DefaultChar[1]; //compliance with delete [] - *data = 0; //compliance with c_str() - } - - BasicString(const Zstring& other) //make DEEP COPY from Zstring! - { - data = new DefaultChar[other.length() + 1]; - memcpy(data, other.c_str(), (other.length() + 1) * sizeof(DefaultChar)); - } - - BasicString(const BasicString& other) - { - const size_t otherLen = defaultLength(other.c_str()); - data = new DefaultChar[otherLen + 1]; - memcpy(data, other.c_str(), (otherLen + 1) * sizeof(DefaultChar)); - } - - ~BasicString() - { - delete [] data; - } - - BasicString& operator=(const BasicString& other) - { //exception safety; handle self-assignment implicitly - const size_t otherLen = defaultLength(other.c_str()); - DefaultChar* dataNew = new DefaultChar[otherLen + 1]; - memcpy(dataNew, other.c_str(), (otherLen + 1) * sizeof(DefaultChar)); - - delete data; - data = dataNew; - - return *this; - } - - const DefaultChar* c_str() const - { - return data; - } - -private: - DefaultChar* data; -}; +typedef std::vector<DefaultChar> BasicString; //simple thread safe string class: std::vector is guaranteed to not use reference counting, Effective STL, item 13 class WorkerThread : public wxThread @@ -123,7 +75,7 @@ void WorkerThread::setWorkload(const std::vector<Zstring>& load) //(re-)set new workload.clear(); for (std::vector<Zstring>::const_iterator i = load.begin(); i != load.end(); ++i) - workload.push_back(*i); //make DEEP COPY from Zstring! + workload.push_back(FileName(i->c_str(), i->c_str() + i->length() + 1)); //make DEEP COPY from Zstring (include null-termination)! if (!workload.empty()) continueWork.Signal(); //wake thread IF he is waiting @@ -132,9 +84,12 @@ void WorkerThread::setWorkload(const std::vector<Zstring>& load) //(re-)set new void WorkerThread::quitThread() { - wxMutexLocker dummy(threadIsListening); //wait until thread is in waiting state - threadExitIsRequested = true; //no sharing conflicts in this situation - continueWork.Signal(); //exit thread + { + wxMutexLocker dummy(threadIsListening); //wait until thread is in waiting state + threadExitIsRequested = true; //no sharing conflicts in this situation + continueWork.Signal(); //exit thread + } + Wait(); //wait until thread has exitted } @@ -144,7 +99,7 @@ wxThread::ExitCode WorkerThread::Entry() { wxMutexLocker dummy(threadIsListening); //this lock needs to be called from WITHIN the thread => calling it from constructor(Main thread) would be useless { //this mutex STAYS locked all the time except of continueWork.Wait()! - wxCriticalSectionLocker dummy(lockWorkload); + wxCriticalSectionLocker dummy2(lockWorkload); threadHasMutex = true; } @@ -170,7 +125,7 @@ wxThread::ExitCode WorkerThread::Entry() void WorkerThread::doWork() { - BasicString fileName; //don't use Zstring: reference-counted objects are NOT THREADSAFE!!! e.g. double deletion might happen + FileName fileName; //don't use Zstring: reference-counted objects are NOT THREADSAFE!!! e.g. double deletion might happen //do work: get the file icon. while (true) @@ -183,38 +138,46 @@ void WorkerThread::doWork() workload.pop_back(); } - if (iconBuffer->requestIcon(Zstring(fileName.c_str()))) //thread safety: Zstring okay, won't be reference-counted in requestIcon() + if (iconBuffer->requestIcon(Zstring(&fileName[0]))) //thread safety: Zstring okay, won't be reference-counted in requestIcon(), fileName is NOT empty break; //icon already in buffer: enter waiting state - //load icon - SHFILEINFO fileInfo; - fileInfo.hIcon = 0; //initialize hIcon - - if (SHGetFileInfo(fileName.c_str(), //NOTE: CoInitializeEx()/CoUninitialize() implicitly called by wxWidgets on program startup! - 0, - &fileInfo, - sizeof(fileInfo), - SHGFI_ICON | SHGFI_SMALLICON) && - - fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! - { //bug report: https://sourceforge.net/tracker/?func=detail&aid=2768004&group_id=234430&atid=1093080 - - wxIcon newIcon; //attention: wxIcon uses reference counting! - newIcon.SetHICON(fileInfo.hIcon); - newIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); - - iconBuffer->insertIntoBuffer(fileName.c_str(), newIcon); //thread safety: icon may be deleted only within insertIntoBuffer() - - //freeing of icon handle seems to happen somewhere beyond wxIcon destructor - //if (!DestroyIcon(fileInfo.hIcon)) - // throw RuntimeException(wxString(wxT("Error deallocating Icon handle!\n\n")) + FreeFileSync::getLastErrorFormatted()); - - } - else + //despite what docu says about SHGetFileInfo() it can't handle all relative filenames, e.g. "\DirName" + const unsigned int BUFFER_SIZE = 10000; + DefaultChar fullName[BUFFER_SIZE]; + const DWORD rv = ::GetFullPathName( + &fileName[0], //__in LPCTSTR lpFileName, + BUFFER_SIZE, //__in DWORD nBufferLength, + fullName, //__out LPTSTR lpBuffer, + NULL); //__out LPTSTR *lpFilePart + if (rv < BUFFER_SIZE && rv != 0) { - //if loading of icon fails for whatever reason, just save a dummy icon to avoid re-loading - iconBuffer->insertIntoBuffer(fileName.c_str(), wxNullIcon); + //load icon + SHFILEINFO fileInfo; + fileInfo.hIcon = 0; //initialize hIcon + + if (::SHGetFileInfo(fullName, //NOTE: CoInitializeEx()/CoUninitialize() implicitly called by wxWidgets on program startup! + 0, + &fileInfo, + sizeof(fileInfo), + SHGFI_ICON | SHGFI_SMALLICON) && + + fileInfo.hIcon != 0) //fix for weird error: SHGetFileInfo() might return successfully WITHOUT filling fileInfo.hIcon!! + { //bug report: https://sourceforge.net/tracker/?func=detail&aid=2768004&group_id=234430&atid=1093080 + + wxIcon newIcon; //attention: wxIcon uses reference counting! + newIcon.SetHICON(fileInfo.hIcon); + newIcon.SetSize(IconBuffer::ICON_SIZE, IconBuffer::ICON_SIZE); + + iconBuffer->insertIntoBuffer(&fileName[0], newIcon); //thread safety: icon may be deleted only within insertIntoBuffer() + + //freeing of icon handle seems to happen somewhere beyond wxIcon destructor + //if (!DestroyIcon(fileInfo.hIcon)) + // throw RuntimeException(wxString(wxT("Error deallocating Icon handle!\n\n")) + FreeFileSync::getLastErrorFormatted()); + continue; + } } + //if loading of icon fails for whatever reason, just save a dummy icon to avoid re-loading + iconBuffer->insertIntoBuffer(&fileName[0], wxNullIcon); } } @@ -245,7 +208,6 @@ IconBuffer::IconBuffer() : IconBuffer::~IconBuffer() { worker->quitThread(); - worker->Wait(); //wait until thread has exitted } diff --git a/library/iconBuffer.h b/library/iconBuffer.h index ba905d22..f62a2772 100644 --- a/library/iconBuffer.h +++ b/library/iconBuffer.h @@ -2,11 +2,11 @@ #define ICONBUFFER_H_INCLUDED #ifndef FFS_WIN -#warning //this header should be used in the windows build only! +header should be used in the windows build only! #endif #include <vector> -#include "zstring.h" +#include "../shared/zstring.h" #include <memory> class wxCriticalSection; diff --git a/library/pch.h b/library/pch.h index b561d448..22ed251f 100644 --- a/library/pch.h +++ b/library/pch.h @@ -25,6 +25,7 @@ do NOT use in release build! #include <stack> #include <set> #include <map> +#include <memory> #include <fstream> #ifdef FFS_LINUX @@ -85,7 +86,7 @@ do NOT use in release build! #include <wx/notebook.h> //other -#include "tinyxml/tinyxml.h" +#include "../shared/tinyxml/tinyxml.h" #include <sys/stat.h> #ifdef FFS_WIN diff --git a/library/processXml.cpp b/library/processXml.cpp index 4b8ffe27..43d7fdb9 100644 --- a/library/processXml.cpp +++ b/library/processXml.cpp @@ -1,9 +1,10 @@ #include "processXml.h" +#include "../shared/xmlBase.h" #include <wx/filefn.h> -#include <wx/ffile.h> #include <wx/intl.h> -#include "globalFunctions.h" -#include "tinyxml/tinyxml.h" +#include "../shared/globalFunctions.h" +#include "../shared/fileHandling.h" +#include "../shared/standardPaths.h" #ifdef FFS_WIN #include <wx/msw/wrapwin.h> //includes "windows.h" @@ -12,290 +13,142 @@ using namespace FreeFileSync; -//small helper functions -bool readXmlElementValue(std::string& output, const TiXmlElement* parent, const std::string& name); -bool readXmlElementValue(int& output, const TiXmlElement* parent, const std::string& name); -bool readXmlElementValue(CompareVariant& output, const TiXmlElement* parent, const std::string& name); -bool readXmlElementValue(SyncDirection& output, const TiXmlElement* parent, const std::string& name); -bool readXmlElementValue(bool& output, const TiXmlElement* parent, const std::string& name); - -void addXmlElement(TiXmlElement* parent, const std::string& name, const std::string& value); -void addXmlElement(TiXmlElement* parent, const std::string& name, const int value); -void addXmlElement(TiXmlElement* parent, const std::string& name, const SyncDirection value); -void addXmlElement(TiXmlElement* parent, const std::string& name, const bool value); - - -class XmlConfigInput +class FfsXmlParser : public xmlAccess::XmlParser { public: - XmlConfigInput(const wxString& fileName, const xmlAccess::XmlType type); - ~XmlConfigInput() {} - - bool loadedSuccessfully() - { - return loadSuccess; - } + FfsXmlParser(const TiXmlElement* rootElement) : xmlAccess::XmlParser(rootElement) {} //read gui settings, all values retrieved are optional, so check for initial values! (== -1) - bool readXmlGuiConfig(xmlAccess::XmlGuiConfig& outputCfg); + void readXmlGuiConfig(xmlAccess::XmlGuiConfig& outputCfg); //read batch settings, all values retrieved are optional - bool readXmlBatchConfig(xmlAccess::XmlBatchConfig& outputCfg); + void readXmlBatchConfig(xmlAccess::XmlBatchConfig& outputCfg); //read global settings, valid for both GUI and batch mode, independent from configuration - bool readXmlGlobalSettings(xmlAccess::XmlGlobalSettings& outputCfg); + void readXmlGlobalSettings(xmlAccess::XmlGlobalSettings& outputCfg); private: //read basic FreefileSync settings (used by commandline and GUI), return true if ALL values have been retrieved successfully - bool readXmlMainConfig(MainConfiguration& mainCfg, std::vector<FolderPair>& directoryPairs); - - TiXmlDocument doc; - bool loadSuccess; + void readXmlMainConfig(MainConfiguration& mainCfg, std::vector<FolderPair>& directoryPairs); }; -class XmlConfigOutput -{ -public: - XmlConfigOutput(const wxString& fileName, const xmlAccess::XmlType type); - ~XmlConfigOutput() {} - - bool writeToFile(); - - //write gui settings - bool writeXmlGuiConfig(const xmlAccess::XmlGuiConfig& outputCfg); - //write batch settings - bool writeXmlBatchConfig(const xmlAccess::XmlBatchConfig& outputCfg); - //write global settings - bool writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& outputCfg); - -private: - //write basic FreefileSync settings (used by commandline and GUI), return true if everything was written successfully - bool writeXmlMainConfig(const MainConfiguration& mainCfg, const std::vector<FolderPair>& directoryPairs); - - TiXmlDocument doc; - const wxString& m_fileName; -}; - - -xmlAccess::XmlType xmlAccess::getXmlType(const wxString& filename) -{ - if (!wxFileExists(filename)) - return XML_OTHER; - - //workaround to get a FILE* from a unicode filename - wxFFile configFile(filename, wxT("rb")); - if (!configFile.IsOpened()) - return XML_OTHER; - - FILE* inputFile = configFile.fp(); - - TiXmlDocument doc; - if (!doc.LoadFile(inputFile)) //fails if inputFile is no proper XML - return XML_OTHER; - - TiXmlElement* root = doc.RootElement(); - - if (!root || (root->ValueStr() != std::string("FreeFileSync"))) //check for FFS configuration xml - return XML_OTHER; +//write gui settings +bool writeXmlGuiConfig(const xmlAccess::XmlGuiConfig& outputCfg, TiXmlDocument& doc); +//write batch settings +bool writeXmlBatchConfig(const xmlAccess::XmlBatchConfig& outputCfg, TiXmlDocument& doc); +//write global settings +bool writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& outputCfg, TiXmlDocument& doc); +//write basic FreefileSync settings (used by commandline and GUI), return true if everything was written successfully +bool writeXmlMainConfig(const MainConfiguration& mainCfg, const std::vector<FolderPair>& directoryPairs, TiXmlDocument& doc); - const char* cfgType = root->Attribute("XmlType"); - if (!cfgType) - return XML_OTHER; - - if (std::string(cfgType) == "BATCH") - return XML_BATCH_CONFIG; - else if (std::string(cfgType) == "GUI") - return XML_GUI_CONFIG; - else if (std::string(cfgType) == "GLOBAL") - return XML_GLOBAL_SETTINGS; - else - return XML_OTHER; -} - -xmlAccess::XmlGuiConfig xmlAccess::readGuiConfig(const wxString& filename) +void xmlAccess::readGuiConfig(const wxString& filename, xmlAccess::XmlGuiConfig& config) { //load XML if (!wxFileExists(filename)) - throw FileError(Zstring(_("File does not exist:")) + wxT(" \"") + filename.c_str() + wxT("\"")); - - XmlConfigInput inputFile(filename, XML_GUI_CONFIG); - - XmlGuiConfig outputCfg; + throw XmlError(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\"")); - if (!inputFile.loadedSuccessfully()) - throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + TiXmlDocument doc; + if (!loadXmlDocument(filename, XML_GUI_CONFIG, doc)) + throw XmlError(wxString(_("Error reading file:")) + wxT(" \"") + filename + wxT("\"")); - if (!inputFile.readXmlGuiConfig(outputCfg)) //read GUI layout configuration - throw FileError(Zstring(_("Error parsing configuration file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + FfsXmlParser parser(doc.RootElement()); + parser.readXmlGuiConfig(config); //read GUI layout configuration - return outputCfg; + if (parser.errorsOccured()) + throw XmlError(wxString(_("Error parsing configuration file:")) + wxT(" \"") + filename + wxT("\"\n\n") + + parser.getErrorMessageFormatted(), XmlError::WARNING); } -xmlAccess::XmlBatchConfig xmlAccess::readBatchConfig(const wxString& filename) +void xmlAccess::readBatchConfig(const wxString& filename, xmlAccess::XmlBatchConfig& config) { //load XML if (!wxFileExists(filename)) - throw FileError(Zstring(_("File does not exist:")) + wxT(" \"") + filename.c_str() + wxT("\"")); - - XmlConfigInput inputFile(filename, XML_BATCH_CONFIG); - - XmlBatchConfig outputCfg; + throw XmlError(wxString(_("File does not exist:")) + wxT(" \"") + filename + wxT("\"")); - if (!inputFile.loadedSuccessfully()) - throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + TiXmlDocument doc; + if (!loadXmlDocument(filename, XML_BATCH_CONFIG, doc)) + throw XmlError(wxString(_("Error reading file:")) + wxT(" \"") + filename + wxT("\"")); - if (!inputFile.readXmlBatchConfig(outputCfg)) - throw FileError(Zstring(_("Error parsing configuration file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + FfsXmlParser parser(doc.RootElement()); + parser.readXmlBatchConfig(config); //read GUI layout configuration - return outputCfg; + if (parser.errorsOccured()) + throw XmlError(wxString(_("Error parsing configuration file:")) + wxT(" \"") + filename + wxT("\"\n\n") + + parser.getErrorMessageFormatted(), XmlError::WARNING); } -xmlAccess::XmlGlobalSettings xmlAccess::readGlobalSettings() +void xmlAccess::readGlobalSettings(xmlAccess::XmlGlobalSettings& config) { //load XML if (!wxFileExists(FreeFileSync::getGlobalConfigFile())) - throw FileError(Zstring(_("File does not exist:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile().c_str() + wxT("\"")); - - XmlConfigInput inputFile(FreeFileSync::getGlobalConfigFile(), XML_GLOBAL_SETTINGS); - - XmlGlobalSettings outputCfg; + throw XmlError(wxString(_("File does not exist:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile() + wxT("\"")); - if (!inputFile.loadedSuccessfully()) - throw FileError(Zstring(_("Error reading file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile().c_str() + wxT("\"")); + TiXmlDocument doc; + if (!loadXmlDocument(FreeFileSync::getGlobalConfigFile(), XML_GLOBAL_SETTINGS, doc)) + throw XmlError(wxString(_("Error reading file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile() + wxT("\"")); - if (!inputFile.readXmlGlobalSettings(outputCfg)) - throw FileError(Zstring(_("Error parsing configuration file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile().c_str() + wxT("\"")); + FfsXmlParser parser(doc.RootElement()); + parser.readXmlGlobalSettings(config); //read GUI layout configuration - return outputCfg; + if (parser.errorsOccured()) + throw XmlError(wxString(_("Error parsing configuration file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile() + wxT("\"\n\n") + + parser.getErrorMessageFormatted(), XmlError::WARNING); } -void xmlAccess::writeGuiConfig(const wxString& filename, const XmlGuiConfig& outputCfg) +void xmlAccess::writeGuiConfig(const XmlGuiConfig& outputCfg, const wxString& filename) { - XmlConfigOutput outputFile(filename, XML_GUI_CONFIG); + TiXmlDocument doc; + getDefaultXmlDocument(XML_GUI_CONFIG, doc); //populate and write XML tree - if ( !outputFile.writeXmlGuiConfig(outputCfg) || //add GUI layout configuration settings - !outputFile.writeToFile()) //save XML - throw FileError(Zstring(_("Error writing file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + if ( !writeXmlGuiConfig(outputCfg, doc) || //add GUI layout configuration settings + !saveXmlDocument(filename, doc)) //save XML + throw XmlError(wxString(_("Error writing file:")) + wxT(" \"") + filename + wxT("\"")); return; } -void xmlAccess::writeBatchConfig(const wxString& filename, const XmlBatchConfig& outputCfg) +void xmlAccess::writeBatchConfig(const XmlBatchConfig& outputCfg, const wxString& filename) { - XmlConfigOutput outputFile(filename, XML_BATCH_CONFIG); + TiXmlDocument doc; + getDefaultXmlDocument(XML_BATCH_CONFIG, doc); //populate and write XML tree - if ( !outputFile.writeXmlBatchConfig(outputCfg) || //add batch configuration settings - !outputFile.writeToFile()) //save XML - throw FileError(Zstring(_("Error writing file:")) + wxT(" \"") + filename.c_str() + wxT("\"")); + if ( !writeXmlBatchConfig(outputCfg, doc) || //add batch configuration settings + !saveXmlDocument(filename, doc)) //save XML + throw XmlError(wxString(_("Error writing file:")) + wxT(" \"") + filename + wxT("\"")); return; } void xmlAccess::writeGlobalSettings(const XmlGlobalSettings& outputCfg) { - XmlConfigOutput outputFile(FreeFileSync::getGlobalConfigFile(), XML_GLOBAL_SETTINGS); + TiXmlDocument doc; + getDefaultXmlDocument(XML_GLOBAL_SETTINGS, doc); //populate and write XML tree - if ( !outputFile.writeXmlGlobalSettings(outputCfg) || //add GUI layout configuration settings - !outputFile.writeToFile()) //save XML - throw FileError(Zstring(_("Error writing file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile().c_str() + wxT("\"")); + if ( !writeXmlGlobalSettings(outputCfg, doc) || //add GUI layout configuration settings + !saveXmlDocument(FreeFileSync::getGlobalConfigFile(), doc)) //save XML + throw XmlError(wxString(_("Error writing file:")) + wxT(" \"") + FreeFileSync::getGlobalConfigFile() + wxT("\"")); return; } -XmlConfigInput::XmlConfigInput(const wxString& fileName, const xmlAccess::XmlType type) : - loadSuccess(false) -{ - if (!wxFileExists(fileName)) //avoid wxWidgets error message when wxFFile receives not existing file - return; - - //workaround to get a FILE* from a unicode filename - wxFFile dummyFile(fileName, wxT("rb")); - if (dummyFile.IsOpened()) - { - FILE* inputFile = dummyFile.fp(); - - TiXmlBase::SetCondenseWhiteSpace(false); //do not condense whitespace characters - - if (doc.LoadFile(inputFile)) //load XML; fails if inputFile is no proper XML - { - TiXmlElement* root = doc.RootElement(); - - if (root && (root->ValueStr() == std::string("FreeFileSync"))) //check for FFS configuration xml - { - const char* cfgType = root->Attribute("XmlType"); - if (cfgType) - { - if (type == xmlAccess::XML_GUI_CONFIG) - loadSuccess = std::string(cfgType) == "GUI"; - else if (type == xmlAccess::XML_BATCH_CONFIG) - loadSuccess = std::string(cfgType) == "BATCH"; - else if (type == xmlAccess::XML_GLOBAL_SETTINGS) - loadSuccess = std::string(cfgType) == "GLOBAL"; - } - } - } - } -} - - -bool readXmlElementValue(std::string& output, const TiXmlElement* parent, const std::string& name) +bool readXmlElement(const std::string& name, const TiXmlElement* parent, CompareVariant& output) { - if (parent) - { - const TiXmlElement* child = parent->FirstChildElement(name); - if (child) - { - const char* text = child->GetText(); - if (text) //may be NULL!! - output = text; - else - output.clear(); - return true; - } - } - - return false; -} - - -bool readXmlElementValue(int& output, const TiXmlElement* parent, const std::string& name) -{ - std::string temp; - if (readXmlElementValue(temp, parent, name)) - { - output = globalFunctions::stringToInt(temp); - return true; - } - else - return false; -} - - -bool readXmlElementValue(long& output, const TiXmlElement* parent, const std::string& name) -{ - std::string temp; - if (readXmlElementValue(temp, parent, name)) + std::string dummy; + if (xmlAccess::readXmlElement(name, parent, dummy)) { - output = globalFunctions::stringToLong(temp); - return true; - } - else - return false; -} + if (dummy == "ByTimeAndSize") + output = FreeFileSync::CMP_BY_TIME_SIZE; + else if (dummy == "ByContent") + output = FreeFileSync::CMP_BY_CONTENT; + else + return false; - -bool readXmlElementValue(CompareVariant& output, const TiXmlElement* parent, const std::string& name) -{ - int dummy = 0; - if (readXmlElementValue(dummy, parent, name)) - { - output = CompareVariant(dummy); return true; } else @@ -303,17 +156,17 @@ bool readXmlElementValue(CompareVariant& output, const TiXmlElement* parent, con } -bool readXmlElementValue(SyncDirection& output, const TiXmlElement* parent, const std::string& name) +bool readXmlElement(const std::string& name, const TiXmlElement* parent, SyncDirectionCfg& output) { std::string dummy; - if (readXmlElementValue(dummy, parent, name)) + if (xmlAccess::readXmlElement(name, parent, dummy)) { if (dummy == "left") - output = SYNC_DIR_LEFT; + output = SYNC_DIR_CFG_LEFT; else if (dummy == "right") - output = SYNC_DIR_RIGHT; + output = SYNC_DIR_CFG_RIGHT; else //treat all other input as "none" - output = SYNC_DIR_NONE; + output = SYNC_DIR_CFG_NONE; return true; } @@ -322,23 +175,10 @@ bool readXmlElementValue(SyncDirection& output, const TiXmlElement* parent, cons } -bool readXmlElementValue(bool& output, const TiXmlElement* parent, const std::string& name) -{ - std::string dummy; - if (readXmlElementValue(dummy, parent, name)) - { - output = (dummy == "true"); - return true; - } - else - return false; -} - - -bool readXmlElementValue(xmlAccess::OnError& output, const TiXmlElement* parent, const std::string& name) +bool readXmlElement(const std::string& name, const TiXmlElement* parent, xmlAccess::OnError& output) { std::string dummy; - if (readXmlElementValue(dummy, parent, name)) + if (xmlAccess::readXmlElement(name, parent, dummy)) { if (dummy == "Ignore") output = xmlAccess::ON_ERROR_IGNORE; @@ -354,430 +194,319 @@ bool readXmlElementValue(xmlAccess::OnError& output, const TiXmlElement* parent, } -void readXmlElementTable(std::vector<wxString>& output, const TiXmlElement* parent, const std::string& name) +bool readXmlElement(const std::string& name, const TiXmlElement* parent , FreeFileSync::DeletionPolicy& output) { - output.clear(); - - if (parent) + std::string dummy; + if (xmlAccess::readXmlElement(name, parent, dummy)) { - //load elements - const TiXmlElement* element = parent->FirstChildElement(name); - while (element) - { - const char* text = element->GetText(); - if (text) //may be NULL!! - output.push_back(wxString::FromUTF8(text)); - else - break; - element = element->NextSiblingElement(); - } + if (dummy == "DeletePermanently") + output = FreeFileSync::DELETE_PERMANENTLY; + else if (dummy == "MoveToRecycleBin") + output = FreeFileSync::MOVE_TO_RECYCLE_BIN; + else if (dummy == "MoveToCustomDirectory") + output = FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY; + else + return false; + + return true; } -} -//################################################################################################################ + return false; +} -bool XmlConfigInput::readXmlMainConfig(MainConfiguration& mainCfg, std::vector<FolderPair>& directoryPairs) +bool readXmlAttribute(const std::string& name, const TiXmlElement* node, xmlAccess::ColumnTypes& output) { - TiXmlElement* root = doc.RootElement(); - if (!root) return false; + int dummy; + if (xmlAccess::readXmlAttribute(name, node, dummy)) + { + output = static_cast<xmlAccess::ColumnTypes>(dummy); + return true; + } + else + return false; +} - TiXmlHandle hRoot(root); - TiXmlElement* cmpSettings = hRoot.FirstChild("MainConfig").FirstChild("Comparison").ToElement(); - TiXmlElement* syncConfig = hRoot.FirstChild("MainConfig").FirstChild("Synchronization").FirstChild("Directions").ToElement(); - TiXmlElement* miscSettings = hRoot.FirstChild("MainConfig").FirstChild("Miscellaneous").ToElement(); - TiXmlElement* filter = TiXmlHandle(miscSettings).FirstChild("Filter").ToElement(); +//################################################################################################################ +void FfsXmlParser::readXmlMainConfig(MainConfiguration& mainCfg, std::vector<FolderPair>& directoryPairs) +{ + TiXmlHandleConst hRoot(root); //custom const handle: TiXml API seems broken in this regard - if (!cmpSettings || !syncConfig || !miscSettings || !filter) - return false; + const TiXmlElement* cmpSettings = hRoot.FirstChild("MainConfig").FirstChild("Comparison").ToElement(); + const TiXmlElement* syncConfig = hRoot.FirstChild("MainConfig").FirstChild("Synchronization").FirstChild("Directions").ToElement(); + const TiXmlElement* miscSettings = hRoot.FirstChild("MainConfig").FirstChild("Miscellaneous").ToElement(); + const TiXmlElement* filter = TiXmlHandleConst(miscSettings).FirstChild("Filter").ToElement(); - std::string tempString; //########################################################### //read compare variant - if (!readXmlElementValue(mainCfg.compareVar, cmpSettings, "Variant")) return false; + readXmlElementLogging("Variant", cmpSettings, mainCfg.compareVar); //read folder pair(s) - TiXmlElement* folderPair = TiXmlHandle(cmpSettings).FirstChild("Folders").FirstChild("Pair").ToElement(); + const TiXmlElement* folderPair = TiXmlHandleConst(cmpSettings).FirstChild("Folders").FirstChild("Pair").ToElement(); //read folder pairs directoryPairs.clear(); while (folderPair) { - FolderPair newPair; - - if (!readXmlElementValue(tempString, folderPair, "Left")) return false; - newPair.leftDirectory = wxString::FromUTF8(tempString.c_str()).c_str(); - - if (!readXmlElementValue(tempString, folderPair, "Right")) return false; - newPair.rightDirectory = wxString::FromUTF8(tempString.c_str()).c_str(); - - directoryPairs.push_back(newPair); + wxString temp; + wxString temp2; + readXmlElementLogging("Left", folderPair, temp); + readXmlElementLogging("Right", folderPair, temp2); + directoryPairs.push_back(FolderPair(temp.c_str(), temp2.c_str())); folderPair = folderPair->NextSiblingElement(); } //########################################################### //read sync configuration - if (!readXmlElementValue(mainCfg.syncConfiguration.exLeftSideOnly, syncConfig, "LeftOnly")) return false; - if (!readXmlElementValue(mainCfg.syncConfiguration.exRightSideOnly, syncConfig, "RightOnly")) return false; - if (!readXmlElementValue(mainCfg.syncConfiguration.leftNewer, syncConfig, "LeftNewer")) return false; - if (!readXmlElementValue(mainCfg.syncConfiguration.rightNewer, syncConfig, "RightNewer")) return false; - if (!readXmlElementValue(mainCfg.syncConfiguration.different, syncConfig, "Different")) return false; + readXmlElementLogging("LeftOnly", syncConfig, mainCfg.syncConfiguration.exLeftSideOnly); + readXmlElementLogging("RightOnly", syncConfig, mainCfg.syncConfiguration.exRightSideOnly); + readXmlElementLogging("LeftNewer", syncConfig, mainCfg.syncConfiguration.leftNewer); + readXmlElementLogging("RightNewer", syncConfig, mainCfg.syncConfiguration.rightNewer); + readXmlElementLogging("Different", syncConfig, mainCfg.syncConfiguration.different); + //########################################################### //read filter settings - if (!readXmlElementValue(mainCfg.filterIsActive, filter, "Active")) return false; - - if (!readXmlElementValue(tempString, filter, "Include")) return false; - mainCfg.includeFilter = wxString::FromUTF8(tempString.c_str()); - - if (!readXmlElementValue(tempString, filter, "Exclude")) return false; - mainCfg.excludeFilter = wxString::FromUTF8(tempString.c_str()); + readXmlElementLogging("Active", filter, mainCfg.filterIsActive); + readXmlElementLogging("Include", filter, mainCfg.includeFilter); + readXmlElementLogging("Exclude", filter, mainCfg.excludeFilter); //########################################################### //other - readXmlElementValue(mainCfg.useRecycleBin, miscSettings, "UseRecycler"); - - return true; + readXmlElementLogging("DeletionPolicy", miscSettings, mainCfg.handleDeletion); + readXmlElementLogging("CustomDeletionFolder", miscSettings, mainCfg.customDeletionDirectory); } -bool XmlConfigInput::readXmlGuiConfig(xmlAccess::XmlGuiConfig& outputCfg) +void FfsXmlParser::readXmlGuiConfig(xmlAccess::XmlGuiConfig& outputCfg) { //read main config - if (!readXmlMainConfig(outputCfg.mainCfg, outputCfg.directoryPairs)) - return false; + readXmlMainConfig(outputCfg.mainCfg, outputCfg.directoryPairs); //read GUI specific config data - TiXmlElement* root = doc.RootElement(); - if (!root) return false; + const TiXmlElement* guiConfig = TiXmlHandleConst(root).FirstChild("GuiConfig").ToElement(); - TiXmlHandle hRoot(root); + readXmlElementLogging("HideFiltered", guiConfig, outputCfg.hideFilteredElements); - TiXmlElement* guiConfig = hRoot.FirstChild("GuiConfig").ToElement(); - if (guiConfig) - { - readXmlElementValue(outputCfg.hideFilteredElements, guiConfig, "HideFiltered"); - readXmlElementValue(outputCfg.ignoreErrors, guiConfig, "IgnoreErrors"); - readXmlElementValue(outputCfg.syncPreviewEnabled, guiConfig, "SyncPreviewActive"); - } + xmlAccess::OnError errorHand; + readXmlElementLogging("HandleError", guiConfig, errorHand); + outputCfg.ignoreErrors = errorHand == xmlAccess::ON_ERROR_IGNORE; - return true; + readXmlElementLogging("SyncPreviewActive", guiConfig, outputCfg.syncPreviewEnabled); } -bool XmlConfigInput::readXmlBatchConfig(xmlAccess::XmlBatchConfig& outputCfg) +void FfsXmlParser::readXmlBatchConfig(xmlAccess::XmlBatchConfig& outputCfg) { //read main config - if (!readXmlMainConfig(outputCfg.mainCfg, outputCfg.directoryPairs)) - return false; + readXmlMainConfig(outputCfg.mainCfg, outputCfg.directoryPairs); //read batch specific config - TiXmlElement* root = doc.RootElement(); - if (!root) return false; - - TiXmlHandle hRoot(root); + const TiXmlElement* batchConfig = TiXmlHandleConst(root).FirstChild("BatchConfig").ToElement(); - //read batch settings - TiXmlElement* batchConfig = hRoot.FirstChild("BatchConfig").ToElement(); - if (batchConfig) - { - readXmlElementValue(outputCfg.silent, batchConfig, "Silent"); - - std::string tempString; - if (readXmlElementValue(tempString, batchConfig, "LogfileDirectory")) - outputCfg.logFileDirectory = wxString::FromUTF8(tempString.c_str()); - - readXmlElementValue(outputCfg.handleError, batchConfig, "HandleError"); - } - - return true; + readXmlElementLogging("Silent", batchConfig, outputCfg.silent); + readXmlElementLogging("LogfileDirectory", batchConfig, outputCfg.logFileDirectory); + readXmlElementLogging("HandleError", batchConfig, outputCfg.handleError); } -bool XmlConfigInput::readXmlGlobalSettings(xmlAccess::XmlGlobalSettings& outputCfg) +void FfsXmlParser::readXmlGlobalSettings(xmlAccess::XmlGlobalSettings& outputCfg) { - TiXmlElement* root = doc.RootElement(); - if (!root) return false; - - TiXmlHandle hRoot(root); - //read global settings - TiXmlElement* global = hRoot.FirstChild("Shared").ToElement(); - if (global) - { - //try to read program language setting - readXmlElementValue(outputCfg.programLanguage, global, "Language"); - - //max. allowed file time deviation - int dummy = 0; - if (readXmlElementValue(dummy, global, "FileTimeTolerance")) - outputCfg.fileTimeTolerance = dummy; - - //ignore +/- 1 hour due to DST change - readXmlElementValue(outputCfg.ignoreOneHourDiff, global, "IgnoreOneHourDifference"); + const TiXmlElement* global = TiXmlHandleConst(root).FirstChild("Shared").ToElement(); - //traverse into symbolic links (to folders) - readXmlElementValue(outputCfg.traverseDirectorySymlinks, global, "TraverseDirectorySymlinks"); + //try to read program language setting + readXmlElementLogging("Language", global, outputCfg.programLanguage); - //copy symbolic links to files - readXmlElementValue(outputCfg.copyFileSymlinks, global, "CopyFileSymlinks"); - - //last update check - readXmlElementValue(outputCfg.lastUpdateCheck, global, "LastCheckForUpdates"); - } + //max. allowed file time deviation + readXmlElementLogging("FileTimeTolerance", global, outputCfg.fileTimeTolerance); - TiXmlElement* warnings = hRoot.FirstChild("Shared").FirstChild("Warnings").ToElement(); - if (warnings) - { - //folder dependency check - readXmlElementValue(outputCfg.warnings.warningDependentFolders, warnings, "CheckForDependentFolders"); + //ignore +/- 1 hour due to DST change + readXmlElementLogging("IgnoreOneHourDifference", global, outputCfg.ignoreOneHourDiff); - //significant difference check - readXmlElementValue(outputCfg.warnings.warningSignificantDifference, warnings, "CheckForSignificantDifference"); + //traverse into symbolic links (to folders) + readXmlElementLogging("TraverseDirectorySymlinks", global, outputCfg.traverseDirectorySymlinks); - //check free disk space - readXmlElementValue(outputCfg.warnings.warningNotEnoughDiskSpace, warnings, "CheckForFreeDiskSpace"); + //copy symbolic links to files + readXmlElementLogging("CopyFileSymlinks", global, outputCfg.copyFileSymlinks); - //check for unresolved conflicts - readXmlElementValue(outputCfg.warnings.warningUnresolvedConflicts, warnings, "CheckForUnresolvedConflicts"); + //last update check + readXmlElementLogging("LastCheckForUpdates", global, outputCfg.lastUpdateCheck); - //check for very old dates or dates in the future - readXmlElementValue(outputCfg.warnings.warningInvalidDate, warnings, "CheckForInvalidFileDate"); - //check for changed files with same modification date - readXmlElementValue(outputCfg.warnings.warningSameDateDiffSize, warnings, "SameDateDifferentFileSize"); + const TiXmlElement* warnings = TiXmlHandleConst(root).FirstChild("Shared").FirstChild("Warnings").ToElement(); - //check for files that have a difference in file modification date below 1 hour when DST check is active - readXmlElementValue(outputCfg.warnings.warningDSTChangeWithinHour, warnings, "FileChangeWithinHour"); - } + //folder dependency check + readXmlElementLogging("CheckForDependentFolders", warnings, outputCfg.warnings.warningDependentFolders); + //significant difference check + readXmlElementLogging("CheckForSignificantDifference", warnings, outputCfg.warnings.warningSignificantDifference); + //check free disk space + readXmlElementLogging("CheckForFreeDiskSpace", warnings, outputCfg.warnings.warningNotEnoughDiskSpace); + //check for unresolved conflicts + readXmlElementLogging("CheckForUnresolvedConflicts", warnings, outputCfg.warnings.warningUnresolvedConflicts); //gui specific global settings (optional) - TiXmlElement* mainWindow = hRoot.FirstChild("Gui").FirstChild("Windows").FirstChild("Main").ToElement(); - if (mainWindow) - { - //read application window size and position - readXmlElementValue(outputCfg.gui.widthNotMaximized, mainWindow, "Width"); - readXmlElementValue(outputCfg.gui.heightNotMaximized, mainWindow, "Height"); - readXmlElementValue(outputCfg.gui.posXNotMaximized, mainWindow, "PosX"); - readXmlElementValue(outputCfg.gui.posYNotMaximized, mainWindow, "PosY"); - readXmlElementValue(outputCfg.gui.isMaximized, mainWindow, "Maximized"); - - readXmlElementValue(outputCfg.gui.deleteOnBothSides, mainWindow, "ManualDeletionOnBothSides"); - readXmlElementValue(outputCfg.gui.useRecyclerForManualDeletion, mainWindow, "ManualDeletionUseRecycler"); - readXmlElementValue(outputCfg.gui.showFileIconsLeft, mainWindow, "ShowFileIconsLeft"); - readXmlElementValue(outputCfg.gui.showFileIconsRight, mainWindow, "ShowFileIconsRight"); - readXmlElementValue(outputCfg.gui.popupOnConfigChange, mainWindow, "PopupOnConfigChange"); - readXmlElementValue(outputCfg.gui.showSummaryBeforeSync, mainWindow, "SummaryBeforeSync"); + const TiXmlElement* mainWindow = TiXmlHandleConst(root).FirstChild("Gui").FirstChild("Windows").FirstChild("Main").ToElement(); + + //read application window size and position + readXmlElementLogging("Width", mainWindow, outputCfg.gui.widthNotMaximized); + readXmlElementLogging("Height", mainWindow, outputCfg.gui.heightNotMaximized); + readXmlElementLogging("PosX", mainWindow, outputCfg.gui.posXNotMaximized); + readXmlElementLogging("PosY", mainWindow, outputCfg.gui.posYNotMaximized); + readXmlElementLogging("Maximized", mainWindow, outputCfg.gui.isMaximized); + + readXmlElementLogging("ManualDeletionOnBothSides", mainWindow, outputCfg.gui.deleteOnBothSides); + readXmlElementLogging("ManualDeletionUseRecycler", mainWindow, outputCfg.gui.useRecyclerForManualDeletion); + readXmlElementLogging("ShowFileIconsLeft", mainWindow, outputCfg.gui.showFileIconsLeft); + readXmlElementLogging("ShowFileIconsRight", mainWindow, outputCfg.gui.showFileIconsRight); + readXmlElementLogging("PopupOnConfigChange", mainWindow, outputCfg.gui.popupOnConfigChange); + readXmlElementLogging("SummaryBeforeSync", mainWindow, outputCfg.gui.showSummaryBeforeSync); //########################################################### - //read column attributes - TiXmlElement* leftColumn = TiXmlHandle(mainWindow).FirstChild("LeftColumns").FirstChild("Column").ToElement(); - unsigned int colPos = 0; - while (leftColumn) - { - const char* type = leftColumn->Attribute("Type"); - const char* visible = leftColumn->Attribute("Visible"); - const char* width = leftColumn->Attribute("Width"); - - if (type && visible && width) //may be NULL!! - { - xmlAccess::ColumnAttrib newAttrib; - newAttrib.type = xmlAccess::ColumnTypes(globalFunctions::stringToInt(type)); - newAttrib.visible = std::string(visible) != std::string("false"); - newAttrib.position = colPos; - newAttrib.width = globalFunctions::stringToInt(width); - outputCfg.gui.columnAttribLeft.push_back(newAttrib); - } - else - break; - - leftColumn = leftColumn->NextSiblingElement(); - ++colPos; - } - - TiXmlElement* rightColumn = TiXmlHandle(mainWindow).FirstChild("RightColumns").FirstChild("Column").ToElement(); - colPos = 0; - while (rightColumn) - { - const char* type = rightColumn->Attribute("Type"); - const char* visible = rightColumn->Attribute("Visible"); - const char* width = rightColumn->Attribute("Width"); - - if (type && visible && width) //may be NULL!! - { - xmlAccess::ColumnAttrib newAttrib; - newAttrib.type = xmlAccess::ColumnTypes(globalFunctions::stringToInt(type)); - newAttrib.visible = std::string(visible) != std::string("false"); - newAttrib.position = colPos; - newAttrib.width = globalFunctions::stringToInt(width); - outputCfg.gui.columnAttribRight.push_back(newAttrib); - } - else - break; - - rightColumn = rightColumn->NextSiblingElement(); - ++colPos; - } - - //load folder history elements - const TiXmlElement* historyLeft = TiXmlHandle(mainWindow).FirstChild("FolderHistoryLeft").ToElement(); - if (historyLeft) - { - //load max. history size - const char* histSizeMax = historyLeft->Attribute("MaximumSize"); - if (histSizeMax) //may be NULL! - outputCfg.gui.folderHistLeftMax = globalFunctions::stringToInt(histSizeMax); - - //load config history elements - readXmlElementTable(outputCfg.gui.folderHistoryLeft, historyLeft, "Folder"); - } - - const TiXmlElement* historyRight = TiXmlHandle(mainWindow).FirstChild("FolderHistoryRight").ToElement(); - if (historyRight) - { - //load max. history size - const char* histSizeMax = historyRight->Attribute("MaximumSize"); - if (histSizeMax) //may be NULL! - outputCfg.gui.folderHistRightMax = globalFunctions::stringToInt(histSizeMax); - - //load config history elements - readXmlElementTable(outputCfg.gui.folderHistoryRight, historyRight, "Folder"); - } - - readXmlElementValue(outputCfg.gui.selectedTabBottomLeft, mainWindow, "SelectedTabBottomLeft"); - } + //read column attributes + readXmlAttributeLogging("AutoAdjust", TiXmlHandleConst(mainWindow).FirstChild("LeftColumns").ToElement(), outputCfg.gui.autoAdjustColumnsLeft); - TiXmlElement* gui = hRoot.FirstChild("Gui").ToElement(); - if (gui) + const TiXmlElement* leftColumn = TiXmlHandleConst(mainWindow).FirstChild("LeftColumns").FirstChild("Column").ToElement(); + unsigned int colPos = 0; + while (leftColumn) { - //commandline for file manager integration - std::string tempString; - if (readXmlElementValue(tempString, gui, "FileManager")) - outputCfg.gui.commandLineFileManager = wxString::FromUTF8(tempString.c_str()); + xmlAccess::ColumnAttrib newAttrib; + newAttrib.position = colPos++; + readXmlAttributeLogging("Type", leftColumn, newAttrib.type); + readXmlAttributeLogging("Visible", leftColumn, newAttrib.visible); + readXmlAttributeLogging("Width", leftColumn, newAttrib.width); + outputCfg.gui.columnAttribLeft.push_back(newAttrib); + + leftColumn = leftColumn->NextSiblingElement(); } - //load config file history - TiXmlElement* cfgHistory = hRoot.FirstChild("Gui").FirstChild("ConfigHistory").ToElement(); - if (cfgHistory) - { - //load max. history size - const char* histSizeMax = cfgHistory->Attribute("MaximumSize"); - if (histSizeMax) //may be NULL! - outputCfg.gui.cfgHistoryMax = globalFunctions::stringToInt(histSizeMax); + readXmlAttributeLogging("AutoAdjust", TiXmlHandleConst(mainWindow).FirstChild("RightColumns").ToElement(), outputCfg.gui.autoAdjustColumnsRight); - //load config history elements - readXmlElementTable(outputCfg.gui.cfgFileHistory, cfgHistory, "File"); + const TiXmlElement* rightColumn = TiXmlHandleConst(mainWindow).FirstChild("RightColumns").FirstChild("Column").ToElement(); + colPos = 0; + while (rightColumn) + { + xmlAccess::ColumnAttrib newAttrib; + newAttrib.position = colPos++; + readXmlAttributeLogging("Type", rightColumn, newAttrib.type); + readXmlAttributeLogging("Visible", rightColumn, newAttrib.visible); + readXmlAttributeLogging("Width", rightColumn, newAttrib.width); + outputCfg.gui.columnAttribRight.push_back(newAttrib); + + rightColumn = rightColumn->NextSiblingElement(); } + //load folder history elements + const TiXmlElement* historyLeft = TiXmlHandleConst(mainWindow).FirstChild("FolderHistoryLeft").ToElement(); + //load max. history size + readXmlAttributeLogging("MaximumSize", historyLeft, outputCfg.gui.folderHistLeftMax); + //load config history elements + readXmlElementLogging("Folder", historyLeft, outputCfg.gui.folderHistoryLeft); -//batch specific global settings - TiXmlElement* batch = hRoot.FirstChild("Batch").ToElement(); - if (!batch) return false; - return true; -} + const TiXmlElement* historyRight = TiXmlHandleConst(mainWindow).FirstChild("FolderHistoryRight").ToElement(); + //load max. history size + readXmlAttributeLogging("MaximumSize", historyRight, outputCfg.gui.folderHistRightMax); + //load config history elements + readXmlElementLogging("Folder", historyRight, outputCfg.gui.folderHistoryRight); -XmlConfigOutput::XmlConfigOutput(const wxString& fileName, const xmlAccess::XmlType type) : - m_fileName(fileName) -{ - TiXmlBase::SetCondenseWhiteSpace(false); //do not condense whitespace characters - - TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "UTF-8", ""); //delete won't be necessary later; ownership passed to TiXmlDocument! - doc.LinkEndChild(decl); - - TiXmlElement* root = new TiXmlElement("FreeFileSync"); - if (type == xmlAccess::XML_GUI_CONFIG) - root->SetAttribute("XmlType", "GUI"); //xml configuration type - else if (type == xmlAccess::XML_BATCH_CONFIG) - root->SetAttribute("XmlType", "BATCH"); - else if (type == xmlAccess::XML_GLOBAL_SETTINGS) - root->SetAttribute("XmlType", "GLOBAL"); - else - assert(false); - doc.LinkEndChild(root); -} + readXmlElementLogging("SelectedTabBottomLeft", mainWindow, outputCfg.gui.selectedTabBottomLeft); -bool XmlConfigOutput::writeToFile() -{ - //workaround to get a FILE* from a unicode filename - wxFFile dummyFile(m_fileName, wxT("w")); //no need for "binary" mode here - if (!dummyFile.IsOpened()) - return false; + const TiXmlElement* gui = TiXmlHandleConst(root).FirstChild("Gui").ToElement(); - FILE* outputFile = dummyFile.fp(); + //commandline for file manager integration + readXmlElementLogging("FileManager", gui, outputCfg.gui.commandLineFileManager); - return doc.SaveFile(outputFile); //save XML -} + //load config file history + const TiXmlElement* cfgHistory = TiXmlHandleConst(root).FirstChild("Gui").FirstChild("ConfigHistory").ToElement(); -void addXmlElement(TiXmlElement* parent, const std::string& name, const std::string& value) -{ - if (parent) - { - TiXmlElement* subElement = new TiXmlElement(name); - parent->LinkEndChild(subElement); - subElement->LinkEndChild(new TiXmlText(value)); - } -} + //load max. history size + readXmlAttributeLogging("MaximumSize", cfgHistory, outputCfg.gui.cfgHistoryMax); + //load config history elements + readXmlElementLogging("File", cfgHistory, outputCfg.gui.cfgFileHistory); -void addXmlElement(TiXmlElement* parent, const std::string& name, const int value) -{ - addXmlElement(parent, name, globalFunctions::numberToString(value)); + + //batch specific global settings + //const TiXmlElement* batch = TiXmlHandleConst(root).FirstChild("Batch").ToElement(); } -void addXmlElement(TiXmlElement* parent, const std::string& name, const long value) +void addXmlElement(const std::string& name, const CompareVariant variant, TiXmlElement* parent) { - addXmlElement(parent, name, globalFunctions::numberToString(value)); + switch (variant) + { + case FreeFileSync::CMP_BY_TIME_SIZE: + xmlAccess::addXmlElement(name, std::string("ByTimeAndSize"), parent); + break; + case FreeFileSync::CMP_BY_CONTENT: + xmlAccess::addXmlElement(name, std::string("ByContent"), parent); + break; + } } -void addXmlElement(TiXmlElement* parent, const std::string& name, const SyncDirection value) +void addXmlElement(TiXmlElement* parent, const std::string& name, const SyncDirectionCfg value) { - if (value == SYNC_DIR_LEFT) - addXmlElement(parent, name, std::string("left")); - else if (value == SYNC_DIR_RIGHT) - addXmlElement(parent, name, std::string("right")); - else if (value == SYNC_DIR_NONE) - addXmlElement(parent, name, std::string("none")); - else - assert(false); + switch (value) + { + case SYNC_DIR_CFG_LEFT: + xmlAccess::addXmlElement(name, std::string("left"), parent); + break; + case SYNC_DIR_CFG_RIGHT: + xmlAccess::addXmlElement(name, std::string("right"), parent); + break; + case SYNC_DIR_CFG_NONE: + xmlAccess::addXmlElement(name, std::string("none"), parent); + break; + } } -void addXmlElement(TiXmlElement* parent, const std::string& name, const bool value) +void addXmlElement(const std::string& name, const xmlAccess::OnError value, TiXmlElement* parent) { - if (value) - addXmlElement(parent, name, std::string("true")); - else - addXmlElement(parent, name, std::string("false")); + switch (value) + { + case xmlAccess::ON_ERROR_IGNORE: + xmlAccess::addXmlElement(name, std::string("Ignore"), parent); + break; + case xmlAccess::ON_ERROR_EXIT: + xmlAccess::addXmlElement(name, std::string("Exit"), parent); + break; + case xmlAccess::ON_ERROR_POPUP: + xmlAccess::addXmlElement(name, std::string("Popup"), parent); + break; + } } -void addXmlElement(TiXmlElement* parent, const std::string& name, const xmlAccess::OnError value) +void addXmlElement(const std::string& name, const FreeFileSync::DeletionPolicy value, TiXmlElement* parent) { - if (value == xmlAccess::ON_ERROR_IGNORE) - addXmlElement(parent, name, std::string("Ignore")); - else if (value == xmlAccess::ON_ERROR_EXIT) - addXmlElement(parent, name, std::string("Exit")); - else if (value == xmlAccess::ON_ERROR_POPUP) - addXmlElement(parent, name, std::string("Popup")); - else - assert(false); + switch (value) + { + case FreeFileSync::DELETE_PERMANENTLY: + xmlAccess::addXmlElement(name, std::string("DeletePermanently"), parent); + break; + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + xmlAccess::addXmlElement(name, std::string("MoveToRecycleBin"), parent); + break; + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + xmlAccess::addXmlElement(name, std::string("MoveToCustomDirectory"), parent); + break; + } } -void addXmlElementTable(TiXmlElement* parent, const std::string& name, const std::vector<wxString>& input) +void addXmlAttribute(const std::string& name, const xmlAccess::ColumnTypes value, TiXmlElement* node) { - for (std::vector<wxString>::const_iterator i = input.begin(); i != input.end(); ++i) - addXmlElement(parent, name, std::string(i->ToUTF8())); + xmlAccess::addXmlAttribute(name, static_cast<int>(value), node); } -bool XmlConfigOutput::writeXmlMainConfig(const MainConfiguration& mainCfg, const std::vector<FolderPair>& directoryPairs) +bool writeXmlMainConfig(const MainConfiguration& mainCfg, const std::vector<FolderPair>& directoryPairs, TiXmlDocument& doc) { TiXmlElement* root = doc.RootElement(); if (!root) return false; @@ -790,7 +519,7 @@ bool XmlConfigOutput::writeXmlMainConfig(const MainConfiguration& mainCfg, const settings->LinkEndChild(cmpSettings); //write compare algorithm - addXmlElement(cmpSettings, "Variant", mainCfg.compareVar); + ::addXmlElement("Variant", mainCfg.compareVar, cmpSettings); //write folder pair(s) TiXmlElement* folders = new TiXmlElement("Folders"); @@ -802,8 +531,8 @@ bool XmlConfigOutput::writeXmlMainConfig(const MainConfiguration& mainCfg, const TiXmlElement* folderPair = new TiXmlElement("Pair"); folders->LinkEndChild(folderPair); - addXmlElement(folderPair, "Left", std::string(wxString(i->leftDirectory.c_str()).ToUTF8())); - addXmlElement(folderPair, "Right", std::string(wxString(i->rightDirectory.c_str()).ToUTF8())); + xmlAccess::addXmlElement("Left", wxString(i->leftDirectory.c_str()), folderPair); + xmlAccess::addXmlElement("Right", wxString(i->rightDirectory.c_str()), folderPair); } //########################################################### @@ -814,11 +543,11 @@ bool XmlConfigOutput::writeXmlMainConfig(const MainConfiguration& mainCfg, const TiXmlElement* syncConfig = new TiXmlElement("Directions"); syncSettings->LinkEndChild(syncConfig); - addXmlElement(syncConfig, "LeftOnly", mainCfg.syncConfiguration.exLeftSideOnly); - addXmlElement(syncConfig, "RightOnly", mainCfg.syncConfiguration.exRightSideOnly); - addXmlElement(syncConfig, "LeftNewer", mainCfg.syncConfiguration.leftNewer); - addXmlElement(syncConfig, "RightNewer", mainCfg.syncConfiguration.rightNewer); - addXmlElement(syncConfig, "Different", mainCfg.syncConfiguration.different); + ::addXmlElement(syncConfig, "LeftOnly", mainCfg.syncConfiguration.exLeftSideOnly); + ::addXmlElement(syncConfig, "RightOnly", mainCfg.syncConfiguration.exRightSideOnly); + ::addXmlElement(syncConfig, "LeftNewer", mainCfg.syncConfiguration.leftNewer); + ::addXmlElement(syncConfig, "RightNewer", mainCfg.syncConfiguration.rightNewer); + ::addXmlElement(syncConfig, "Different", mainCfg.syncConfiguration.different); //########################################################### TiXmlElement* miscSettings = new TiXmlElement("Miscellaneous"); @@ -828,22 +557,23 @@ bool XmlConfigOutput::writeXmlMainConfig(const MainConfiguration& mainCfg, const TiXmlElement* filter = new TiXmlElement("Filter"); miscSettings->LinkEndChild(filter); - addXmlElement(filter, "Active", mainCfg.filterIsActive); - addXmlElement(filter, "Include", std::string((mainCfg.includeFilter).ToUTF8())); - addXmlElement(filter, "Exclude", std::string((mainCfg.excludeFilter).ToUTF8())); + xmlAccess::addXmlElement("Active", mainCfg.filterIsActive, filter); + xmlAccess::addXmlElement("Include", mainCfg.includeFilter, filter); + xmlAccess::addXmlElement("Exclude", mainCfg.excludeFilter, filter); //other - addXmlElement(miscSettings, "UseRecycler", mainCfg.useRecycleBin); + addXmlElement("DeletionPolicy", mainCfg.handleDeletion, miscSettings); + xmlAccess::addXmlElement("CustomDeletionFolder", mainCfg.customDeletionDirectory, miscSettings); //########################################################### return true; } -bool XmlConfigOutput::writeXmlGuiConfig(const xmlAccess::XmlGuiConfig& inputCfg) +bool writeXmlGuiConfig(const xmlAccess::XmlGuiConfig& inputCfg, TiXmlDocument& doc) { //write main config - if (!writeXmlMainConfig(inputCfg.mainCfg, inputCfg.directoryPairs)) + if (!writeXmlMainConfig(inputCfg.mainCfg, inputCfg.directoryPairs, doc)) return false; //write GUI specific config @@ -853,18 +583,20 @@ bool XmlConfigOutput::writeXmlGuiConfig(const xmlAccess::XmlGuiConfig& inputCfg) TiXmlElement* guiConfig = new TiXmlElement("GuiConfig"); root->LinkEndChild(guiConfig); - addXmlElement(guiConfig, "HideFiltered", inputCfg.hideFilteredElements); - addXmlElement(guiConfig, "IgnoreErrors", inputCfg.ignoreErrors); - addXmlElement(guiConfig, "SyncPreviewActive", inputCfg.syncPreviewEnabled); + xmlAccess::addXmlElement("HideFiltered", inputCfg.hideFilteredElements, guiConfig); + + ::addXmlElement("HandleError", inputCfg.ignoreErrors ? xmlAccess::ON_ERROR_IGNORE : xmlAccess::ON_ERROR_POPUP, guiConfig); + + xmlAccess::addXmlElement("SyncPreviewActive", inputCfg.syncPreviewEnabled, guiConfig); return true; } -bool XmlConfigOutput::writeXmlBatchConfig(const xmlAccess::XmlBatchConfig& inputCfg) +bool writeXmlBatchConfig(const xmlAccess::XmlBatchConfig& inputCfg, TiXmlDocument& doc) { //write main config - if (!writeXmlMainConfig(inputCfg.mainCfg, inputCfg.directoryPairs)) + if (!writeXmlMainConfig(inputCfg.mainCfg, inputCfg.directoryPairs, doc)) return false; //write GUI specific config @@ -874,15 +606,15 @@ bool XmlConfigOutput::writeXmlBatchConfig(const xmlAccess::XmlBatchConfig& input TiXmlElement* batchConfig = new TiXmlElement("BatchConfig"); root->LinkEndChild(batchConfig); - addXmlElement(batchConfig, "Silent", inputCfg.silent); - addXmlElement(batchConfig, "LogfileDirectory", std::string(inputCfg.logFileDirectory.ToUTF8())); - addXmlElement(batchConfig, "HandleError", inputCfg.handleError); + xmlAccess::addXmlElement("Silent", inputCfg.silent, batchConfig); + xmlAccess::addXmlElement("LogfileDirectory", inputCfg.logFileDirectory, batchConfig); + ::addXmlElement("HandleError", inputCfg.handleError, batchConfig); return true; } -bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& inputCfg) +bool writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& inputCfg, TiXmlDocument& doc) { TiXmlElement* root = doc.RootElement(); if (!root) return false; @@ -893,47 +625,38 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& root->LinkEndChild(global); //program language - addXmlElement(global, "Language", inputCfg.programLanguage); + xmlAccess::addXmlElement("Language", inputCfg.programLanguage, global); //max. allowed file time deviation - addXmlElement(global, "FileTimeTolerance", int(inputCfg.fileTimeTolerance)); + xmlAccess::addXmlElement("FileTimeTolerance", inputCfg.fileTimeTolerance, global); //ignore +/- 1 hour due to DST change - addXmlElement(global, "IgnoreOneHourDifference", inputCfg.ignoreOneHourDiff); + xmlAccess::addXmlElement("IgnoreOneHourDifference", inputCfg.ignoreOneHourDiff, global); //traverse into symbolic links (to folders) - addXmlElement(global, "TraverseDirectorySymlinks", inputCfg.traverseDirectorySymlinks); + xmlAccess::addXmlElement("TraverseDirectorySymlinks", inputCfg.traverseDirectorySymlinks, global); //copy symbolic links to files - addXmlElement(global, "CopyFileSymlinks", inputCfg.copyFileSymlinks); + xmlAccess::addXmlElement("CopyFileSymlinks", inputCfg.copyFileSymlinks, global); //last update check - addXmlElement(global, "LastCheckForUpdates", inputCfg.lastUpdateCheck); + xmlAccess::addXmlElement("LastCheckForUpdates", inputCfg.lastUpdateCheck, global); //warnings TiXmlElement* warnings = new TiXmlElement("Warnings"); global->LinkEndChild(warnings); //warning: dependent folders - addXmlElement(warnings, "CheckForDependentFolders", inputCfg.warnings.warningDependentFolders); + xmlAccess::addXmlElement("CheckForDependentFolders", inputCfg.warnings.warningDependentFolders, warnings); //significant difference check - addXmlElement(warnings, "CheckForSignificantDifference", inputCfg.warnings.warningSignificantDifference); + xmlAccess::addXmlElement("CheckForSignificantDifference", inputCfg.warnings.warningSignificantDifference, warnings); //check free disk space - addXmlElement(warnings, "CheckForFreeDiskSpace", inputCfg.warnings.warningNotEnoughDiskSpace); + xmlAccess::addXmlElement("CheckForFreeDiskSpace", inputCfg.warnings.warningNotEnoughDiskSpace, warnings); //check for unresolved conflicts - addXmlElement(warnings, "CheckForUnresolvedConflicts", inputCfg.warnings.warningUnresolvedConflicts); - - //check for very old dates or dates in the future - addXmlElement(warnings, "CheckForInvalidFileDate", inputCfg.warnings.warningInvalidDate); - - //check for changed files with same modification date - addXmlElement(warnings, "SameDateDifferentFileSize", inputCfg.warnings.warningSameDateDiffSize); - - //check for files that have a difference in file modification date below 1 hour when DST check is active - addXmlElement(warnings, "FileChangeWithinHour", inputCfg.warnings.warningDSTChangeWithinHour); + xmlAccess::addXmlElement("CheckForUnresolvedConflicts", inputCfg.warnings.warningUnresolvedConflicts, warnings); //################################################################### @@ -948,24 +671,27 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& windows->LinkEndChild(mainWindow); //window size - addXmlElement(mainWindow, "Width", inputCfg.gui.widthNotMaximized); - addXmlElement(mainWindow, "Height", inputCfg.gui.heightNotMaximized); + xmlAccess::addXmlElement("Width", inputCfg.gui.widthNotMaximized, mainWindow); + xmlAccess::addXmlElement("Height", inputCfg.gui.heightNotMaximized, mainWindow); //window position - addXmlElement(mainWindow, "PosX", inputCfg.gui.posXNotMaximized); - addXmlElement(mainWindow, "PosY", inputCfg.gui.posYNotMaximized); - addXmlElement(mainWindow, "Maximized", inputCfg.gui.isMaximized); + xmlAccess::addXmlElement("PosX", inputCfg.gui.posXNotMaximized, mainWindow); + xmlAccess::addXmlElement("PosY", inputCfg.gui.posYNotMaximized, mainWindow); + xmlAccess::addXmlElement("Maximized", inputCfg.gui.isMaximized, mainWindow); - addXmlElement(mainWindow, "ManualDeletionOnBothSides", inputCfg.gui.deleteOnBothSides); - addXmlElement(mainWindow, "ManualDeletionUseRecycler", inputCfg.gui.useRecyclerForManualDeletion); - addXmlElement(mainWindow, "ShowFileIconsLeft", inputCfg.gui.showFileIconsLeft); - addXmlElement(mainWindow, "ShowFileIconsRight", inputCfg.gui.showFileIconsRight); - addXmlElement(mainWindow, "PopupOnConfigChange", inputCfg.gui.popupOnConfigChange); - addXmlElement(mainWindow, "SummaryBeforeSync", inputCfg.gui.showSummaryBeforeSync); + xmlAccess::addXmlElement("ManualDeletionOnBothSides", inputCfg.gui.deleteOnBothSides, mainWindow); + xmlAccess::addXmlElement("ManualDeletionUseRecycler", inputCfg.gui.useRecyclerForManualDeletion, mainWindow); + xmlAccess::addXmlElement("ShowFileIconsLeft", inputCfg.gui.showFileIconsLeft, mainWindow); + xmlAccess::addXmlElement("ShowFileIconsRight", inputCfg.gui.showFileIconsRight, mainWindow); + xmlAccess::addXmlElement("PopupOnConfigChange", inputCfg.gui.popupOnConfigChange, mainWindow); + xmlAccess::addXmlElement("SummaryBeforeSync", inputCfg.gui.showSummaryBeforeSync, mainWindow); //write column attributes TiXmlElement* leftColumn = new TiXmlElement("LeftColumns"); mainWindow->LinkEndChild(leftColumn); + + xmlAccess::addXmlAttribute("AutoAdjust", inputCfg.gui.autoAdjustColumnsLeft, leftColumn); + xmlAccess::ColumnAttributes columnAtrribLeftCopy = inputCfg.gui.columnAttribLeft; //can't change const vector sort(columnAtrribLeftCopy.begin(), columnAtrribLeftCopy.end(), xmlAccess::sortByPositionOnly); for (unsigned int i = 0; i < columnAtrribLeftCopy.size(); ++i) @@ -974,14 +700,16 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& leftColumn->LinkEndChild(subElement); const xmlAccess::ColumnAttrib& colAttrib = columnAtrribLeftCopy[i]; - subElement->SetAttribute("Type", colAttrib.type); - if (colAttrib.visible) subElement->SetAttribute("Visible", "true"); - else subElement->SetAttribute("Visible", "false"); - subElement->SetAttribute("Width", colAttrib.width); + addXmlAttribute("Type", colAttrib.type, subElement); + xmlAccess::addXmlAttribute("Visible", colAttrib.visible, subElement); + xmlAccess::addXmlAttribute("Width", colAttrib.width, subElement); } TiXmlElement* rightColumn = new TiXmlElement("RightColumns"); mainWindow->LinkEndChild(rightColumn); + + xmlAccess::addXmlAttribute("AutoAdjust", inputCfg.gui.autoAdjustColumnsRight, rightColumn); + xmlAccess::ColumnAttributes columnAtrribRightCopy = inputCfg.gui.columnAttribRight; sort(columnAtrribRightCopy.begin(), columnAtrribRightCopy.end(), xmlAccess::sortByPositionOnly); for (unsigned int i = 0; i < columnAtrribRightCopy.size(); ++i) @@ -990,10 +718,9 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& rightColumn->LinkEndChild(subElement); const xmlAccess::ColumnAttrib& colAttrib = columnAtrribRightCopy[i]; - subElement->SetAttribute("Type", colAttrib.type); - if (colAttrib.visible) subElement->SetAttribute("Visible", "true"); - else subElement->SetAttribute("Visible", "false"); - subElement->SetAttribute("Width", colAttrib.width); + addXmlAttribute("Type", colAttrib.type, subElement); + xmlAccess::addXmlAttribute("Visible", colAttrib.visible, subElement); + xmlAccess::addXmlAttribute("Width", colAttrib.width, subElement); } //write folder history elements @@ -1002,23 +729,23 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& TiXmlElement* historyRight = new TiXmlElement("FolderHistoryRight"); mainWindow->LinkEndChild(historyRight); - historyLeft->SetAttribute("MaximumSize", globalFunctions::numberToString(inputCfg.gui.folderHistLeftMax)); - addXmlElementTable(historyLeft, "Folder", inputCfg.gui.folderHistoryLeft); + xmlAccess::addXmlAttribute("MaximumSize", inputCfg.gui.folderHistLeftMax, historyLeft); + xmlAccess::addXmlAttribute("MaximumSize", inputCfg.gui.folderHistRightMax, historyRight); - historyRight->SetAttribute("MaximumSize", globalFunctions::numberToString(inputCfg.gui.folderHistRightMax)); - addXmlElementTable(historyRight, "Folder", inputCfg.gui.folderHistoryRight); + xmlAccess::addXmlElement("Folder", inputCfg.gui.folderHistoryLeft, historyLeft); + xmlAccess::addXmlElement("Folder", inputCfg.gui.folderHistoryRight, historyRight); - addXmlElement(mainWindow, "SelectedTabBottomLeft", inputCfg.gui.selectedTabBottomLeft); + xmlAccess::addXmlElement("SelectedTabBottomLeft", inputCfg.gui.selectedTabBottomLeft, mainWindow); //commandline for file manager integration - addXmlElement(gui, "FileManager", std::string((inputCfg.gui.commandLineFileManager).ToUTF8())); + xmlAccess::addXmlElement("FileManager", inputCfg.gui.commandLineFileManager, gui); //write config file history TiXmlElement* cfgHistory = new TiXmlElement("ConfigHistory"); gui->LinkEndChild(cfgHistory); - cfgHistory->SetAttribute("MaximumSize", globalFunctions::numberToString(inputCfg.gui.cfgHistoryMax)); - addXmlElementTable(cfgHistory, "File", inputCfg.gui.cfgFileHistory); + xmlAccess::addXmlAttribute("MaximumSize", inputCfg.gui.cfgHistoryMax, cfgHistory); + xmlAccess::addXmlElement("File", inputCfg.gui.cfgFileHistory, cfgHistory); //################################################################### //write global batch settings @@ -1032,98 +759,13 @@ bool XmlConfigOutput::writeXmlGlobalSettings(const xmlAccess::XmlGlobalSettings& int xmlAccess::retrieveSystemLanguage() { - const int lang = wxLocale::GetSystemLanguage(); - - switch (lang) //map language dialects - { - //variants of wxLANGUAGE_GERMAN - case wxLANGUAGE_GERMAN_AUSTRIAN: - case wxLANGUAGE_GERMAN_BELGIUM: - case wxLANGUAGE_GERMAN_LIECHTENSTEIN: - case wxLANGUAGE_GERMAN_LUXEMBOURG: - case wxLANGUAGE_GERMAN_SWISS: - return wxLANGUAGE_GERMAN; - - //variants of wxLANGUAGE_FRENCH - case wxLANGUAGE_FRENCH_BELGIAN: - case wxLANGUAGE_FRENCH_CANADIAN: - case wxLANGUAGE_FRENCH_LUXEMBOURG: - case wxLANGUAGE_FRENCH_MONACO: - case wxLANGUAGE_FRENCH_SWISS: - return wxLANGUAGE_FRENCH; - - //variants of wxLANGUAGE_DUTCH - case wxLANGUAGE_DUTCH_BELGIAN: - return wxLANGUAGE_DUTCH; - - //variants of wxLANGUAGE_ITALIAN - case wxLANGUAGE_ITALIAN_SWISS: - return wxLANGUAGE_ITALIAN; - - //variants of wxLANGUAGE_CHINESE_SIMPLIFIED - case wxLANGUAGE_CHINESE: - case wxLANGUAGE_CHINESE_TRADITIONAL: - case wxLANGUAGE_CHINESE_HONGKONG: - case wxLANGUAGE_CHINESE_MACAU: - case wxLANGUAGE_CHINESE_SINGAPORE: - case wxLANGUAGE_CHINESE_TAIWAN: - return wxLANGUAGE_CHINESE_SIMPLIFIED; - - //variants of wxLANGUAGE_RUSSIAN - case wxLANGUAGE_RUSSIAN_UKRAINE: - return wxLANGUAGE_RUSSIAN; - - //variants of wxLANGUAGE_SPANISH - case wxLANGUAGE_SPANISH_ARGENTINA: - case wxLANGUAGE_SPANISH_BOLIVIA: - case wxLANGUAGE_SPANISH_CHILE: - case wxLANGUAGE_SPANISH_COLOMBIA: - case wxLANGUAGE_SPANISH_COSTA_RICA: - case wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC: - case wxLANGUAGE_SPANISH_ECUADOR: - case wxLANGUAGE_SPANISH_EL_SALVADOR: - case wxLANGUAGE_SPANISH_GUATEMALA: - case wxLANGUAGE_SPANISH_HONDURAS: - case wxLANGUAGE_SPANISH_MEXICAN: - case wxLANGUAGE_SPANISH_MODERN: - case wxLANGUAGE_SPANISH_NICARAGUA: - case wxLANGUAGE_SPANISH_PANAMA: - case wxLANGUAGE_SPANISH_PARAGUAY: - case wxLANGUAGE_SPANISH_PERU: - case wxLANGUAGE_SPANISH_PUERTO_RICO: - case wxLANGUAGE_SPANISH_URUGUAY: - case wxLANGUAGE_SPANISH_US: - case wxLANGUAGE_SPANISH_VENEZUELA: - return wxLANGUAGE_SPANISH; - - //case wxLANGUAGE_JAPANESE: - //case wxLANGUAGE_POLISH: - //case wxLANGUAGE_SLOVENIAN: - //case wxLANGUAGE_HUNGARIAN: - //case wxLANGUAGE_PORTUGUESE: - //case wxLANGUAGE_PORTUGUESE_BRAZILIAN: - - default: - return lang; - } + return wxLocale::GetSystemLanguage(); } -bool xmlAccess::supportForSymbolicLinks() +bool xmlAccess::recycleBinAvailable() { -#ifdef FFS_WIN - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - //symbolic links are supported starting with Vista - if (GetVersionEx(&osvi)) - return osvi.dwMajorVersion > 5; //XP has majorVersion == 5, minorVersion == 1, Vista majorVersion == 6 - - return false; -#elif defined FFS_LINUX - return true; -#endif + return FreeFileSync::recycleBinExists(); } @@ -1133,7 +775,4 @@ void xmlAccess::WarningMessages::resetWarnings() warningSignificantDifference = true; warningNotEnoughDiskSpace = true; warningUnresolvedConflicts = true; - warningInvalidDate = true; - warningSameDateDiffSize = true; - warningDSTChangeWithinHour = true; } diff --git a/library/processXml.h b/library/processXml.h index 15972289..9fad5cd7 100644 --- a/library/processXml.h +++ b/library/processXml.h @@ -2,7 +2,6 @@ #define PROCESSXML_H_INCLUDED #include "../structures.h" -#include "fileHandling.h" namespace xmlAccess { @@ -13,14 +12,6 @@ namespace xmlAccess ON_ERROR_EXIT }; - enum XmlType - { - XML_GUI_CONFIG, - XML_BATCH_CONFIG, - XML_GLOBAL_SETTINGS, - XML_OTHER - }; - enum ColumnTypes { DIRECTORY, @@ -30,7 +21,7 @@ namespace xmlAccess SIZE, DATE }; - const unsigned COLUMN_TYPE_COUNT = 6; + const unsigned int COLUMN_TYPE_COUNT = 6; struct ColumnAttrib { @@ -41,7 +32,6 @@ namespace xmlAccess }; typedef std::vector<ColumnAttrib> ColumnAttributes; - XmlType getXmlType(const wxString& filename); //--------------------------------------------------------------------- struct XmlGuiConfig @@ -60,11 +50,11 @@ namespace xmlAccess bool operator==(const XmlGuiConfig& other) const { - return mainCfg == other.mainCfg && - directoryPairs == other.directoryPairs && - hideFilteredElements == other.hideFilteredElements && - ignoreErrors == other.ignoreErrors && - syncPreviewEnabled == other.syncPreviewEnabled; + return mainCfg == other.mainCfg && + directoryPairs == other.directoryPairs && + hideFilteredElements == other.hideFilteredElements && + ignoreErrors == other.ignoreErrors && + syncPreviewEnabled == other.syncPreviewEnabled; } bool operator!=(const XmlGuiConfig& other) const @@ -87,7 +77,7 @@ namespace xmlAccess }; int retrieveSystemLanguage(); - bool supportForSymbolicLinks(); + bool recycleBinAvailable(); struct WarningMessages @@ -103,9 +93,6 @@ namespace xmlAccess bool warningSignificantDifference; bool warningNotEnoughDiskSpace; bool warningUnresolvedConflicts; - bool warningInvalidDate; - bool warningSameDateDiffSize; - bool warningDSTChangeWithinHour; }; @@ -118,7 +105,7 @@ namespace xmlAccess fileTimeTolerance(2), //default 2s: FAT vs NTFS ignoreOneHourDiff(true), traverseDirectorySymlinks(false), - copyFileSymlinks(supportForSymbolicLinks()), + copyFileSymlinks(true), lastUpdateCheck(0) {} int programLanguage; @@ -126,7 +113,7 @@ namespace xmlAccess bool ignoreOneHourDiff; //ignore +/- 1 hour due to DST change bool traverseDirectorySymlinks; bool copyFileSymlinks; //copy symbolic link instead of target file - long lastUpdateCheck; //time of last update check + long lastUpdateCheck; //time of last update check WarningMessages warnings; @@ -139,17 +126,19 @@ namespace xmlAccess posXNotMaximized(wxDefaultCoord), posYNotMaximized(wxDefaultCoord), isMaximized(false), + autoAdjustColumnsLeft(false), + autoAdjustColumnsRight(false), #ifdef FFS_WIN commandLineFileManager(wxT("explorer /select, %name")), #elif defined FFS_LINUX - commandLineFileManager(wxT("konqueror \"%path\"")), + commandLineFileManager(wxT("konqueror \"%dir\"")), #endif cfgHistoryMax(10), folderHistLeftMax(12), folderHistRightMax(12), selectedTabBottomLeft(0), deleteOnBothSides(false), - useRecyclerForManualDeletion(FreeFileSync::recycleBinExists()), //enable if OS supports it; else user will have to activate first and then get an error message + useRecyclerForManualDeletion(recycleBinAvailable()), //enable if OS supports it; else user will have to activate first and then get an error message showFileIconsLeft(true), showFileIconsRight(true), popupOnConfigChange(true), @@ -164,6 +153,9 @@ namespace xmlAccess ColumnAttributes columnAttribLeft; ColumnAttributes columnAttribRight; + bool autoAdjustColumnsLeft; + bool autoAdjustColumnsRight; + wxString commandLineFileManager; std::vector<wxString> cfgFileHistory; @@ -214,15 +206,13 @@ namespace xmlAccess return a.position < b.position; } + void readGuiConfig( const wxString& filename, XmlGuiConfig& config); //throw (xmlAccess::XmlError); + void readBatchConfig(const wxString& filename, XmlBatchConfig& config); //throw (xmlAccess::XmlError); + void readGlobalSettings( XmlGlobalSettings& config); //throw (xmlAccess::XmlError); - XmlGuiConfig readGuiConfig(const wxString& filename); - XmlBatchConfig readBatchConfig(const wxString& filename); - XmlGlobalSettings readGlobalSettings(); //used for both GUI and batch mode, independent from configuration instance - - void writeGuiConfig(const wxString& filename, const XmlGuiConfig& outputCfg); - void writeBatchConfig(const wxString& filename, const XmlBatchConfig& outputCfg); - void writeGlobalSettings(const XmlGlobalSettings& outputCfg); - + void writeGuiConfig( const XmlGuiConfig& outputCfg, const wxString& filename); //throw (xmlAccess::XmlError); + void writeBatchConfig( const XmlBatchConfig& outputCfg, const wxString& filename); //throw (xmlAccess::XmlError); + void writeGlobalSettings(const XmlGlobalSettings& outputCfg); //throw (xmlAccess::XmlError); } diff --git a/library/resources.cpp b/library/resources.cpp index 38f2a051..3e7b5a4e 100644 --- a/library/resources.cpp +++ b/library/resources.cpp @@ -4,8 +4,9 @@ #include <wx/image.h> #include <wx/icon.h> #include <wx/mstream.h> -#include "globalFunctions.h" -#include "../structures.h" +#include "../shared/globalFunctions.h" +//#include "../shared/systemFunctions.h" +#include "../shared/standardPaths.h" const GlobalResources& GlobalResources::getInstance() @@ -98,16 +99,20 @@ GlobalResources::GlobalResources() bitmapResource[wxT("batch_small.png")] = (bitmapBatchSmall = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("move up.png")] = (bitmapMoveUp = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("move down.png")] = (bitmapMoveDown = new wxBitmap(wxNullBitmap)); - bitmapResource[wxT("checkbox true.png")] = (bitmapCheckBoxTrue = new wxBitmap(wxNullBitmap)); - bitmapResource[wxT("checkbox false.png")] = (bitmapCheckBoxFalse = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("checkbox_true.png")] = (bitmapCheckBoxTrue = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("checkbox_true_focus.png")] = (bitmapCheckBoxTrueFocus = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("checkbox_false.png")] = (bitmapCheckBoxFalse = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("checkbox_false_focus.png")] = (bitmapCheckBoxFalseFocus = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("settings.png")] = (bitmapSettings = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("settings_small.png")] = (bitmapSettingsSmall = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("recycler.png")] = (bitmapRecycler = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("shift.png")] = (bitmapShift = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncConfig.png")] = (bitmapSyncCfg = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("cmpConfig.png")] = (bitmapCmpCfg = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncPreview.png")] = (bitmapPreview = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncPreviewDisabl.png")] = (bitmapPreviewDisabled = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("question.png")] = (bitmapQuestion = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("czechRep.png")] = (bitmapCzechRep = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("china.png")] = (bitmapChina = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("holland.png")] = (bitmapHolland = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("england.png")] = (bitmapEngland = new wxBitmap(wxNullBitmap)); @@ -120,8 +125,16 @@ GlobalResources::GlobalResources() bitmapResource[wxT("portugal.png")] = (bitmapPortugal = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("brazil.png")] = (bitmapBrazil = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("slovakia.png")] = (bitmapSlovakia = new wxBitmap(wxNullBitmap)); - bitmapResource[wxT("spain.png")] = (bitmapSpain = new wxBitmap(wxNullBitmap)); - bitmapResource[wxT("russia.png")] = (bitmapRussia = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("spain.png")] = (bitmapSpain = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("russia.png")] = (bitmapRussia = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncCreateLeftAct.png")] = (bitmapSyncCreateLeftAct = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncCreateLeftDeact.png")] = (bitmapSyncCreateLeftDeact = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncCreateRightAct.png")] = (bitmapSyncCreateRightAct = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncCreateRightDeact.png")] = (bitmapSyncCreateRightDeact = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncDeleteLeftAct.png")] = (bitmapSyncDeleteLeftAct = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncDeleteLeftDeact.png")] = (bitmapSyncDeleteLeftDeact = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncDeleteRightAct.png")] = (bitmapSyncDeleteRightAct = new wxBitmap(wxNullBitmap)); + bitmapResource[wxT("syncDeleteRightDeact.png")] = (bitmapSyncDeleteRightDeact = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncDirLeftAct.png")] = (bitmapSyncDirLeftAct = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncDirLeftDeact.png")] = (bitmapSyncDirLeftDeact = new wxBitmap(wxNullBitmap)); bitmapResource[wxT("syncDirRightAct.png")] = (bitmapSyncDirRightAct = new wxBitmap(wxNullBitmap)); @@ -191,7 +204,7 @@ void loadAnimFromZip(wxZipInputStream& zipInput, wxAnimation* animation) void GlobalResources::load() const { - wxFileInputStream input(FreeFileSync::getInstallationDir() + FreeFileSync::FILE_NAME_SEPARATOR + wxT("Resources.dat")); + wxFFileInputStream input(FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("Resources.dat")); if (input.IsOk()) //if not... we don't want to react too harsh here { //activate support for .png files @@ -199,10 +212,13 @@ void GlobalResources::load() const wxZipInputStream resourceFile(input); - wxZipEntry* entry = NULL; std::map<wxString, wxBitmap*>::iterator bmp; - while ((entry = resourceFile.GetNextEntry())) + while (true) { + std::auto_ptr<wxZipEntry> entry(resourceFile.GetNextEntry()); + if (entry.get() == NULL) + break; + const wxString name = entry->GetName(); //search if entry is available in map @@ -222,3 +238,13 @@ void GlobalResources::load() const *programIcon = wxIcon(FreeFileSync_xpm); #endif } + + +const wxBitmap& GlobalResources::getImageByName(const wxString& imageName) const +{ + std::map<wxString, wxBitmap*>::const_iterator bmp = bitmapResource.find(imageName); + if (bmp != bitmapResource.end()) + return *bmp->second; + else + return wxNullBitmap; +} diff --git a/library/resources.h b/library/resources.h index 1ce7d20e..5f4e51f0 100644 --- a/library/resources.h +++ b/library/resources.h @@ -12,6 +12,8 @@ class GlobalResources public: static const GlobalResources& getInstance(); + const wxBitmap& getImageByName(const wxString& imageName) const; + //image resource objects wxBitmap* bitmapArrowLeft; wxBitmap* bitmapArrowRight; @@ -94,15 +96,19 @@ public: wxBitmap* bitmapMoveUp; wxBitmap* bitmapMoveDown; wxBitmap* bitmapCheckBoxTrue; + wxBitmap* bitmapCheckBoxTrueFocus; wxBitmap* bitmapCheckBoxFalse; + wxBitmap* bitmapCheckBoxFalseFocus; wxBitmap* bitmapSettings; wxBitmap* bitmapSettingsSmall; wxBitmap* bitmapRecycler; wxBitmap* bitmapShift; wxBitmap* bitmapSyncCfg; + wxBitmap* bitmapCmpCfg; wxBitmap* bitmapPreview; wxBitmap* bitmapPreviewDisabled; wxBitmap* bitmapQuestion; + wxBitmap* bitmapCzechRep; wxBitmap* bitmapChina; wxBitmap* bitmapHolland; wxBitmap* bitmapEngland; @@ -117,6 +123,14 @@ public: wxBitmap* bitmapSlovakia; wxBitmap* bitmapSpain; wxBitmap* bitmapRussia; + wxBitmap* bitmapSyncCreateLeftAct; + wxBitmap* bitmapSyncCreateLeftDeact; + wxBitmap* bitmapSyncCreateRightAct; + wxBitmap* bitmapSyncCreateRightDeact; + wxBitmap* bitmapSyncDeleteLeftAct; + wxBitmap* bitmapSyncDeleteLeftDeact; + wxBitmap* bitmapSyncDeleteRightAct; + wxBitmap* bitmapSyncDeleteRightDeact; wxBitmap* bitmapSyncDirLeftAct; wxBitmap* bitmapSyncDirLeftDeact; wxBitmap* bitmapSyncDirRightAct; diff --git a/library/statistics.cpp b/library/statistics.cpp index f2506da8..f317c114 100644 --- a/library/statistics.cpp +++ b/library/statistics.cpp @@ -1,9 +1,10 @@ #include "statistics.h" #include <wx/ffile.h> -#include "globalFunctions.h" +#include "../shared/globalFunctions.h" #include "statusHandler.h" #include "../algorithm.h" +#include <wx/intl.h> #include <limits> #include <wx/stopwatch.h> diff --git a/library/statusHandler.h b/library/statusHandler.h index fe64f3cd..d4163d2f 100644 --- a/library/statusHandler.h +++ b/library/statusHandler.h @@ -59,9 +59,9 @@ public: //error handling: - virtual ErrorHandler::Response reportError(const Zstring& errorMessage) = 0; //recoverable error situation - virtual void reportFatalError(const Zstring& errorMessage) = 0; //non-recoverable error situation, implement abort! - virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain) = 0; + virtual ErrorHandler::Response reportError(const wxString& errorMessage) = 0; //recoverable error situation + virtual void reportFatalError(const wxString& errorMessage) = 0; //non-recoverable error situation, implement abort! + virtual void reportWarning(const wxString& warningMessage, bool& warningActive) = 0; private: virtual void abortThisProcess() = 0; diff --git a/shared/customButton.cpp b/shared/customButton.cpp new file mode 100644 index 00000000..4027d3ef --- /dev/null +++ b/shared/customButton.cpp @@ -0,0 +1,302 @@ +#include "customButton.h" +#include <wx/dcmemory.h> +#include <wx/image.h> + +wxButtonWithImage::wxButtonWithImage(wxWindow *parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + const wxString& name) : + wxBitmapButton(parent, id, wxNullBitmap, pos, size, style | wxBU_AUTODRAW, validator, name), + m_spaceAfter(0), + m_spaceBefore(0) +{ + setTextLabel(label); +} + + +void wxButtonWithImage::setBitmapFront(const wxBitmap& bitmap, unsigned spaceAfter) +{ + bitmapFront = bitmap; + m_spaceAfter = spaceAfter; + refreshButtonLabel(); +} + + +void wxButtonWithImage::setTextLabel(const wxString& text) +{ + textLabel = text; + wxBitmapButton::SetLabel(text); + refreshButtonLabel(); +} + + +void wxButtonWithImage::setBitmapBack(const wxBitmap& bitmap, unsigned spaceBefore) +{ + bitmapBack = bitmap; + m_spaceBefore = spaceBefore; + refreshButtonLabel(); +} + + +void makeWhiteTransparent(const wxColor exceptColor, wxImage& image) +{ + unsigned char* alphaData = image.GetAlpha(); + if (alphaData) + { + assert(exceptColor.Red() != 255); + + unsigned char exCol = exceptColor.Red(); //alpha value can be extracted from any one of (red/green/blue) + unsigned char* imageStart = image.GetData(); + + unsigned char* j = alphaData; + const unsigned char* const rowEnd = j + image.GetWidth() * image.GetHeight(); + while (j != rowEnd) + { + const unsigned char* imagePixel = imageStart + (j - alphaData) * 3; //each pixel consists of three chars + //exceptColor(red,green,blue) becomes fully opaque(255), while white(255,255,255) becomes transparent(0) + *(j++) = ((255 - imagePixel[0]) * wxIMAGE_ALPHA_OPAQUE) / (255 - exCol); + } + } +} + + +wxSize getSizeNeeded(const wxString& text, wxFont& font) +{ + wxCoord width, height; + wxMemoryDC dc; + + wxString textFormatted = text; + textFormatted.Replace(wxT("&"), wxT(""), false); //remove accelerator + dc.GetMultiLineTextExtent(textFormatted, &width, &height , NULL, &font); + return wxSize(width, height); +} + +/* +inline +void linearInterpolationHelper(const int shift, wxImage& img) +{ + unsigned char* const data = img.GetData(); + const int width = img.GetWidth(); + if (width < 2) + return; + + const float intensity = 0.25; + + for (int y = 1; y < img.GetHeight() - 1; ++y) + { + float back = 0; + float middle = 0; + float front = 0; + + unsigned char* location = data + 3 * (y * width) + shift; + const unsigned char* const endPos = location + 3 * width; + + middle = (*location + *(location - 3 * width) + *(location + 3 * width)) / 3;; + front = (*(location + 3) + *(location + 3 * (1 - width)) + *(location + 3 * (1 + width))) / 3; + *location += ((middle + front) / 2 - *location) * intensity; + location += 3; + + while (location < endPos - 3) + { + back = middle; + middle = front; + front = (*(location + 3) + *(location + 3 * (1 - width)) + *(location + 3 * (1 + width))) / 3; + *location += ((back + middle + front) / 3 - *location) * intensity; + location += 3; + } + + back = middle; + middle = front; + *location += ((back + middle) / 2 - *location) * intensity; + } +} + + +void linearInterpolation(wxImage& img) +{ + linearInterpolationHelper(0, img); //red channel + linearInterpolationHelper(1, img); //green channel + linearInterpolationHelper(2, img); //blue channel +} +*/ + +wxBitmap wxButtonWithImage::createBitmapFromText(const wxString& text) +{ + if (text.empty()) + return wxBitmap(); + + wxFont currentFont = wxBitmapButton::GetFont(); + wxColor textColor = wxBitmapButton::GetForegroundColour(); + + wxSize sizeNeeded = getSizeNeeded(text, currentFont); + wxBitmap newBitmap(sizeNeeded.GetWidth(), sizeNeeded.GetHeight()); + + wxMemoryDC dc; + dc.SelectObject(newBitmap); + + //set up white background + dc.SetBackground(*wxWHITE_BRUSH); + dc.Clear(); + + //find position of accelerator + int indexAccel = -1; + size_t accelPos; + wxString textLabelFormatted = text; + if ((accelPos = text.find(wxT("&"))) != wxString::npos) + { + textLabelFormatted.Replace(wxT("&"), wxT(""), false); //remove accelerator + indexAccel = accelPos; + } + + dc.SetTextForeground(textColor); + dc.SetTextBackground(*wxWHITE); + dc.SetFont(currentFont); + dc.DrawLabel(textLabelFormatted, wxNullBitmap, wxRect(0, 0, newBitmap.GetWidth(), newBitmap.GetHeight()), wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, indexAccel); + + dc.SelectObject(wxNullBitmap); + + //add alpha channel to image + wxImage finalImage(newBitmap.ConvertToImage()); + finalImage.SetAlpha(); + + //linearInterpolation(finalImage); + + //make white background transparent + makeWhiteTransparent(textColor, finalImage); + + return wxBitmap(finalImage); +} + + +//copy one image into another, allowing arbitrary overlapping! (pos may contain negative numbers) +void writeToImage(const wxImage& source, const wxPoint pos, wxImage& target) +{ + //determine startpositions in source and target image, as well as width and height to be copied + wxPoint posSrc, posTrg; + int width, height; + + //X-axis + if (pos.x < 0) + { + posSrc.x = -pos.x; + posTrg.x = 0; + width = std::min(pos.x + source.GetWidth(), target.GetWidth()); + } + else + { + posSrc.x = 0; + posTrg.x = pos.x; + width = std::min(target.GetWidth() - pos.x, source.GetWidth()); + } + + //Y-axis + if (pos.y < 0) + { + posSrc.y = -pos.y; + posTrg.y = 0; + height = std::min(pos.y + source.GetHeight(), target.GetHeight()); + } + else + { + posSrc.y = 0; + posTrg.y = pos.y; + height = std::min(target.GetHeight() - pos.y, source.GetHeight()); + } + + + if (width > 0 && height > 0) + { + { + //copy source to target respecting overlapping parts + const unsigned char* sourcePtr = source.GetData() + 3 * (posSrc.x + posSrc.y * source.GetWidth()); + const unsigned char* const sourcePtrEnd = source.GetData() + 3 * (posSrc.x + (posSrc.y + height) * source.GetWidth()); + unsigned char* targetPtr = target.GetData() + 3 * (posTrg.x + posTrg.y * target.GetWidth()); + + while (sourcePtr < sourcePtrEnd) + { + memcpy(targetPtr, sourcePtr, 3 * width); + sourcePtr += 3 * source.GetWidth(); + targetPtr += 3 * target.GetWidth(); + } + } + + //handle different cases concerning alpha channel + if (source.HasAlpha()) + { + if (!target.HasAlpha()) + { + target.SetAlpha(); + unsigned char* alpha = target.GetAlpha(); + memset(alpha, wxIMAGE_ALPHA_OPAQUE, target.GetWidth() * target.GetHeight()); + } + + //copy alpha channel + const unsigned char* sourcePtr = source.GetAlpha() + (posSrc.x + posSrc.y * source.GetWidth()); + const unsigned char* const sourcePtrEnd = source.GetAlpha() + (posSrc.x + (posSrc.y + height) * source.GetWidth()); + unsigned char* targetPtr = target.GetAlpha() + (posTrg.x + posTrg.y * target.GetWidth()); + + while (sourcePtr < sourcePtrEnd) + { + memcpy(targetPtr, sourcePtr, width); + sourcePtr += source.GetWidth(); + targetPtr += target.GetWidth(); + } + } + else if (target.HasAlpha()) + { + unsigned char* targetPtr = target.GetAlpha() + (posTrg.x + posTrg.y * target.GetWidth()); + const unsigned char* const targetPtrEnd = target.GetAlpha() + (posTrg.x + (posTrg.y + height) * target.GetWidth()); + + while (targetPtr < targetPtrEnd) + { + memset(targetPtr, wxIMAGE_ALPHA_OPAQUE, width); + targetPtr += target.GetWidth(); + } + } + } +} + + +void wxButtonWithImage::refreshButtonLabel() +{ + wxBitmap bitmapText = createBitmapFromText(textLabel); + + //calculate dimensions of new button + const int height = std::max(std::max(bitmapFront.GetHeight(), bitmapText.GetHeight()), bitmapBack.GetHeight()); + const int width = bitmapFront.GetWidth() + m_spaceAfter + bitmapText.GetWidth() + m_spaceBefore + bitmapBack.GetWidth(); + + //create a transparent image + wxImage transparentImage(width, height, false); + transparentImage.SetAlpha(); + unsigned char* alpha = transparentImage.GetAlpha(); + memset(alpha, wxIMAGE_ALPHA_TRANSPARENT, width * height); + + //wxDC::DrawLabel() unfortunately isn't working for transparent images on Linux, so we need to use custom image-concatenation + if (bitmapFront.IsOk()) + writeToImage(wxImage(bitmapFront.ConvertToImage()), + wxPoint(0, (transparentImage.GetHeight() - bitmapFront.GetHeight()) / 2), + transparentImage); + + if (bitmapText.IsOk()) + writeToImage(wxImage(bitmapText.ConvertToImage()), + wxPoint(bitmapFront.GetWidth() + m_spaceAfter, (transparentImage.GetHeight() - bitmapText.GetHeight()) / 2), + transparentImage); + + if (bitmapBack.IsOk()) + writeToImage(wxImage(bitmapBack.ConvertToImage()), + wxPoint(bitmapFront.GetWidth() + m_spaceAfter + bitmapText.GetWidth() + m_spaceBefore, (transparentImage.GetHeight() - bitmapBack.GetHeight()) / 2), + transparentImage); + + //adjust button size + wxSize minSize = GetMinSize(); + + //SetMinSize() instead of SetSize() is needed here for wxWindows layout determination to work corretly + wxBitmapButton::SetMinSize(wxSize(std::max(width + 10, minSize.GetWidth()), std::max(height + 5, minSize.GetHeight()))); + + //finally set bitmap + wxBitmapButton::SetBitmapLabel(wxBitmap(transparentImage)); +} diff --git a/shared/customButton.h b/shared/customButton.h new file mode 100644 index 00000000..ce43828a --- /dev/null +++ b/shared/customButton.h @@ -0,0 +1,42 @@ +/*************************************************************** + * Purpose: wxButton with bitmap label + * Author: ZenJu (zhnmju123@gmx.de) + * Created: Feb. 2009 + **************************************************************/ + +#ifndef CUSTOMBUTTON_H_INCLUDED +#define CUSTOMBUTTON_H_INCLUDED + +#include <wx/bmpbuttn.h> + + +//wxButtonWithImage behaves like wxButton but optionally adds bitmap labels +class wxButtonWithImage : public wxBitmapButton +{ +public: + wxButtonWithImage(wxWindow *parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxButtonNameStr); + + void setBitmapFront(const wxBitmap& bitmap, unsigned spaceAfter = 0); + void setTextLabel( const wxString& text); + void setBitmapBack( const wxBitmap& bitmap, unsigned spaceBefore = 0); + +private: + wxBitmap createBitmapFromText(const wxString& text); + void refreshButtonLabel(); + + wxBitmap bitmapFront; + unsigned m_spaceAfter; + wxString textLabel; + unsigned m_spaceBefore; + wxBitmap bitmapBack; +}; + + +#endif // CUSTOMBUTTON_H_INCLUDED diff --git a/shared/customTooltip.cpp b/shared/customTooltip.cpp new file mode 100644 index 00000000..bffaa45d --- /dev/null +++ b/shared/customTooltip.cpp @@ -0,0 +1,89 @@ +#include "customTooltip.h" +#include <wx/stattext.h> +#include <wx/sizer.h> +#include <wx/statbmp.h> + + +class PopupFrameGenerated : public wxFrame +{ +public: + PopupFrameGenerated(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize( -1,-1 ), + long style = wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP | wxSTATIC_BORDER); + + wxStaticText* m_staticTextMain; + wxStaticBitmap* m_bitmapLeft; +}; + + +PopupFrameGenerated::PopupFrameGenerated( + wxWindow* parent, + wxWindowID id, + const wxString& title, + const wxPoint& pos, + const wxSize& size, + long style ) : wxFrame(parent, id, title, pos, size, style) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxColour( 255, 255, 255 ) ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextMain = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextMain->Wrap( -1 ); + bSizer158->Add( m_staticTextMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizer158 ); + this->Layout(); + bSizer158->Fit( this ); +} + + +CustomTooltip::CustomTooltip() : tipWindow(new PopupFrameGenerated(NULL)), lastBmp(NULL) +{ + hide(); +} + + +CustomTooltip::~CustomTooltip() +{ + tipWindow->Destroy(); +} + + +void CustomTooltip::show(const wxString& text, wxPoint pos, const wxBitmap* bmp) +{ + if (bmp != lastBmp) + { + lastBmp = bmp; + tipWindow->m_bitmapLeft->SetBitmap(bmp == NULL ? wxNullBitmap : *bmp); + } + + if (text != tipWindow->m_staticTextMain->GetLabel()) + tipWindow->m_staticTextMain->SetLabel(text); + +#ifdef FFS_LINUX + tipWindow->Fit(); //Alas Fit() seems to be somewhat broken => this needs to be called EVERY time inside show, not only if text or bmp change. +#endif + + if (pos != tipWindow->GetScreenPosition()) + tipWindow->SetSize(pos.x + 30, pos.y, wxDefaultCoord, wxDefaultCoord); + //attention!!! possible endless loop: mouse pointer must NOT be within tipWindow! + //Else it will trigger a wxEVT_LEAVE_WINDOW which will hide the window, causing the window to be shown again in via this method, etc. + + if (!tipWindow->IsShown()) + tipWindow->Show(); +} + + +void CustomTooltip::hide() +{ + tipWindow->Hide(); +} diff --git a/shared/customTooltip.h b/shared/customTooltip.h new file mode 100644 index 00000000..886c6130 --- /dev/null +++ b/shared/customTooltip.h @@ -0,0 +1,23 @@ +#ifndef CUSTOMTOOLTIP_H_INCLUDED +#define CUSTOMTOOLTIP_H_INCLUDED + +#include <wx/frame.h> + +class PopupFrameGenerated; + + +class CustomTooltip +{ +public: + CustomTooltip(); + ~CustomTooltip(); + + void show(const wxString& text, wxPoint pos, const wxBitmap* bmp = NULL); //absolute screen coordinates + void hide(); + +private: + PopupFrameGenerated* tipWindow; + const wxBitmap* lastBmp; //buffer last used bitmap pointer +}; + +#endif // CUSTOMTOOLTIP_H_INCLUDED diff --git a/shared/dragAndDrop.cpp b/shared/dragAndDrop.cpp new file mode 100644 index 00000000..9261d604 --- /dev/null +++ b/shared/dragAndDrop.cpp @@ -0,0 +1,216 @@ +#include "dragAndDrop.h" +#include <wx/dnd.h> +#include <wx/window.h> +#include <wx/combobox.h> +#include <wx/textctrl.h> +#include <wx/filepicker.h> +#include <wx/filename.h> + + +//define new event type +const wxEventType FFS_DROP_FILE_EVENT = wxNewEventType(); + +typedef void (wxEvtHandler::*FFSFileDropEventFunction)(FFSFileDropEvent&); + +#define FFSFileDropEventHandler(func) \ + (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(FFSFileDropEventFunction, &func) + +class FFSFileDropEvent : public wxCommandEvent +{ +public: + FFSFileDropEvent(const wxString& nameDropped, const wxWindow* dropWindow) : + wxCommandEvent(FFS_DROP_FILE_EVENT), + nameDropped_(nameDropped), + dropWindow_(dropWindow) {} + + virtual wxEvent* Clone() const + { + return new FFSFileDropEvent(nameDropped_, dropWindow_); + } + + const wxString nameDropped_; + const wxWindow* dropWindow_; +}; + +//############################################################################################################## + + +class WindowDropTarget : public wxFileDropTarget +{ +public: + WindowDropTarget(wxWindow* dropWindow) : + dropWindow_(dropWindow) {} + + virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) + { + if (!filenames.IsEmpty()) + { + const wxString droppedFileName = filenames[0]; + + //create a custom event on drop window: execute event after file dropping is completed! (e.g. after mouse is released) + FFSFileDropEvent evt(droppedFileName, dropWindow_); + dropWindow_->AddPendingEvent(evt); + } + return false; + } + +private: + wxWindow* dropWindow_; +}; + + + +//############################################################################################################## + +using FreeFileSync::DragDropOnMainDlg; + +DragDropOnMainDlg::DragDropOnMainDlg(wxWindow* dropWindow1, + wxWindow* dropWindow2, + wxDirPickerCtrl* dirPicker, + wxComboBox* dirName) : + dropWindow1_(dropWindow1), + dropWindow2_(dropWindow2), + dirPicker_(dirPicker), + dirName_(dirName) +{ + //prepare drag & drop + dropWindow1->SetDropTarget(new WindowDropTarget(dropWindow1)); //takes ownership + dropWindow2->SetDropTarget(new WindowDropTarget(dropWindow2)); //takes ownership + + //redirect drag & drop event back to this class + dropWindow1->Connect(FFS_DROP_FILE_EVENT, FFSFileDropEventHandler(DragDropOnMainDlg::OnFilesDropped), NULL, this); + dropWindow2->Connect(FFS_DROP_FILE_EVENT, FFSFileDropEventHandler(DragDropOnMainDlg::OnFilesDropped), NULL, this); + + //keep dirPicker and dirName synchronous + dirName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DragDropOnMainDlg::OnWriteDirManually ), NULL, this ); + dirPicker->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( DragDropOnMainDlg::OnDirSelected ), NULL, this ); +} + + +void DragDropOnMainDlg::OnFilesDropped(FFSFileDropEvent& event) +{ + if ( this->dropWindow1_ == event.dropWindow_ || //file may be dropped on window 1 or 2 + this->dropWindow2_ == event.dropWindow_) + { + if (AcceptDrop(event.nameDropped_)) + { + wxString fileName = event.nameDropped_; + if (wxDirExists(fileName)) + { + dirName_->SetSelection(wxNOT_FOUND); + dirName_->SetValue(fileName); + dirPicker_->SetPath(fileName); + } + else + { + fileName = wxFileName(fileName).GetPath(); + if (wxDirExists(fileName)) + { + dirName_->SetSelection(wxNOT_FOUND); + dirName_->SetValue(fileName); + dirPicker_->SetPath(fileName); + } + } + } + } + else //should never be reached + event.Skip(); +}; + + +wxString formatDirectory(const wxString& dirname) +{ + wxString dirnameTmp = dirname; + dirnameTmp.Trim(true); //remove whitespace characters from right + dirnameTmp.Trim(false); //remove whitespace characters from left + + return dirnameTmp; +} + + +void DragDropOnMainDlg::OnWriteDirManually(wxCommandEvent& event) +{ + const wxString newDir = formatDirectory(event.GetString()); + if (wxDirExists(newDir)) + dirPicker_->SetPath(newDir); + + event.Skip(); +} + + +void DragDropOnMainDlg::OnDirSelected(wxFileDirPickerEvent& event) +{ + const wxString newPath = event.GetPath(); + dirName_->SetSelection(wxNOT_FOUND); + dirName_->SetValue(newPath); + + event.Skip(); +} + +//############################################################################################################## + + +using FreeFileSync::DragDropOnDlg; + +DragDropOnDlg::DragDropOnDlg(wxWindow* dropWindow, + wxDirPickerCtrl* dirPicker, + wxTextCtrl* dirName) : + dropWindow_(dropWindow), + dirPicker_(dirPicker), + dirName_(dirName) +{ + //prepare drag & drop + dropWindow->SetDropTarget(new WindowDropTarget(dropWindow)); //takes ownership + + //redirect drag & drop event back to this class + dropWindow->Connect(FFS_DROP_FILE_EVENT, FFSFileDropEventHandler(DragDropOnDlg::OnFilesDropped), NULL, this); + + //keep dirPicker and dirName synchronous + dirName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DragDropOnDlg::OnWriteDirManually ), NULL, this ); + dirPicker->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( DragDropOnDlg::OnDirSelected ), NULL, this ); +} + + +void DragDropOnDlg::OnFilesDropped(FFSFileDropEvent& event) +{ + if (this->dropWindow_ == event.dropWindow_) + { + wxString fileName = event.nameDropped_; + if (wxDirExists(fileName)) + { + dirName_->SetValue(fileName); + dirPicker_->SetPath(fileName); + } + else + { + fileName = wxFileName(fileName).GetPath(); + if (wxDirExists(fileName)) + { + dirName_->SetValue(fileName); + dirPicker_->SetPath(fileName); + } + } + } + else //should never be reached + event.Skip(); +}; + + +void DragDropOnDlg::OnWriteDirManually(wxCommandEvent& event) +{ + const wxString newDir = formatDirectory(event.GetString()); + if (wxDirExists(newDir)) + dirPicker_->SetPath(newDir); + + event.Skip(); +} + + +void DragDropOnDlg::OnDirSelected(wxFileDirPickerEvent& event) +{ + const wxString newPath = event.GetPath(); + dirName_->SetValue(newPath); + + event.Skip(); +} + diff --git a/shared/dragAndDrop.h b/shared/dragAndDrop.h new file mode 100644 index 00000000..a8c7561a --- /dev/null +++ b/shared/dragAndDrop.h @@ -0,0 +1,63 @@ +#ifndef DRAGANDDROP_H_INCLUDED +#define DRAGANDDROP_H_INCLUDED + +#include <wx/event.h> + +class wxWindow; +class wxDirPickerCtrl; +class wxComboBox; +class wxTextCtrl; +class wxString; +class FFSFileDropEvent; +class wxCommandEvent; +class wxFileDirPickerEvent; + + +namespace FreeFileSync +{ + //add drag and drop functionality, coordinating a wxWindow, wxDirPickerCtrl, and wxComboBox/wxTextCtrl + + class DragDropOnMainDlg : private wxEvtHandler + { + public: + DragDropOnMainDlg(wxWindow* dropWindow1, + wxWindow* dropWindow2, + wxDirPickerCtrl* dirPicker, + wxComboBox* dirName); + + virtual ~DragDropOnMainDlg() {} + + virtual bool AcceptDrop(const wxString& dropName) = 0; //return true if drop should be processed + + private: + void OnFilesDropped(FFSFileDropEvent& event); + void OnWriteDirManually(wxCommandEvent& event); + void OnDirSelected(wxFileDirPickerEvent& event); + + const wxWindow* dropWindow1_; + const wxWindow* dropWindow2_; + wxDirPickerCtrl* dirPicker_; + wxComboBox* dirName_; + }; + + + class DragDropOnDlg: private wxEvtHandler + { + public: + DragDropOnDlg(wxWindow* dropWindow, + wxDirPickerCtrl* dirPicker, + wxTextCtrl* dirName); + + private: + void OnFilesDropped(FFSFileDropEvent& event); + void OnWriteDirManually(wxCommandEvent& event); + void OnDirSelected(wxFileDirPickerEvent& event); + + const wxWindow* dropWindow_; + wxDirPickerCtrl* dirPicker_; + wxTextCtrl* dirName_; + }; +} + + +#endif // DRAGANDDROP_H_INCLUDED diff --git a/shared/fileError.h b/shared/fileError.h new file mode 100644 index 00000000..f5c6bdbd --- /dev/null +++ b/shared/fileError.h @@ -0,0 +1,25 @@ +#ifndef FILEERROR_H_INCLUDED +#define FILEERROR_H_INCLUDED + +#include <wx/string.h> + + +namespace FreeFileSync +{ + class FileError //Exception class used to notify file/directory copy/delete errors + { + public: + FileError(const wxString& message) : + errorMessage(message) {} + + const wxString& show() const + { + return errorMessage; + } + + private: + wxString errorMessage; + }; +} + +#endif // FILEERROR_H_INCLUDED diff --git a/shared/fileHandling.cpp b/shared/fileHandling.cpp new file mode 100644 index 00000000..a5d3cf57 --- /dev/null +++ b/shared/fileHandling.cpp @@ -0,0 +1,1077 @@ +#include "fileHandling.h" +#include <wx/intl.h> +#include "systemFunctions.h" +#include "globalFunctions.h" +#include "fileTraverser.h" + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" +#include "shadow.h" + +#elif defined FFS_LINUX +#include <sys/stat.h> +#include <stdio.h> //for rename() +#include <time.h> +#include <utime.h> +#include <fstream> +#include <unistd.h> +#include <dirent.h> +#include <errno.h> +#endif + +using FreeFileSync::FileError; + + +Zstring FreeFileSync::getFormattedDirectoryName(const Zstring& dirname) +{ //Formatting is needed since functions expect the directory to end with '\' to be able to split the relative names. + //Also improves usability. + + Zstring dirnameTmp = dirname; + dirnameTmp.Trim(true); //remove whitespace characters from right + dirnameTmp.Trim(false); //remove whitespace characters from left + + if (dirnameTmp.empty()) //an empty string is interpreted as "\"; this is not desired + return Zstring(); + + if (!dirnameTmp.EndsWith(globalFunctions::FILE_NAME_SEPARATOR)) + dirnameTmp += globalFunctions::FILE_NAME_SEPARATOR; + + //don't do directory formatting with wxFileName, as it doesn't respect //?/ - prefix + return dirnameTmp; +} + + +class RecycleBin +{ +public: + static const RecycleBin& getInstance() + { + static RecycleBin instance; //lazy creation of RecycleBin + return instance; + } + + bool recycleBinExists() const + { + return recycleBinAvailable; + } + + bool moveToRecycleBin(const Zstring& filename) const; //throw (RuntimeException) + +private: + RecycleBin() : + recycleBinAvailable(false) + { +#ifdef FFS_WIN + recycleBinAvailable = true; +#endif // FFS_WIN + } + + ~RecycleBin() {} + +private: + bool recycleBinAvailable; +}; + + +bool RecycleBin::moveToRecycleBin(const Zstring& filename) const //throw (RuntimeException) +{ + if (!recycleBinAvailable) //this method should ONLY be called if recycle bin is available + throw RuntimeException(_("Initialization of Recycle Bin failed!")); + +#ifdef FFS_WIN + Zstring filenameDoubleNull = filename + wxChar(0); + + SHFILEOPSTRUCT fileOp; + fileOp.hwnd = NULL; + fileOp.wFunc = FO_DELETE; + fileOp.pFrom = filenameDoubleNull.c_str(); + fileOp.pTo = NULL; + fileOp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; + fileOp.fAnyOperationsAborted = false; + fileOp.hNameMappings = NULL; + fileOp.lpszProgressTitle = NULL; + + if (SHFileOperation(&fileOp) != 0 || fileOp.fAnyOperationsAborted) return false; +#endif + + return true; +} + + +bool FreeFileSync::recycleBinExists() +{ + return RecycleBin::getInstance().recycleBinExists(); +} + + +inline +bool moveToRecycleBin(const Zstring& filename) //throw (RuntimeException) +{ + return RecycleBin::getInstance().moveToRecycleBin(filename); +} + + +bool FreeFileSync::fileExists(const DefaultChar* filename) +{ //symbolic links (broken or not) are also treated as existing files! +#ifdef FFS_WIN + // we must use GetFileAttributes() instead of the ANSI C functions because + // it can cope with network (UNC) paths unlike them + const DWORD ret = ::GetFileAttributes(filename); + + return (ret != INVALID_FILE_ATTRIBUTES) && !(ret & FILE_ATTRIBUTE_DIRECTORY); //returns true for (file-)symlinks also + +#elif defined FFS_LINUX + struct stat fileInfo; + return (::lstat(filename, &fileInfo) == 0 && + (S_ISLNK(fileInfo.st_mode) || S_ISREG(fileInfo.st_mode))); //in Linux a symbolic link is neither file nor directory +#endif +} + + +bool FreeFileSync::dirExists(const DefaultChar* dirname) +{ //symbolic links (broken or not) are also treated as existing directories! +#ifdef FFS_WIN + // we must use GetFileAttributes() instead of the ANSI C functions because + // it can cope with network (UNC) paths unlike them + const DWORD ret = ::GetFileAttributes(dirname); + + return (ret != INVALID_FILE_ATTRIBUTES) && (ret & FILE_ATTRIBUTE_DIRECTORY); //returns true for (dir-)symlinks also + +#elif defined FFS_LINUX + struct stat dirInfo; + return (::lstat(dirname, &dirInfo) == 0 && + (S_ISLNK(dirInfo.st_mode) || S_ISDIR(dirInfo.st_mode))); //in Linux a symbolic link is neither file nor directory +#endif +} + + +bool FreeFileSync::symlinkExists(const DefaultChar* objname) +{ +#ifdef FFS_WIN + const DWORD ret = ::GetFileAttributes(objname); + return (ret != INVALID_FILE_ATTRIBUTES) && (ret & FILE_ATTRIBUTE_REPARSE_POINT); + +#elif defined FFS_LINUX + struct stat fileInfo; + return (::lstat(objname, &fileInfo) == 0 && + S_ISLNK(fileInfo.st_mode)); //symbolic link +#endif +} + + +void FreeFileSync::removeFile(const Zstring& filename, const bool useRecycleBin) //throw (FileError, ::RuntimeException); +{ + //no error situation if file is not existing! manual deletion relies on it! +#ifdef FFS_WIN + if (::GetFileAttributes(filename.c_str()) == INVALID_FILE_ATTRIBUTES) + return; //neither file nor any other object with that name existing + +#elif defined FFS_LINUX + struct stat fileInfo; + if (::lstat(filename.c_str(), &fileInfo) != 0) + return; //neither file nor any other object (e.g. broken symlink) with that name existing +#endif + + if (useRecycleBin) + { + if (!moveToRecycleBin(filename)) + throw FileError(wxString(_("Error moving to Recycle Bin:")) + wxT("\n\"") + filename.c_str() + wxT("\"")); + return; + } + +#ifdef FFS_WIN + //initialize file attributes + if (!::SetFileAttributes( + filename.c_str(), //address of filename + FILE_ATTRIBUTE_NORMAL)) //attributes to set + { + wxString errorMessage = wxString(_("Error deleting file:")) + wxT("\n\"") + filename.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + //remove file, support for \\?\-prefix + if (!::DeleteFile(filename.c_str())) + { + wxString errorMessage = wxString(_("Error deleting file:")) + wxT("\n\"") + filename.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } +#elif defined FFS_LINUX + if (::unlink(filename.c_str()) != 0) + { + wxString errorMessage = wxString(_("Error deleting file:")) + wxT("\n\"") + filename.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } +#endif +} + + +using FreeFileSync::MoveFileCallback; + +class CopyCallbackImpl : public FreeFileSync::CopyFileCallback //callback functionality +{ +public: + CopyCallbackImpl(MoveFileCallback* callback) : moveCallback(callback) {} + + virtual Response updateCopyStatus(const wxULongLong& totalBytesTransferred) + { + switch (moveCallback->requestUiRefresh()) + { + case MoveFileCallback::CONTINUE: + return CopyFileCallback::CONTINUE; + + case MoveFileCallback::CANCEL: + return CopyFileCallback::CANCEL; + } + return CopyFileCallback::CONTINUE; //dummy return value + } + +private: + MoveFileCallback* moveCallback; +}; + + +void FreeFileSync::moveFile(const Zstring& sourceFile, const Zstring& targetFile, MoveFileCallback* callback) //throw (FileError); +{ + if (fileExists(targetFile)) //test file existence: e.g. Linux might silently overwrite existing symlinks + { + const wxString errorMessage = wxString(_("Error moving file:")) + wxT("\n\"") + sourceFile + wxT("\" ->\n\"") + targetFile + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + _("Target file already existing!")); + } + + //moving of symbolic links should work correctly: + +#ifdef FFS_WIN + //first try to move the file directly without copying + if (::MoveFileEx(sourceFile.c_str(), //__in LPCTSTR lpExistingFileName, + targetFile.c_str(), //__in_opt LPCTSTR lpNewFileName, + 0)) //__in DWORD dwFlags + return; + + //if moving failed treat as error (except when it tried to move to a different volume: in this case we will copy the file) + const DWORD lastError = ::GetLastError(); + if (lastError != ERROR_NOT_SAME_DEVICE) + { + const wxString errorMessage = wxString(_("Error moving file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\" ->\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(lastError)); + } + + //file is on a different volume: let's copy it + std::auto_ptr<CopyCallbackImpl> copyCallback(callback != NULL ? new CopyCallbackImpl(callback) : NULL); + + copyFile(sourceFile, + targetFile, + true, //copy symbolic links + NULL, //supply handler for making shadow copies + copyCallback.get()); //throw (FileError); + +#elif defined FFS_LINUX + //first try to move the file directly without copying + if (rename(sourceFile.c_str(), targetFile.c_str()) == 0) + return; + + //if moving failed treat as error (except when it tried to move to a different volume: in this case we will copy the file) + if (errno != EXDEV) + { + const wxString errorMessage = wxString(_("Error moving file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\" ->\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(errno)); + } + + //file is on a different volume: let's copy it + std::auto_ptr<CopyCallbackImpl> copyCallback(callback != NULL ? new CopyCallbackImpl(callback) : NULL); + + copyFile(sourceFile, + targetFile, + true, //copy symbolic links + copyCallback.get()); //throw (FileError); +#endif + + //attention: if copy-operation was cancelled an exception is thrown => sourcefile is not deleted, as we wish! + + removeFile(sourceFile, false); +} + + +class TraverseOneLevel : public FreeFileSync::TraverseCallback +{ +public: + typedef std::vector<std::pair<Zstring, Zstring> > NamePair; + + TraverseOneLevel(NamePair& filesShort, NamePair& dirsShort) : + m_files(filesShort), + m_dirs(dirsShort) {} + + virtual ReturnValue onFile(const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) + { + m_files.push_back(std::make_pair(Zstring(shortName), fullName)); + return TRAVERSING_CONTINUE; + } + virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) + { + m_dirs.push_back(std::make_pair(Zstring(shortName), fullName)); + return ReturnValDir::Ignore(); //DON'T traverse into subdirs; moveDirectory works recursively! + } + virtual ReturnValue onError(const wxString& errorText) + { + throw FileError(errorText); + } + +private: + NamePair& m_files; + NamePair& m_dirs; +}; + + +void moveDirectoryImpl(const Zstring& sourceDir, const Zstring& targetDir, bool ignoreExistingDirs, MoveFileCallback* callback) //throw (FileError); +{ + //handle symbolic links + if (FreeFileSync::symlinkExists(sourceDir)) + { + FreeFileSync::createDirectory(targetDir, sourceDir, true); //copy symbolic link + FreeFileSync::removeDirectory(sourceDir, false); //if target is already another symlink or directory, sourceDir-symlink is silently deleted + return; + } + + if (FreeFileSync::dirExists(targetDir)) + { + if (!ignoreExistingDirs) //directory or symlink exists + { + const wxString errorMessage = wxString(_("Error moving directory:")) + wxT("\n\"") + sourceDir + wxT("\" ->\n\"") + targetDir + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + _("Target directory already existing!")); + } + } + else + { + //first try to move the directory directly without copying +#ifdef FFS_WIN + if (::MoveFileEx(sourceDir.c_str(), //__in LPCTSTR lpExistingFileName, + targetDir.c_str(), //__in_opt LPCTSTR lpNewFileName, + 0)) //__in DWORD dwFlags + return; + + //if moving failed treat as error (except when it tried to move to a different volume: in this case we will copy the directory) + const DWORD lastError = ::GetLastError(); + if (lastError != ERROR_NOT_SAME_DEVICE) + { + const wxString errorMessage = wxString(_("Error moving directory:")) + wxT("\n\"") + sourceDir.c_str() + wxT("\" ->\n\"") + targetDir.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(lastError)); + } +#elif defined FFS_LINUX + if (::rename(sourceDir.c_str(), targetDir.c_str()) == 0) + return; + + //if moving failed treat as error (except when it tried to move to a different volume: in this case we will copy the directory) + if (errno != EXDEV) + { + const wxString errorMessage = wxString(_("Error moving directory:")) + wxT("\n\"") + sourceDir.c_str() + wxT("\" ->\n\"") + targetDir.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(errno)); + } +#endif + + //create target + FreeFileSync::createDirectory(targetDir, sourceDir, false); //throw (FileError); + } + + //call back once per folder + if (callback) + switch (callback->requestUiRefresh()) + { + case MoveFileCallback::CONTINUE: + break; + case MoveFileCallback::CANCEL: + //an user aborted operation IS an error condition! + throw FileError(wxString(_("Error moving directory:")) + wxT("\n\"") + sourceDir.c_str() + wxT("\" ->\n\"") + + targetDir.c_str() + wxT("\"") + wxT("\n\n") + _("Operation aborted!")); + } + + //move files/folders recursively + TraverseOneLevel::NamePair fileList; //list of names: 1. short 2.long + TraverseOneLevel::NamePair dirList; // + + //traverse source directory one level + TraverseOneLevel traverseCallback(fileList, dirList); + FreeFileSync::traverseFolder(sourceDir, false, &traverseCallback); //traverse one level + + const Zstring targetDirFormatted = targetDir.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? //ends with path separator + targetDir : + targetDir + globalFunctions::FILE_NAME_SEPARATOR; + + //move files + for (TraverseOneLevel::NamePair::const_iterator i = fileList.begin(); i != fileList.end(); ++i) + FreeFileSync::moveFile(i->second, targetDirFormatted + i->first, callback); + + //move directories + for (TraverseOneLevel::NamePair::const_iterator i = dirList.begin(); i != dirList.end(); ++i) + ::moveDirectoryImpl(i->second, targetDirFormatted + i->first, true, callback); + + //attention: if move-operation was cancelled an exception is thrown => sourceDir is not deleted, as we wish! + + //delete source + FreeFileSync::removeDirectory(sourceDir, false); //throw (FileError); + + return; +} + + +void FreeFileSync::moveDirectory(const Zstring& sourceDir, const Zstring& targetDir, bool ignoreExistingDirs, MoveFileCallback* callback) //throw (FileError); +{ +#ifdef FFS_WIN + const Zstring& sourceDirFormatted = sourceDir; + const Zstring& targetDirFormatted = targetDir; +#elif defined FFS_LINUX + const Zstring sourceDirFormatted = //remove trailing slash + sourceDir.size() > 1 && sourceDir.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? //exception: allow '/' + sourceDir.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR) : + sourceDir; + const Zstring targetDirFormatted = //remove trailing slash + targetDir.size() > 1 && targetDir.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? //exception: allow '/' + targetDir.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR) : + targetDir; +#endif + + ::moveDirectoryImpl(sourceDirFormatted, targetDirFormatted, ignoreExistingDirs, callback); +} + + +class FilesDirsOnlyTraverser : public FreeFileSync::TraverseCallback +{ +public: + FilesDirsOnlyTraverser(std::vector<Zstring>& files, std::vector<Zstring>& dirs) : + m_files(files), + m_dirs(dirs) {} + + virtual ReturnValue onFile(const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) + { + m_files.push_back(fullName); + return TRAVERSING_CONTINUE; + } + virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) + { + m_dirs.push_back(fullName); + return ReturnValDir::Ignore(); //DON'T traverse into subdirs; removeDirectory works recursively! + } + virtual ReturnValue onError(const wxString& errorText) + { + throw FileError(errorText); + } + +private: + std::vector<Zstring>& m_files; + std::vector<Zstring>& m_dirs; +}; + + +void FreeFileSync::removeDirectory(const Zstring& directory, const bool useRecycleBin) +{ + //no error situation if directory is not existing! manual deletion relies on it! +#ifdef FFS_WIN + const DWORD dirAttr = GetFileAttributes(directory.c_str()); //name of a file or directory + if (dirAttr == INVALID_FILE_ATTRIBUTES) + return; //neither directory nor any other object with that name existing + +#elif defined FFS_LINUX + struct stat dirInfo; + if (lstat(directory.c_str(), &dirInfo) != 0) + return; //neither directory nor any other object (e.g. broken symlink) with that name existing +#endif + + if (useRecycleBin) + { + if (!moveToRecycleBin(directory)) + throw FileError(wxString(_("Error moving to Recycle Bin:")) + wxT("\n\"") + directory.c_str() + wxT("\"")); + return; + } + +//attention: check if directory is a symlink! Do NOT traverse into it deleting contained files!!! +#ifdef FFS_WIN + if (dirAttr & FILE_ATTRIBUTE_REPARSE_POINT) //remove symlink directly, support for \\?\-prefix + { + if (!::SetFileAttributes( // initialize file attributes: actually NEEDED for symbolic links also! + directory.c_str(), // address of directory name + FILE_ATTRIBUTE_NORMAL)) // attributes to set + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + if (!::RemoveDirectory(directory.c_str())) + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + return; + } + +#elif defined FFS_LINUX + if (S_ISLNK(dirInfo.st_mode)) + { + if (::unlink(directory.c_str()) != 0) + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + return; + } +#endif + + std::vector<Zstring> fileList; + std::vector<Zstring> dirList; + + //get all files and directories from current directory (WITHOUT subdirectories!) + FilesDirsOnlyTraverser traverser(fileList, dirList); + FreeFileSync::traverseFolder(directory, false, &traverser); + + //delete files + for (std::vector<Zstring>::const_iterator j = fileList.begin(); j != fileList.end(); ++j) + FreeFileSync::removeFile(*j, false); + + //delete directories recursively + for (std::vector<Zstring>::const_iterator j = dirList.begin(); j != dirList.end(); ++j) + FreeFileSync::removeDirectory(*j, false); //call recursively to correctly handle symbolic links + + //parent directory is deleted last +#ifdef FFS_WIN + //initialize file attributes + if (!::SetFileAttributes( + directory.c_str(), // address of directory name + FILE_ATTRIBUTE_NORMAL)) // attributes to set + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + //remove directory, support for \\?\-prefix + if (!::RemoveDirectory(directory.c_str())) + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } +#else + if (::rmdir(directory.c_str()) != 0) + { + wxString errorMessage = wxString(_("Error deleting directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } +#endif +} + + +#ifdef FFS_WIN +class CloseHandleOnExit +{ +public: + CloseHandleOnExit(HANDLE fileHandle) : fileHandle_(fileHandle) {} + + ~CloseHandleOnExit() + { + CloseHandle(fileHandle_); + } + +private: + HANDLE fileHandle_; +}; + + +class KernelDllHandler //dynamically load windows API functions +{ + typedef DWORD (WINAPI *GetFinalPath)( + HANDLE hFile, + LPTSTR lpszFilePath, + DWORD cchFilePath, + DWORD dwFlags); + +public: + static const KernelDllHandler& getInstance() //lazy creation of KernelDllHandler + { + static KernelDllHandler instance; + return instance; + } + + GetFinalPath getFinalPathNameByHandle; + +private: + KernelDllHandler() : + getFinalPathNameByHandle(NULL), + hKernel(NULL) + { + //get a handle to the DLL module containing required functionality + hKernel = ::LoadLibrary(wxT("kernel32.dll")); + if (hKernel) + getFinalPathNameByHandle = reinterpret_cast<GetFinalPath>(::GetProcAddress(hKernel, "GetFinalPathNameByHandleW")); //load unicode version! + } + + ~KernelDllHandler() + { + if (hKernel) ::FreeLibrary(hKernel); + } + + HINSTANCE hKernel; +}; + + +Zstring resolveDirectorySymlink(const Zstring& dirLinkName) //get full target path of symbolic link to a directory +{ + //open handle to target of symbolic link + HANDLE hDir = CreateFile(dirLinkName.c_str(), + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + if (hDir == INVALID_HANDLE_VALUE) + return Zstring(); + + CloseHandleOnExit dummy(hDir); + + if (KernelDllHandler::getInstance().getFinalPathNameByHandle == NULL ) + throw FileError(wxString(_("Error loading library function:")) + wxT("\n\"") + wxT("GetFinalPathNameByHandleW") + wxT("\"")); + + const unsigned int BUFFER_SIZE = 10000; + TCHAR targetPath[BUFFER_SIZE]; + + const DWORD rv = KernelDllHandler::getInstance().getFinalPathNameByHandle( + hDir, + targetPath, + BUFFER_SIZE, + 0); + + if (rv >= BUFFER_SIZE || rv == 0) + return Zstring(); + + return targetPath; +} +#endif + + +void createDirectoryRecursively(const Zstring& directory, const Zstring& templateDir, const bool copyDirectorySymLinks, const int level) +{ + if (FreeFileSync::dirExists(directory)) + return; + + if (level == 100) //catch endless recursion + return; + + //try to create parent folders first + const Zstring dirParent = directory.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + if (!dirParent.empty() && !FreeFileSync::dirExists(dirParent)) + { + //call function recursively + const Zstring templateParent = templateDir.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + createDirectoryRecursively(dirParent, templateParent, false, level + 1); //don't create symbolic links in recursion! + } + + //now creation should be possible +#ifdef FFS_WIN + const DWORD templateAttr = ::GetFileAttributes(templateDir.c_str()); //replaces wxDirExists(): also returns successful for broken symlinks + if (templateAttr == INVALID_FILE_ATTRIBUTES) //fallback + { + if (!::CreateDirectory(directory.c_str(), // pointer to a directory path string + NULL) && level == 0) + { + const wxString errorMessage = wxString(_("Error creating directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + } + else + { + //symbolic link handling + if (!copyDirectorySymLinks && templateAttr & FILE_ATTRIBUTE_REPARSE_POINT) //create directory based on target of symbolic link + { + //get target directory of symbolic link + const Zstring linkPath = resolveDirectorySymlink(templateDir); + if (linkPath.empty()) + { + if (level == 0) + throw FileError(wxString(_("Error resolving symbolic link:")) + wxT("\n\"") + templateDir.c_str() + wxT("\"")); + } + else + { + if (!::CreateDirectoryEx( // this function automatically copies symbolic links if encountered + linkPath.c_str(), // pointer to path string of template directory + directory.c_str(), // pointer to a directory path string + NULL) && level == 0) + { + const wxString errorMessage = wxString(_("Error creating directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + } + } + else //in all other cases + { + if (!::CreateDirectoryEx( // this function automatically copies symbolic links if encountered + templateDir.c_str(), // pointer to path string of template directory + directory.c_str(), // pointer to a directory path string + NULL) && level == 0) + { + const wxString errorMessage = wxString(_("Error creating directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + } + } +#elif defined FFS_LINUX + //symbolic link handling + if (copyDirectorySymLinks) + { + //test if templateDir is a symbolic link + struct stat linkInfo; + if (lstat(templateDir.c_str(), &linkInfo) == 0 && S_ISLNK(linkInfo.st_mode)) + { + //copy symbolic link + const int BUFFER_SIZE = 10000; + char buffer[BUFFER_SIZE]; + const int bytesWritten = readlink(templateDir.c_str(), buffer, BUFFER_SIZE); + if (bytesWritten < 0 || bytesWritten == BUFFER_SIZE) + { + wxString errorMessage = wxString(_("Error resolving symbolic link:")) + wxT("\n\"") + templateDir.c_str() + wxT("\""); + if (bytesWritten < 0) errorMessage += wxString(wxT("\n\n")) + FreeFileSync::getLastErrorFormatted(); + throw FileError(errorMessage); + } + //set null-terminating char + buffer[bytesWritten] = 0; + + if (symlink(buffer, directory.c_str()) != 0) + { + wxString errorMessage = wxString(_("Error creating directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + return; //symlink created successfully + } + } + + //default directory creation + if (mkdir(directory.c_str(), 0755) != 0 && level == 0) + { + wxString errorMessage = wxString(_("Error creating directory:")) + wxT("\n\"") + directory.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + +//copy directory permissions: not sure if this is a good idea: if a directory is read-only copying/sync'ing of files will fail... + /* + if (templateDirExists) + { + struct stat fileInfo; + if (stat(templateDir.c_str(), &fileInfo) != 0) //read permissions from template directory + throw FileError(Zstring(_("Error reading file attributes:")) + wxT("\n\"") + templateDir + wxT("\"")); + + // reset the umask as we want to create the directory with exactly the same permissions as the template + wxCHANGE_UMASK(0); + + if (mkdir(directory.c_str(), fileInfo.st_mode) != 0 && level == 0) + throw FileError(Zstring(_("Error creating directory:")) + wxT("\n\"") + directory + wxT("\"")); + } + else + { + if (mkdir(directory.c_str(), 0777) != 0 && level == 0) + throw FileError(Zstring(_("Error creating directory:")) + wxT("\n\"") + directory + wxT("\"")); + } + */ +#endif +} + + +void FreeFileSync::createDirectory(const Zstring& directory, const Zstring& templateDir, const bool copyDirectorySymLinks) +{ + //remove trailing separator + const Zstring dirFormatted = directory.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? + directory.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR) : + directory; + + const Zstring templateFormatted = templateDir.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? + templateDir.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR) : + templateDir; + + createDirectoryRecursively(dirFormatted, templateFormatted, copyDirectorySymLinks, 0); +} + + +#ifdef FFS_WIN + +#ifndef COPY_FILE_COPY_SYMLINK +const DWORD COPY_FILE_COPY_SYMLINK = 0x00000800; +#endif + +DWORD CALLBACK copyCallbackInternal( + LARGE_INTEGER totalFileSize, + LARGE_INTEGER totalBytesTransferred, + LARGE_INTEGER streamSize, + LARGE_INTEGER streamBytesTransferred, + DWORD dwStreamNumber, + DWORD dwCallbackReason, + HANDLE hSourceFile, + HANDLE hDestinationFile, + LPVOID lpData) +{ + using FreeFileSync::CopyFileCallback; + + //small performance optimization: it seems this callback function is called for every 64 kB (depending on cluster size). + static unsigned int callNr = 0; + if (++callNr % 50 == 0) //reduce by factor of 50 =^ 10-20 calls/sec + { + if (lpData != NULL) + { + //some odd check for some possible(?) error condition + if (totalBytesTransferred.HighPart < 0) //let's see if someone answers the call... + ::MessageBox(NULL, wxT("You've just discovered a bug in WIN32 API function \"CopyFileEx\"! \n\n\ + Please write a mail to the author of FreeFileSync at zhnmju123@gmx.de and simply state that\n\ + \"totalBytesTransferred.HighPart can be below zero\"!\n\n\ + This will then be handled in future versions of FreeFileSync.\n\nThanks -ZenJu"), + NULL, 0); + + + CopyFileCallback* callback = static_cast<CopyFileCallback*>(lpData); + + switch (callback->updateCopyStatus(wxULongLong(totalBytesTransferred.HighPart, totalBytesTransferred.LowPart))) + { + case CopyFileCallback::CONTINUE: + break; + case CopyFileCallback::CANCEL: + return PROGRESS_CANCEL; + } + } + } + + return PROGRESS_CONTINUE; +} + + +bool supportForSymbolicLinks() +{ + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + //symbolic links are supported starting with Vista + if (GetVersionEx(&osvi)) + return osvi.dwMajorVersion > 5; //XP has majorVersion == 5, minorVersion == 1, Vista majorVersion == 6 + + return false; +} + + +void FreeFileSync::copyFile(const Zstring& sourceFile, + const Zstring& targetFile, + const bool copyFileSymLinks, + ShadowCopy* shadowCopyHandler, + CopyFileCallback* callback) +{ + DWORD copyFlags = COPY_FILE_FAIL_IF_EXISTS; + + //copy symbolic links instead of the files pointed at + static const bool symlinksSupported = supportForSymbolicLinks(); //only set "true" if supported by OS: else copying in Windows XP fails + if (copyFileSymLinks && symlinksSupported) + copyFlags |= COPY_FILE_COPY_SYMLINK; + + if (!::CopyFileEx( //same performance as CopyFile() + sourceFile.c_str(), + targetFile.c_str(), + copyCallbackInternal, + callback, + NULL, + copyFlags)) + { + const DWORD lastError = ::GetLastError(); + + //don't suppress "lastError == ERROR_REQUEST_ABORTED": an user aborted operation IS an error condition! + + //if file is locked (try to) use Windows Volume Shadow Copy Service + if (lastError == ERROR_SHARING_VIOLATION && shadowCopyHandler != NULL) + { + const Zstring shadowFilename(shadowCopyHandler->makeShadowCopy(sourceFile)); + FreeFileSync::copyFile(shadowFilename, //transferred bytes is automatically reset when new file is copied + targetFile, + copyFileSymLinks, + shadowCopyHandler, + callback); + return; + } + + const wxString errorMessage = wxString(_("Error copying file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\" ->\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(lastError)); + } +} + + +#elif defined FFS_LINUX +struct MemoryAllocator +{ + MemoryAllocator() + { + buffer = new char[bufferSize]; + } + + ~MemoryAllocator() + { + delete [] buffer; + } + + static const unsigned int bufferSize = 512 * 1024; + char* buffer; +}; + + +void FreeFileSync::copyFile(const Zstring& sourceFile, + const Zstring& targetFile, + const bool copyFileSymLinks, + CopyFileCallback* callback) +{ + using FreeFileSync::CopyFileCallback; + + if (FreeFileSync::fileExists(targetFile.c_str())) + throw FileError(wxString(_("Error copying file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\" ->\n\"") + targetFile.c_str() + wxT("\"\n\n") + + _("Target file already existing!")); + + //symbolic link handling + if (copyFileSymLinks) + { + //test if sourceFile is a symbolic link + struct stat linkInfo; + if (lstat(sourceFile.c_str(), &linkInfo) != 0) + { + const wxString errorMessage = wxString(_("Error reading file attributes:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + if (S_ISLNK(linkInfo.st_mode)) + { + //copy symbolic link + const int BUFFER_SIZE = 10000; + char buffer[BUFFER_SIZE]; + const int bytesWritten = readlink(sourceFile.c_str(), buffer, BUFFER_SIZE); + if (bytesWritten < 0 || bytesWritten == BUFFER_SIZE) + { + wxString errorMessage = wxString(_("Error resolving symbolic link:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\""); + if (bytesWritten < 0) errorMessage += wxString(wxT("\n\n")) + FreeFileSync::getLastErrorFormatted(); + throw FileError(errorMessage); + } + //set null-terminating char + buffer[bytesWritten] = 0; + + if (symlink(buffer, targetFile.c_str()) != 0) + { + const wxString errorMessage = wxString(_("Error writing file:")) + wxT("\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + return; //symlink created successfully + } + } + + //begin of regular file copy + struct stat fileInfo; + if (stat(sourceFile.c_str(), &fileInfo) != 0) //read file attributes from source file (resolving symlinks) + { + const wxString errorMessage = wxString(_("Error reading file attributes:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + //open sourceFile for reading + std::ifstream fileIn(sourceFile.c_str(), std::ios_base::binary); + if (fileIn.fail()) + throw FileError(wxString(_("Error opening file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\"")); + + //create targetFile and open it for writing + std::ofstream fileOut(targetFile.c_str(), std::ios_base::binary); + if (fileOut.fail()) + throw FileError(wxString(_("Error opening file:")) + wxT("\n\"") + targetFile.c_str() + wxT("\"")); + + try + { + //copy contents of sourceFile to targetFile + wxULongLong totalBytesTransferred; + static MemoryAllocator memory; + while (true) + { + fileIn.read(memory.buffer, memory.bufferSize); + if (fileIn.eof()) //end of file? fail bit is set in this case also! + { + fileOut.write(memory.buffer, fileIn.gcount()); + if (fileOut.bad()) + throw FileError(wxString(_("Error writing file:")) + wxT("\n\"") + targetFile.c_str() + wxT("\"")); + break; + } + else if (fileIn.fail()) + throw FileError(wxString(_("Error reading file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\"")); + + + fileOut.write(memory.buffer, memory.bufferSize); + if (fileOut.bad()) + throw FileError(wxString(_("Error writing file:")) + wxT("\n\"") + targetFile.c_str() + wxT("\"")); + + totalBytesTransferred += memory.bufferSize; + + //invoke callback method to update progress indicators + if (callback != NULL) + { + switch (callback->updateCopyStatus(totalBytesTransferred)) + { + case CopyFileCallback::CONTINUE: + break; + + case CopyFileCallback::CANCEL: + //an user aborted operation IS an error condition! + throw FileError(wxString(_("Error copying file:")) + wxT("\n\"") + sourceFile.c_str() + wxT("\" ->\n\"") + + targetFile.c_str() + wxT("\"\n\n") + _("Operation aborted!")); + } + } + } + + //close streams before changing attributes + fileIn.close(); + fileOut.close(); + + //adapt file modification time: + struct utimbuf newTimes; + time(&newTimes.actime); //set file access time to current time + newTimes.modtime = fileInfo.st_mtime; + if (utime(targetFile.c_str(), &newTimes) != 0) + { + wxString errorMessage = wxString(_("Error changing modification time:")) + wxT("\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + + //set file access rights + if (chmod(targetFile.c_str(), fileInfo.st_mode) != 0) + { + wxString errorMessage = wxString(_("Error writing file attributes:")) + wxT("\n\"") + targetFile.c_str() + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted()); + } + } + catch (...) + { //try to delete target file if error occured, or exception was thrown in callback function + if (FreeFileSync::fileExists(targetFile)) + ::unlink(targetFile); //don't handle error situations! + + throw; + } +} +#endif + + + +/* +#ifdef FFS_WIN +inline +Zstring getDriveName(const Zstring& directoryName) //GetVolume() doesn't work under Linux! +{ + const Zstring volumeName = wxFileName(directoryName.c_str()).GetVolume().c_str(); + if (volumeName.empty()) + return Zstring(); + + return volumeName + wxFileName::GetVolumeSeparator().c_str() + globalFunctions::FILE_NAME_SEPARATOR; +} + + +bool FreeFileSync::isFatDrive(const Zstring& directoryName) +{ + const Zstring driveName = getDriveName(directoryName); + if (driveName.empty()) + return false; + + wxChar fileSystem[32]; + if (!GetVolumeInformation(driveName.c_str(), NULL, 0, NULL, NULL, NULL, fileSystem, 32)) + return false; + + return Zstring(fileSystem).StartsWith(wxT("FAT")); +} +#endif //FFS_WIN +*/ diff --git a/shared/fileHandling.h b/shared/fileHandling.h new file mode 100644 index 00000000..b5e75c17 --- /dev/null +++ b/shared/fileHandling.h @@ -0,0 +1,79 @@ +#ifndef RECYCLER_H_INCLUDED +#define RECYCLER_H_INCLUDED + +#include "zstring.h" +#include "fileError.h" +#include <wx/longlong.h> + + +namespace FreeFileSync +{ + Zstring getFormattedDirectoryName(const Zstring& dirname); + + bool fileExists(const DefaultChar* filename); //replaces wxFileExists()! + bool dirExists(const DefaultChar* dirname); //replaces wxDirExists(): optional 'cause wxDirExists treats symlinks correctly + bool symlinkExists(const DefaultChar* objname); //check if a symbolic link exists + + //recycler + bool recycleBinExists(); //test existence of Recycle Bin API on current system + + //file handling + void removeFile(const Zstring& filename, const bool useRecycleBin); //throw (FileError, ::RuntimeException); + void removeDirectory(const Zstring& directory, const bool useRecycleBin); //throw (FileError); + + + class MoveFileCallback //callback functionality + { + public: + virtual ~MoveFileCallback() {} + + enum Response + { + CONTINUE, + CANCEL + }; + virtual Response requestUiRefresh() = 0; //DON'T throw exceptions here, at least in Windows build! + }; + + //move source to target; expectations: target not existing, all super-directories of target exist + void moveFile(const Zstring& sourceFile, const Zstring& targetFile, MoveFileCallback* callback = NULL); //throw (FileError); + + //move source to target including subdirectories + //"ignoreExistingDirs": existing directories will be enhanced as long as this is possible without overwriting files + void moveDirectory(const Zstring& sourceDir, const Zstring& targetDir, bool ignoreExistingDirs, MoveFileCallback* callback = NULL); //throw (FileError); + + //creates superdirectories automatically: + void createDirectory(const Zstring& directory, const Zstring& templateDir = Zstring(), const bool copyDirectorySymLinks = false); //throw (FileError); + + class CopyFileCallback //callback functionality + { + public: + virtual ~CopyFileCallback() {} + + enum Response + { + CONTINUE, + CANCEL + }; + virtual Response updateCopyStatus(const wxULongLong& totalBytesTransferred) = 0; //DON'T throw exceptions here, at least in Windows build! + }; + +#ifdef FFS_WIN + class ShadowCopy; + + void copyFile(const Zstring& sourceFile, + const Zstring& targetFile, + const bool copyFileSymLinks, + ShadowCopy* shadowCopyHandler = NULL, //supply handler for making shadow copies + CopyFileCallback* callback = NULL); //throw (FileError); + +#elif defined FFS_LINUX + void copyFile(const Zstring& sourceFile, + const Zstring& targetFile, + const bool copyFileSymLinks, + CopyFileCallback* callback = NULL); //throw (FileError); +#endif +} + + +#endif // RECYCLER_H_INCLUDED diff --git a/shared/fileTraverser.cpp b/shared/fileTraverser.cpp new file mode 100644 index 00000000..6438b358 --- /dev/null +++ b/shared/fileTraverser.cpp @@ -0,0 +1,361 @@ +#include "fileTraverser.h" +#include "globalFunctions.h" +#include "systemFunctions.h" +#include <wx/intl.h> + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" + +#elif defined FFS_LINUX +#include <sys/stat.h> +#include <dirent.h> +#include <errno.h> +#endif + + +#ifdef FFS_WIN +class CloseHandleOnExit +{ +public: + CloseHandleOnExit(HANDLE fileHandle) : fileHandle_(fileHandle) {} + + ~CloseHandleOnExit() + { + CloseHandle(fileHandle_); + } + +private: + HANDLE fileHandle_; +}; + + +class CloseFindHandleOnExit +{ +public: + CloseFindHandleOnExit(HANDLE searchHandle) : searchHandle_(searchHandle) {} + + ~CloseFindHandleOnExit() + { + FindClose(searchHandle_); + } + +private: + HANDLE searchHandle_; +}; + + +inline +void setWin32FileInformation(const FILETIME& lastWriteTime, + const DWORD fileSizeHigh, + const DWORD fileSizeLow, + FreeFileSync::TraverseCallback::FileInfo& output) +{ + //convert UTC FILETIME to ANSI C format (number of seconds since Jan. 1st 1970 UTC) + wxLongLong writeTimeLong(wxInt32(lastWriteTime.dwHighDateTime), lastWriteTime.dwLowDateTime); + writeTimeLong /= 10000000; //reduce precision to 1 second (FILETIME has unit 10^-7 s) + writeTimeLong -= wxLongLong(2, 3054539008UL); //timeshift between ansi C time and FILETIME in seconds == 11644473600s + output.lastWriteTimeRaw = writeTimeLong; + + output.fileSize = wxULongLong(fileSizeHigh, fileSizeLow); +} + + +inline +bool setWin32FileInformationFromSymlink(const Zstring linkName, FreeFileSync::TraverseCallback::FileInfo& output) +{ + //open handle to target of symbolic link + HANDLE hFile = ::CreateFile(linkName.c_str(), + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + if (hFile == INVALID_HANDLE_VALUE) + return false; + + CloseHandleOnExit dummy(hFile); + + BY_HANDLE_FILE_INFORMATION fileInfoByHandle; + + if (!::GetFileInformationByHandle( + hFile, + &fileInfoByHandle)) + return false; + + //write output + setWin32FileInformation(fileInfoByHandle.ftLastWriteTime, fileInfoByHandle.nFileSizeHigh, fileInfoByHandle.nFileSizeLow, output); + return true; +} + +#elif defined FFS_LINUX +class CloseDirOnExit +{ +public: + CloseDirOnExit(DIR* dir) : m_dir(dir) {} + + ~CloseDirOnExit() + { + ::closedir(m_dir); //no error handling here + } + +private: + DIR* m_dir; +}; +#endif + + +template <bool traverseDirectorySymlinks> +bool traverseDirectory(const Zstring& directory, FreeFileSync::TraverseCallback* sink, const int level) +{ + using FreeFileSync::TraverseCallback; + + if (level == 100) //catch endless recursion + { + switch (sink->onError(wxString(_("Endless loop when traversing directory:")) + wxT("\n\"") + directory + wxT("\""))) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + return true; + } + } + +#ifdef FFS_WIN + //ensure directoryFormatted ends with backslash + const Zstring directoryFormatted = directory.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? + directory : + directory + globalFunctions::FILE_NAME_SEPARATOR; + + WIN32_FIND_DATA fileMetaData; + HANDLE searchHandle = FindFirstFile((directoryFormatted + DefaultChar('*')).c_str(), //pointer to name of file to search for + &fileMetaData); //pointer to returned information + + if (searchHandle == INVALID_HANDLE_VALUE) + { + const DWORD lastError = ::GetLastError(); + if (lastError == ERROR_FILE_NOT_FOUND) + return true; + + //else: we have a problem... report it: + const wxString errorMessage = wxString(_("Error traversing directory:")) + wxT("\n\"") + directory.c_str() + wxT("\"") ; + switch (sink->onError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(lastError))) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + return true; + } + } + CloseFindHandleOnExit dummy(searchHandle); + + do + { //don't return "." and ".." + const wxChar* const shortName = fileMetaData.cFileName; + if ( shortName[0] == wxChar('.') && + ((shortName[1] == wxChar('.') && shortName[2] == wxChar('\0')) || + shortName[1] == wxChar('\0'))) + continue; + + const Zstring fullName = directoryFormatted + shortName; + + if (fileMetaData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) //a directory... (for directory symlinks this flag is set too!) + { + const TraverseCallback::ReturnValDir rv = sink->onDir(shortName, fullName); + switch (rv.returnCode) + { + case TraverseCallback::ReturnValDir::TRAVERSING_STOP: + return false; + + case TraverseCallback::ReturnValDir::TRAVERSING_IGNORE_DIR: + break; + + case TraverseCallback::ReturnValDir::TRAVERSING_CONTINUE: + //traverse into symbolic links, junctions, etc. if requested only: + if (traverseDirectorySymlinks || (~fileMetaData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) + if (!traverseDirectory<traverseDirectorySymlinks>(fullName, rv.subDirCb, level + 1)) + return false; + break; + } + } + else //a file... + { + TraverseCallback::FileInfo details; + + if (fileMetaData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) //dereference symlinks! + { + if (!setWin32FileInformationFromSymlink(fullName, details)) //broken symlink + { + details.lastWriteTimeRaw = 0; //we are not interested in the modifiation time of the link + details.fileSize = 0; + } + } + else + setWin32FileInformation(fileMetaData.ftLastWriteTime, fileMetaData.nFileSizeHigh, fileMetaData.nFileSizeLow, details); + + switch (sink->onFile(shortName, fullName, details)) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + break; + } + } + } + while (FindNextFile(searchHandle, // handle to search + &fileMetaData)); // pointer to structure for data on found file + + const DWORD lastError = ::GetLastError(); + if (lastError == ERROR_NO_MORE_FILES) + return true; //everything okay + + //else: we have a problem... report it: + const wxString errorMessage = wxString(_("Error traversing directory:")) + wxT("\n\"") + directory.c_str() + wxT("\"") ; + switch (sink->onError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted(lastError))) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + return true; + } + +#elif defined FFS_LINUX + DIR* dirObj = ::opendir(directory.c_str()); //directory must NOT end with path separator, except "/" + if (dirObj == NULL) + { + const wxString errorMessage = wxString(_("Error traversing directory:")) + wxT("\n\"") + directory.c_str() + wxT("\"") ; + switch (sink->onError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted())) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + return true; + } + } + CloseDirOnExit dummy(dirObj); + + while (true) + { + errno = 0; //set errno to 0 as unfortunately this isn't done when readdir() returns NULL because it can't find any files + struct dirent* dirEntry = ::readdir(dirObj); + if (dirEntry == NULL) + { + if (errno == 0) + return true; //everything okay + + //else: we have a problem... report it: + const wxString errorMessage = wxString(_("Error traversing directory:")) + wxT("\n\"") + directory.c_str() + wxT("\"") ; + switch (sink->onError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted())) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + return true; + } + } + + //don't return "." and ".." + const wxChar* const shortName = dirEntry->d_name; + if ( shortName[0] == wxChar('.') && + ((shortName[1] == wxChar('.') && shortName[2] == wxChar('\0')) || + shortName[1] == wxChar('\0'))) + continue; + + const Zstring fullName = directory.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? //e.g. "/" + directory + shortName : + directory + globalFunctions::FILE_NAME_SEPARATOR + shortName; + + struct stat fileInfo; + if (lstat(fullName.c_str(), &fileInfo) != 0) //lstat() does not resolve symlinks + { + const wxString errorMessage = wxString(_("Error reading file attributes:")) + wxT("\n\"") + fullName.c_str() + wxT("\""); + switch (sink->onError(errorMessage + wxT("\n\n") + FreeFileSync::getLastErrorFormatted())) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + break; + } + continue; + } + + const bool isSymbolicLink = S_ISLNK(fileInfo.st_mode); + if (isSymbolicLink) //dereference symbolic links + { + if (stat(fullName.c_str(), &fileInfo) != 0) //stat() resolves symlinks + { + //a broken symbolic link + TraverseCallback::FileInfo details; + details.lastWriteTimeRaw = 0; //we are not interested in the modifiation time of the link + details.fileSize = 0; + + switch (sink->onFile(shortName, fullName, details)) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + break; + } + continue; + } + } + + + if (S_ISDIR(fileInfo.st_mode)) //a directory... (note: symbolic links need to be dereferenced to test if they point to a directory!) + { + const TraverseCallback::ReturnValDir rv = sink->onDir(shortName, fullName); + switch (rv.returnCode) + { + case TraverseCallback::ReturnValDir::TRAVERSING_STOP: + return false; + + case TraverseCallback::ReturnValDir::TRAVERSING_IGNORE_DIR: + break; + + case TraverseCallback::ReturnValDir::TRAVERSING_CONTINUE: + //traverse into symbolic links, junctions, etc. if requested only: + if (traverseDirectorySymlinks || !isSymbolicLink) //traverse into symbolic links if requested only + if (!traverseDirectory<traverseDirectorySymlinks>(fullName, rv.subDirCb, level + 1)) + return false; + break; + } + } + else //a file... + { + TraverseCallback::FileInfo details; + details.lastWriteTimeRaw = fileInfo.st_mtime; //UTC time(ANSI C format); unit: 1 second + details.fileSize = fileInfo.st_size; + + switch (sink->onFile(shortName, fullName, details)) + { + case TraverseCallback::TRAVERSING_STOP: + return false; + case TraverseCallback::TRAVERSING_CONTINUE: + break; + } + } + } +#endif + + return true; //dummy value +} + + +void FreeFileSync::traverseFolder(const Zstring& directory, + const bool traverseDirectorySymlinks, + TraverseCallback* sink) +{ +#ifdef FFS_WIN + const Zstring& directoryFormatted = directory; +#elif defined FFS_LINUX + const Zstring directoryFormatted = //remove trailing slash + directory.size() > 1 && directory.EndsWith(globalFunctions::FILE_NAME_SEPARATOR) ? //exception: allow '/' + directory.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR) : + directory; +#endif + + if (traverseDirectorySymlinks) + traverseDirectory<true>(directoryFormatted, sink, 0); + else + traverseDirectory<false>(directoryFormatted, sink, 0); +} diff --git a/shared/fileTraverser.h b/shared/fileTraverser.h new file mode 100644 index 00000000..d2aa7f3e --- /dev/null +++ b/shared/fileTraverser.h @@ -0,0 +1,64 @@ +#ifndef FILETRAVERSER_H_INCLUDED +#define FILETRAVERSER_H_INCLUDED + +#include "zstring.h" +#include <set> +#include <memory> +#include <wx/longlong.h> + +//advanced file traverser returning metadata and hierarchical information on files and directories + +namespace FreeFileSync +{ + class TraverseCallback + { + public: + virtual ~TraverseCallback() {} + + enum ReturnValue + { + TRAVERSING_STOP, + TRAVERSING_CONTINUE + }; + + struct FileInfo + { + wxULongLong fileSize; //unit: bytes! + wxLongLong lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC + }; + + class ReturnValDir + { + public: + //some proxy classes + class Stop {}; + class Ignore {}; + class Continue {}; + + ReturnValDir(const Stop&) : returnCode(TRAVERSING_STOP), subDirCb(NULL) {} + ReturnValDir(const Ignore&) : returnCode(TRAVERSING_IGNORE_DIR), subDirCb(NULL) {} + ReturnValDir(const Continue&, TraverseCallback* subDirCallback) : returnCode(TRAVERSING_CONTINUE), subDirCb(subDirCallback) {} + + + enum ReturnValueEnh + { + TRAVERSING_STOP, + TRAVERSING_IGNORE_DIR, + TRAVERSING_CONTINUE + }; + + const ReturnValueEnh returnCode; + TraverseCallback* const subDirCb; + }; + + //overwrite these virtual methods + virtual ReturnValue onError(const wxString& errorText) = 0; + virtual ReturnValue onFile(const DefaultChar* shortName, const Zstring& fullName, const FileInfo& details) = 0; + virtual ReturnValDir onDir(const DefaultChar* shortName, const Zstring& fullName) = 0; + }; + + //custom traverser with detail information about files + void traverseFolder(const Zstring& directory, const bool traverseDirectorySymlinks, TraverseCallback* sink); //throw() +} + +#endif // FILETRAVERSER_H_INCLUDED diff --git a/shared/globalFunctions.cpp b/shared/globalFunctions.cpp new file mode 100644 index 00000000..cbdf29bb --- /dev/null +++ b/shared/globalFunctions.cpp @@ -0,0 +1,177 @@ +#include "globalFunctions.h" +#include <wx/msgdlg.h> +#include <wx/file.h> +#include <fstream> +#include <wx/stream.h> +#include <wx/stopwatch.h> +#include <cmath> + + +wxString globalFunctions::numberToWxString(const unsigned int number) +{ + return wxString::Format(wxT("%u"), number); +} + + +wxString globalFunctions::numberToWxString(const int number) +{ + return wxString::Format(wxT("%i"), number); +} + + +wxString globalFunctions::numberToWxString(const float number) +{ + return wxString::Format(wxT("%f"), number); +} + + +int globalFunctions::stringToInt(const std::string& number) +{ + return atoi(number.c_str()); +} + + +long globalFunctions::stringToLong(const std::string& number) +{ + return atol(number.c_str()); +} + + +double globalFunctions::stringToDouble(const std::string& number) +{ + return atof(number.c_str()); +} + + +int globalFunctions::wxStringToInt(const wxString& number) +{ + long result = 0; + if (number.ToLong(&result)) + return result; + else + return 0; //don't throw exceptions here: wxEmptyString shall be interpreted as 0 + //throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> long")); +} + + +double globalFunctions::wxStringToDouble(const wxString& number) +{ + double result = 0; + if (number.ToDouble(&result)) + return result; + else + return 0; //don't throw exceptions here: wxEmptyString shall be interpreted as 0 + //throw RuntimeException(wxString(_("Conversion error:")) + wxT(" wxString -> double")); +} + + +unsigned int globalFunctions::getDigitCount(const unsigned int number) //count number of digits +{ + return number == 0 ? 1 : static_cast<unsigned int>(::log10(static_cast<double>(number))) + 1; +} + + +int globalFunctions::readInt(std::ifstream& stream) +{ + int result = 0; + char* buffer = reinterpret_cast<char*>(&result); + stream.read(buffer, sizeof(int)); + return result; +} + + +void globalFunctions::writeInt(std::ofstream& stream, const int number) +{ + const char* buffer = reinterpret_cast<const char*>(&number); + stream.write(buffer, sizeof(int)); +} + + +int globalFunctions::readInt(wxInputStream& stream) +{ + int result = 0; + char* buffer = reinterpret_cast<char*>(&result); + stream.Read(buffer, sizeof(int)); + return result; +} + + +void globalFunctions::writeInt(wxOutputStream& stream, const int number) +{ + const char* buffer = reinterpret_cast<const char*>(&number); + stream.Write(buffer, sizeof(int)); +} + + +//############################################################################ +Performance::Performance() : + resultWasShown(false), + timer(new wxStopWatch) +{ + timer->Start(); +} + + +Performance::~Performance() +{ + if (!resultWasShown) + showResult(); +} + + +void Performance::showResult() +{ + resultWasShown = true; + wxMessageBox(globalFunctions::numberToWxString(unsigned(timer->Time())) + wxT(" ms")); + timer->Start(); //reset timer +} + + +//############################################################################ +DebugLog::DebugLog() : + lineCount(0), + logFile(NULL) +{ + logFile = new wxFile; + logfileName = assembleFileName(); + logFile->Open(logfileName.c_str(), wxFile::write); +} + + +DebugLog::~DebugLog() +{ + delete logFile; //automatically closes file handle +} + + +wxString DebugLog::assembleFileName() +{ + wxString tmp = wxDateTime::Now().FormatISOTime(); + tmp.Replace(wxT(":"), wxEmptyString); + return wxString(wxT("DEBUG_")) + wxDateTime::Now().FormatISODate() + wxChar('_') + tmp + wxT(".log"); +} + + +void DebugLog::write(const wxString& logText) +{ + ++lineCount; + if (lineCount % 50000 == 0) //prevent logfile from becoming too big + { + logFile->Close(); + wxRemoveFile(logfileName); + + logfileName = assembleFileName(); + logFile->Open(logfileName.c_str(), wxFile::write); + } + + logFile->Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); + logFile->Write(logText + globalFunctions::LINE_BREAK); +} + +//DebugLog logDebugInfo; + + +wxString getCodeLocation(const wxString file, const int line) +{ + return wxString(file).AfterLast(globalFunctions::FILE_NAME_SEPARATOR) + wxT(", LINE ") + globalFunctions::numberToWxString(line) + wxT(" | "); +} diff --git a/shared/globalFunctions.h b/shared/globalFunctions.h new file mode 100644 index 00000000..00566b5f --- /dev/null +++ b/shared/globalFunctions.h @@ -0,0 +1,167 @@ +#ifndef GLOBALFUNCTIONS_H_INCLUDED +#define GLOBALFUNCTIONS_H_INCLUDED + +#include <string> +#include <algorithm> +#include <vector> +#include <set> +#include <wx/string.h> +#include <wx/longlong.h> +#include <memory> +#include <sstream> + +class wxInputStream; +class wxOutputStream; +class wxStopWatch; + + +namespace globalFunctions +{ +//------------------------------------------------ +// GLOBALS +//------------------------------------------------ +#ifdef FFS_WIN + const wxChar FILE_NAME_SEPARATOR = '\\'; + static const wxChar* const LINE_BREAK = wxT("\r\n"); //internal linkage +#elif defined FFS_LINUX + const wxChar FILE_NAME_SEPARATOR = '/'; + static const wxChar* const LINE_BREAK = wxT("\n"); +#endif + +//------------------------------------------------ +// FUNCTIONS +//------------------------------------------------ + inline + int round(double d) //little rounding function + { + return static_cast<int>(d < 0 ? d - .5 : d + .5); + } + + template <class T> + inline + T abs(const T& d) //absolute value + { + return(d < 0 ? -d : d); + } + + template <class T> + inline std::string numberToString(const T& number) //convert number to string the C++ way + { + std::stringstream ss; + ss << number; + return ss.str(); + } + + wxString numberToWxString(const unsigned int number); //convert number to wxString + wxString numberToWxString(const int number); //convert number to wxString + wxString numberToWxString(const float number); //convert number to wxString + + int stringToInt( const std::string& number); //convert String to number + long stringToLong( const std::string& number); //convert String to number + double stringToDouble(const std::string& number); //convert String to number + + int wxStringToInt( const wxString& number); //convert wxString to number + double wxStringToDouble(const wxString& number); //convert wxString to number + + unsigned int getDigitCount(const unsigned int number); //count number of digits + + int readInt(std::ifstream& stream); //read int from file stream + void writeInt(std::ofstream& stream, const int number); //write int to filestream + + int readInt(wxInputStream& stream); //read int from file stream + void writeInt(wxOutputStream& stream, const int number); //write int to filestream + + inline + wxLongLong convertToSigned(const wxULongLong number) + { + return wxLongLong(number.GetHi(), number.GetLo()); + } + + + //Note: the following lines are a performance optimization for deleting elements from a vector. It is incredibly faster to create a new +//vector and leave specific elements out than to delete row by row and force recopying of most elements for each single deletion (linear vs quadratic runtime) + template <class T> + void removeRowsFromVector(const std::set<int>& rowsToRemove, std::vector<T>& grid) + { + if (rowsToRemove.size() > 0) + { + std::vector<T> temp; + + std::set<int>::const_iterator rowToSkipIndex = rowsToRemove.begin(); + int rowToSkip = *rowToSkipIndex; + + for (int i = 0; i < int(grid.size()); ++i) + { + if (i != rowToSkip) + temp.push_back(grid[i]); + else + { + ++rowToSkipIndex; + if (rowToSkipIndex != rowsToRemove.end()) + rowToSkip = *rowToSkipIndex; + } + } + grid.swap(temp); + } + } +} + + +//############################################################################ +class Performance +{ +public: + wxDEPRECATED(Performance()); //generate compiler warnings as a reminder to remove code after measurements + ~Performance(); + void showResult(); + +private: + bool resultWasShown; + std::auto_ptr<wxStopWatch> timer; +}; + +//two macros for quick performance measurements +#define PERF_START Performance a; +#define PERF_STOP a.showResult(); + + +//############################################################################ +class wxFile; +class DebugLog +{ +public: + wxDEPRECATED(DebugLog()); + ~DebugLog(); + void write(const wxString& logText); + +private: + wxString assembleFileName(); + wxString logfileName; + int lineCount; + wxFile* logFile; //logFile.close(); <- not needed +}; +extern DebugLog logDebugInfo; +wxString getCodeLocation(const wxString file, const int line); + +//small macro for writing debug information into a logfile +#define WRITE_DEBUG_LOG(x) logDebugInfo.write(getCodeLocation(__TFILE__, __LINE__) + x); +//speed alternative: wxLogDebug(wxT("text")) + DebugView + + +//############################################################################ +class RuntimeException //Exception class used to notify of general runtime exceptions +{ +public: + RuntimeException(const wxString& txt) : errorMessage(txt) {} + + wxString show() const + { + return errorMessage; + } + +private: + wxString errorMessage; +}; + + +#endif // GLOBALFUNCTIONS_H_INCLUDED diff --git a/shared/inotify/CHANGELOG b/shared/inotify/CHANGELOG new file mode 100644 index 00000000..8830d918 --- /dev/null +++ b/shared/inotify/CHANGELOG @@ -0,0 +1,95 @@ +0.7.2 2007-04-18 + * added #include <stdint.h> (required for Debian Sarge, #0000155) + +0.7.1 2007-01-20 + * incorrect event name handling fixed (#0000135) + +0.7.0 2007-01-13 + * added Inotify::SetCloseOnExec() for simple setting this feature + + +0.6.3 2007-01-06 + * incorrect behavior for IN_IGNORED fixed (#0000124) + + +0.6.2 2007-01-03 + * bad IN_MOVE_SELF dumping in IN_ALL_EVENTS fixed (#0000118) + + +0.6.1 2006-12-30 + * fixed incorrect behavior for IN_ONESHOT (#0000113) + + +0.6.0 2006-12-28 + * added methods for getting/setting inotify capabilities and limits + * added IN_SELF_MOVED flag (if defined) + * added Inotify::IsRecursive() for identifying recursive watches + (will be implemented in future versions) + +0.5.3 2006-12-06 + * fixed incorrect error handling in WaitForEvents() + + +0.5.2 2006-11-12 + * problem with ignoring IN_OPEN has been fixed (#0000102) + + +0.5.1 2006-11-10 + * problems with includes have been fixed (#0000099) + + +0.5.0 2006-10-29 + * partial thread safety has been implemented (using rwlocks) + * Inotify::GetEnabledCount() method has been added + + +0.4.1 2006-10-14 + * wrong value returned by Inotify::GetWatchCount() has been fixed + (#0000092) + + +0.4.0 2006-10-13 + * two additional flags (IN_ONLYDIR and IN_DONT_FOLLOW) may be used + if available (#0000086) + * "errorneous" multiple watches on the same path are no longer + possible (#0000087) + * tarball structure has been fixed (#0000088) + * inotify-syscalls.h is included only if inotify.h doesn't contain + syscall definitions (#0000090) + * enabling/disabling is now done through watch presence in the kernel + instead of dropping events (#0000091) + * InotifyWatch::SetMask() method has been added to allow later mask + modification + + +0.3.1 2006-10-03 + * fixed: wrong behavior for EWOULDBLOCK (Inotify::WaitForEvents()) + + +0.3.0 2006-10-03 + * all errors now handled using exceptions (InotifyException) + * InotifyEvent no longer use struct inotity_event as its + internal data structure + * removed InotifyEvent::GetData() - internal data changed + * removed Inotify::IsReady() - no longer necessary + * added Inotify::GetDescriptor() - returns inotify file descriptor + * added Inotify::SetNonBlock() - switches nonblocking mode on/off + * added possibility to enable/disable watches + * some code cleanups + + +0.2.0 2006-09-15 + * InotifyEvent now contains a pointer to the source InotifyWatch + * fixed: InotifyEvent::IsType() - it now handles the mask correctly + * added a static method (InotifyEvent::GetMaskByName()) for finding a mask + for a name + * added a static version of InotifyEvent::DumpTypes() method + * added a static version of InotifyEvent::IsType() method + * dumped types (InotifyEvent::DumpTypes()) now separated by commas + instead of spaces + * InotifyEvent::DumpTypes() methods now use as general types as possible + * InotifyWatch now contains a pointer to the related Inotify + + +0.1.0 2006-09-04 +first alpha version diff --git a/shared/inotify/COPYING b/shared/inotify/COPYING new file mode 100644 index 00000000..272a9567 --- /dev/null +++ b/shared/inotify/COPYING @@ -0,0 +1,13 @@ +inotify C++ interface + +Copyright (C) 2006, 2007 Lukas Jelinek, <lukas@aiken.cz> + +This program is free software; you can redistribute it and/or +modify it under the terms of one of the following licenses: + +1. X11 license (see LICENSE-X11) +2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) +3. GNU General Public License, version 2 (see LICENSE-GPL) + +If you want to help with choosing the best license for you, +please visit http://www.gnu.org/licenses/license-list.html. diff --git a/shared/inotify/LICENSE-GPL b/shared/inotify/LICENSE-GPL new file mode 100644 index 00000000..a43ea212 --- /dev/null +++ b/shared/inotify/LICENSE-GPL @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/shared/inotify/LICENSE-LGPL b/shared/inotify/LICENSE-LGPL new file mode 100644 index 00000000..8add30ad --- /dev/null +++ b/shared/inotify/LICENSE-LGPL @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/shared/inotify/LICENSE-X11 b/shared/inotify/LICENSE-X11 new file mode 100644 index 00000000..d632087f --- /dev/null +++ b/shared/inotify/LICENSE-X11 @@ -0,0 +1,22 @@ +Copyright (c) 2006, 2007 Lukas Jelinek + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/shared/inotify/README b/shared/inotify/README new file mode 100644 index 00000000..f3dc0db0 --- /dev/null +++ b/shared/inotify/README @@ -0,0 +1,70 @@ + +inotify C++ interface + +(c) Lukas Jelinek, 2006, 2007 + +1. About +2. Requirements +3. How to use +4. Bugs, suggestions +5. Licensing +6. Documentation + + +======================================================================== + + +1. About +This program is the inotify C++ interface. It is designed for easy use +of Linux inotify technology in C++ applications. You need not to deal +with file descriptors and such uncomfortable things. Instead you can +use a few simple C++ classes. + + +2. Requirements +* Linux kernel 2.6.13 or later (with inotify compiled in) +* inotify header(s) installed in <INCLUDE_DIR>/sys. The most common + place is /usr/include/sys. Some Linux distributions contain only + inotify.h which defines everything needed. But sometimes must + be used inotify.h and inotify-syscalls.h as available e.g. at + the inotify-cxx homepage. +* GCC 4.x compiler (probably works also with GCC 3.4, possibly with + older versions too) + + +3. How to use +Include inotify-cxx.h into your sources and add inotify-cxx.cpp for +compiling (e.g. through your makefile). + +If you have installed it into your system-wide include dir (e.g. +/usr/include), use #include <inotify-cxx.h> or similar. +Otherwise use #include "inotify-cxx.h". + +For thread-safe behavior, define the INOTIFY_THREAD_SAFE symbol +(eg. -DINOTIFY_THREAD_SAFE on gcc's command line). See documentation +for details about thread safety. + + +4. Bugs, suggestions +THIS PROGRAM IS AN ALPHA VERSION. IT PROBABLY CONTAINS BUGS AND +THEREFORE IT IS NOT INTENDED FOR PRODUCTION USE. + +If you find a bug or have a suggestion how to improve the program, +please use the bug tracking system at http://bts.aiken.cz. + + +5. Licensing +This program is free software; you can redistribute it and/or +modify it under the terms of one of the following licenses: + +1. X11 license (see LICENSE-X11) +2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) +3. GNU General Public License, version 2 (see LICENSE-GPL) + +If you want to help with choosing the best license for you, +please visit http://www.gnu.org/licenses/license-list.html. + + +6. Documentation +The API reference documentation is present in the HTML and man format. +It was generated using the doxygen program. diff --git a/shared/inotify/TODO b/shared/inotify/TODO new file mode 100644 index 00000000..7d493c05 --- /dev/null +++ b/shared/inotify/TODO @@ -0,0 +1,3 @@ +Currently pending tasks: + +* recursive watches (for watching whole directory subtrees) diff --git a/shared/inotify/VERSION b/shared/inotify/VERSION new file mode 100644 index 00000000..7486fdbc --- /dev/null +++ b/shared/inotify/VERSION @@ -0,0 +1 @@ +0.7.2 diff --git a/shared/inotify/doc/html/annotated.html b/shared/inotify/doc/html/annotated.html new file mode 100644 index 00000000..29fc335f --- /dev/null +++ b/shared/inotify/doc/html/annotated.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>inotify-cxx Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table> + <tr><td class="indexkey"><a class="el" href="classInotify.html">Inotify</a></td><td class="indexvalue"><a class="el" href="classInotify.html">Inotify</a> class </td></tr> + <tr><td class="indexkey"><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td class="indexvalue"><a class="el" href="classInotify.html">Inotify</a> event class </td></tr> + <tr><td class="indexkey"><a class="el" href="classInotifyException.html">InotifyException</a></td><td class="indexvalue">Class for inotify exceptions </td></tr> + <tr><td class="indexkey"><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td class="indexvalue"><a class="el" href="classInotify.html">Inotify</a> watch class </td></tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotify-members.html b/shared/inotify/doc/html/classInotify-members.html new file mode 100644 index 00000000..45fd612d --- /dev/null +++ b/shared/inotify/doc/html/classInotify-members.html @@ -0,0 +1,54 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>Inotify Member List</h1>This is the complete list of members for <a class="el" href="classInotify.html">Inotify</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Add</a>(InotifyWatch *pWatch)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#35dab56d3e10bf28b5e457871adddb58">Add</a>(InotifyWatch &rWatch)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Close</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#182d19b667c9e0899802b70a579eff40">FindWatch</a>(int iDescriptor)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#a4d6b9d1a9a496862febbe5bffd798c2">FindWatch</a>(const std::string &rPath)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a>(InotifyCapability_t cap)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor</a>() const</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">GetEnabledCount</a>() const</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">GetEvent</a>(InotifyEvent *pEvt)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#b028c8fa988f6bbb2ef773db3ea3a2d3">GetEvent</a>(InotifyEvent &rEvt)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">GetEventCount</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">GetMaxEvents</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">GetMaxInstances</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">GetMaxWatches</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">GetWatchCount</a>() const</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#a6fe6e9cb3343665eb968fcd5170cfb9">Inotify</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#10880f490c33acd8bd24664fc7bce4ae">InotifyWatch</a> class</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#19cde43d082ff92bd02654610019300d">PeekEvent</a>(InotifyEvent *pEvt)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#287dc0d238fa6edc3269441cb284f979">PeekEvent</a>(InotifyEvent &rEvt)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Remove</a>(InotifyWatch *pWatch)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#ac1a52b2ff6bfec07021a44e55d496a6">Remove</a>(InotifyWatch &rWatch)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#bc1fd5830ca561efb69bcd2283981741">RemoveAll</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a>(InotifyCapability_t cap, uint32_t val)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#124dd5816205900af61034d47ae65255">SetCloseOnExec</a>(bool fClOnEx)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">SetMaxEvents</a>(uint32_t val)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">SetMaxInstances</a>(uint32_t val)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">SetMaxWatches</a>(uint32_t val)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock</a>(bool fNonBlock)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#139c27c6643bb199619f3eae9b32e53b">WaitForEvents</a>(bool fNoIntr=false)</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotify.html#f19dd5e491395673e4798eb9dbf5f682">~Inotify</a>()</td><td><a class="el" href="classInotify.html">Inotify</a></td><td></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotify.html b/shared/inotify/doc/html/classInotify.html new file mode 100644 index 00000000..f37e55f6 --- /dev/null +++ b/shared/inotify/doc/html/classInotify.html @@ -0,0 +1,1016 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Inotify Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>Inotify Class Reference</h1><!-- doxytag: class="Inotify" -->inotify class +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>></code> +<p> +<a href="classInotify-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#a6fe6e9cb3343665eb968fcd5170cfb9">Inotify</a> () throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a6fe6e9cb3343665eb968fcd5170cfb9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#f19dd5e491395673e4798eb9dbf5f682">~Inotify</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#f19dd5e491395673e4798eb9dbf5f682"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Close</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes all watches and closes the inotify device. <a href="#86ae86c43ea1a72f562ca46393309635"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Add</a> (<a class="el" href="classInotifyWatch.html">InotifyWatch</a> *pWatch) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a new watch. <a href="#2ef771ebaf982d76ebe19b3f5bc9cd83"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#35dab56d3e10bf28b5e457871adddb58">Add</a> (<a class="el" href="classInotifyWatch.html">InotifyWatch</a> &rWatch) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a new watch. <a href="#35dab56d3e10bf28b5e457871adddb58"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Remove</a> (<a class="el" href="classInotifyWatch.html">InotifyWatch</a> *pWatch) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes a watch. <a href="#21c39bb8e5bbc1941b945c18f9005b84"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#ac1a52b2ff6bfec07021a44e55d496a6">Remove</a> (<a class="el" href="classInotifyWatch.html">InotifyWatch</a> &rWatch) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes a watch. <a href="#ac1a52b2ff6bfec07021a44e55d496a6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#bc1fd5830ca561efb69bcd2283981741">RemoveAll</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes all watches. <a href="#bc1fd5830ca561efb69bcd2283981741"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">GetWatchCount</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the count of watches. <a href="#b53b7935bda7425b002946d78bfe5863"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">GetEnabledCount</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the count of enabled watches. <a href="#9bf5f7716649d5b5f468c2242fb5e099"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#139c27c6643bb199619f3eae9b32e53b">WaitForEvents</a> (bool fNoIntr=false) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Waits for inotify events. <a href="#139c27c6643bb199619f3eae9b32e53b"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">GetEventCount</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the count of received and queued events. <a href="#a3c533f956871f904949832ac8f5fbde"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">GetEvent</a> (<a class="el" href="classInotifyEvent.html">InotifyEvent</a> *pEvt) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts a queued inotify event. <a href="#490a3f824c6d041d31ccaabe9bd92008"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#b028c8fa988f6bbb2ef773db3ea3a2d3">GetEvent</a> (<a class="el" href="classInotifyEvent.html">InotifyEvent</a> &rEvt) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts a queued inotify event. <a href="#b028c8fa988f6bbb2ef773db3ea3a2d3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#19cde43d082ff92bd02654610019300d">PeekEvent</a> (<a class="el" href="classInotifyEvent.html">InotifyEvent</a> *pEvt) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts a queued inotify event (without removing). <a href="#19cde43d082ff92bd02654610019300d"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#287dc0d238fa6edc3269441cb284f979">PeekEvent</a> (<a class="el" href="classInotifyEvent.html">InotifyEvent</a> &rEvt) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts a queued inotify event (without removing). <a href="#287dc0d238fa6edc3269441cb284f979"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#182d19b667c9e0899802b70a579eff40">FindWatch</a> (int iDescriptor)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Searches for a watch by a watch descriptor. <a href="#182d19b667c9e0899802b70a579eff40"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#a4d6b9d1a9a496862febbe5bffd798c2">FindWatch</a> (const std::string &rPath)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Searches for a watch by a filesystem path. <a href="#a4d6b9d1a9a496862febbe5bffd798c2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the file descriptor. <a href="#678271faf4799840ad71805163a24b13"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock</a> (bool fNonBlock) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Enables/disables non-blocking mode. <a href="#b2c8ab8ad4322fb6f0dae0eae442402b"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#124dd5816205900af61034d47ae65255">SetCloseOnExec</a> (bool fClOnEx) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Enables/disables closing on exec. <a href="#124dd5816205900af61034d47ae65255"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a> (<a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> cap) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Acquires a particular inotify capability/limit. <a href="#70b3b57e8661fbb4c5bc404b86225c3b"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a> (<a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> cap, uint32_t val) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Modifies a particular inotify capability/limit. <a href="#734538233ba2136164f76f4df6c3654e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">GetMaxEvents</a> () throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum number of events in the kernel queue. <a href="#d8e4a4a87d005c71c0b5ea9c6dd53c42"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">SetMaxEvents</a> (uint32_t val) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the maximum number of events in the kernel queue. <a href="#66d90ebfa516d4bd1463749def2b58f9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">GetMaxInstances</a> () throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum number of inotify instances per process. <a href="#c18b7732f67832260fbbd47aebb8af51"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">SetMaxInstances</a> (uint32_t val) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the maximum number of inotify instances per process. <a href="#620c891962fe5acd26485c64e9b28d19"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">GetMaxWatches</a> () throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximum number of inotify watches per instance. <a href="#86dae1b7a72c0d8fc2a632444a0f2f1f"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">SetMaxWatches</a> (uint32_t val) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the maximum number of inotify watches per instance. <a href="#5064380cdb4a726ab33f3fa18d15c77a"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html#10880f490c33acd8bd24664fc7bce4ae">InotifyWatch</a></td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +inotify class +<p> +It holds information about the inotify device descriptor and manages the event queue.<p> +If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="a6fe6e9cb3343665eb968fcd5170cfb9"></a><!-- doxytag: member="Inotify::Inotify" ref="a6fe6e9cb3343665eb968fcd5170cfb9" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Inotify::Inotify </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor. +<p> +Creates and initializes an instance of inotify communication object (opens the inotify device).<p> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if inotify isn't available </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="f19dd5e491395673e4798eb9dbf5f682"></a><!-- doxytag: member="Inotify::~Inotify" ref="f19dd5e491395673e4798eb9dbf5f682" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Inotify::~Inotify </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Destructor. +<p> +Calls <a class="el" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Close()</a> due to clean-up. +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="86ae86c43ea1a72f562ca46393309635"></a><!-- doxytag: member="Inotify::Close" ref="86ae86c43ea1a72f562ca46393309635" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::Close </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Removes all watches and closes the inotify device. +<p> + +</div> +</div><p> +<a class="anchor" name="2ef771ebaf982d76ebe19b3f5bc9cd83"></a><!-- doxytag: member="Inotify::Add" ref="2ef771ebaf982d76ebe19b3f5bc9cd83" args="(InotifyWatch *pWatch)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::Add </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td> + <td class="paramname"> <em>pWatch</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Adds a new watch. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pWatch</em> </td><td>inotify watch</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if adding failed </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="35dab56d3e10bf28b5e457871adddb58"></a><!-- doxytag: member="Inotify::Add" ref="35dab56d3e10bf28b5e457871adddb58" args="(InotifyWatch &rWatch)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::Add </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> & </td> + <td class="paramname"> <em>rWatch</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Adds a new watch. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rWatch</em> </td><td>inotify watch</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if adding failed </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="21c39bb8e5bbc1941b945c18f9005b84"></a><!-- doxytag: member="Inotify::Remove" ref="21c39bb8e5bbc1941b945c18f9005b84" args="(InotifyWatch *pWatch)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::Remove </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td> + <td class="paramname"> <em>pWatch</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Removes a watch. +<p> +If the given watch is not present it does nothing.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pWatch</em> </td><td>inotify watch</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if removing failed </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="ac1a52b2ff6bfec07021a44e55d496a6"></a><!-- doxytag: member="Inotify::Remove" ref="ac1a52b2ff6bfec07021a44e55d496a6" args="(InotifyWatch &rWatch)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::Remove </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> & </td> + <td class="paramname"> <em>rWatch</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Removes a watch. +<p> +If the given watch is not present it does nothing.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rWatch</em> </td><td>inotify watch</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if removing failed </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="bc1fd5830ca561efb69bcd2283981741"></a><!-- doxytag: member="Inotify::RemoveAll" ref="bc1fd5830ca561efb69bcd2283981741" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::RemoveAll </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Removes all watches. +<p> + +</div> +</div><p> +<a class="anchor" name="b53b7935bda7425b002946d78bfe5863"></a><!-- doxytag: member="Inotify::GetWatchCount" ref="b53b7935bda7425b002946d78bfe5863" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">size_t Inotify::GetWatchCount </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the count of watches. +<p> +This is the total count of all watches (regardless whether enabled or not).<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>count of watches</dd></dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">GetEnabledCount()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9bf5f7716649d5b5f468c2242fb5e099"></a><!-- doxytag: member="Inotify::GetEnabledCount" ref="9bf5f7716649d5b5f468c2242fb5e099" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">size_t Inotify::GetEnabledCount </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the count of enabled watches. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>count of enabled watches</dd></dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">GetWatchCount()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="139c27c6643bb199619f3eae9b32e53b"></a><!-- doxytag: member="Inotify::WaitForEvents" ref="139c27c6643bb199619f3eae9b32e53b" args="(bool fNoIntr=false)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::WaitForEvents </td> + <td>(</td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>fNoIntr</em> = <code>false</code> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Waits for inotify events. +<p> +It waits until one or more events occur. When called in nonblocking mode it only retrieves occurred events to the internal queue and exits.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fNoIntr</em> </td><td>if true it re-calls the system call after a handled signal</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if reading events failed</td></tr> + </table> +</dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a3c533f956871f904949832ac8f5fbde"></a><!-- doxytag: member="Inotify::GetEventCount" ref="a3c533f956871f904949832ac8f5fbde" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">size_t Inotify::GetEventCount </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the count of received and queued events. +<p> +This number is related to the events in the queue inside this object, not to the events pending in the kernel.<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>count of events </dd></dl> + +</div> +</div><p> +<a class="anchor" name="490a3f824c6d041d31ccaabe9bd92008"></a><!-- doxytag: member="Inotify::GetEvent" ref="490a3f824c6d041d31ccaabe9bd92008" args="(InotifyEvent *pEvt)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool Inotify::GetEvent </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyEvent.html">InotifyEvent</a> * </td> + <td class="paramname"> <em>pEvt</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Extracts a queued inotify event. +<p> +The extracted event is removed from the queue. If the pointer is NULL it does nothing.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>pEvt</em> </td><td>event object</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the provided pointer is NULL </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="b028c8fa988f6bbb2ef773db3ea3a2d3"></a><!-- doxytag: member="Inotify::GetEvent" ref="b028c8fa988f6bbb2ef773db3ea3a2d3" args="(InotifyEvent &rEvt)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool Inotify::GetEvent </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyEvent.html">InotifyEvent</a> & </td> + <td class="paramname"> <em>rEvt</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Extracts a queued inotify event. +<p> +The extracted event is removed from the queue.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>rEvt</em> </td><td>event object</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown only in very anomalous cases </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="19cde43d082ff92bd02654610019300d"></a><!-- doxytag: member="Inotify::PeekEvent" ref="19cde43d082ff92bd02654610019300d" args="(InotifyEvent *pEvt)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool Inotify::PeekEvent </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyEvent.html">InotifyEvent</a> * </td> + <td class="paramname"> <em>pEvt</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Extracts a queued inotify event (without removing). +<p> +The extracted event stays in the queue. If the pointer is NULL it does nothing.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>pEvt</em> </td><td>event object</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the provided pointer is NULL </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="287dc0d238fa6edc3269441cb284f979"></a><!-- doxytag: member="Inotify::PeekEvent" ref="287dc0d238fa6edc3269441cb284f979" args="(InotifyEvent &rEvt)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool Inotify::PeekEvent </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classInotifyEvent.html">InotifyEvent</a> & </td> + <td class="paramname"> <em>rEvt</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Extracts a queued inotify event (without removing). +<p> +The extracted event stays in the queue.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>rEvt</em> </td><td>event object</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown only in very anomalous cases </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="182d19b667c9e0899802b70a579eff40"></a><!-- doxytag: member="Inotify::FindWatch" ref="182d19b667c9e0899802b70a579eff40" args="(int iDescriptor)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * Inotify::FindWatch </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>iDescriptor</em> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Searches for a watch by a watch descriptor. +<p> +It tries to find a watch by the given descriptor.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>iDescriptor</em> </td><td>watch descriptor </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to a watch; NULL if no such watch exists </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a4d6b9d1a9a496862febbe5bffd798c2"></a><!-- doxytag: member="Inotify::FindWatch" ref="a4d6b9d1a9a496862febbe5bffd798c2" args="(const std::string &rPath)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * Inotify::FindWatch </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>rPath</em> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Searches for a watch by a filesystem path. +<p> +It tries to find a watch by the given filesystem path.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rPath</em> </td><td>filesystem path </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to a watch; NULL if no such watch exists</dd></dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>The path must be exactly identical to the one used for the searched watch. Be careful about absolute/relative and case-insensitive paths. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="678271faf4799840ad71805163a24b13"></a><!-- doxytag: member="Inotify::GetDescriptor" ref="678271faf4799840ad71805163a24b13" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int Inotify::GetDescriptor </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the file descriptor. +<p> +The descriptor can be used in standard low-level file functions (poll(), select(), fcntl() etc.).<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>valid file descriptor or -1 for inactive object</dd></dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="b2c8ab8ad4322fb6f0dae0eae442402b"></a><!-- doxytag: member="Inotify::SetNonBlock" ref="b2c8ab8ad4322fb6f0dae0eae442402b" args="(bool fNonBlock)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::SetNonBlock </td> + <td>(</td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>fNonBlock</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Enables/disables non-blocking mode. +<p> +Use this mode if you want to monitor the descriptor (acquired thru <a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor()</a>) in functions such as poll(), select() etc.<p> +Non-blocking mode is disabled by default.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fNonBlock</em> </td><td>enable/disable non-blocking mode</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if setting mode failed</td></tr> + </table> +</dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor()</a>, <a class="el" href="classInotify.html#124dd5816205900af61034d47ae65255">SetCloseOnExec()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="124dd5816205900af61034d47ae65255"></a><!-- doxytag: member="Inotify::SetCloseOnExec" ref="124dd5816205900af61034d47ae65255" args="(bool fClOnEx)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::SetCloseOnExec </td> + <td>(</td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>fClOnEx</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Enables/disables closing on exec. +<p> +Enable this if you want to close the descriptor when executing another program. Otherwise, the descriptor will be inherited.<p> +Closing on exec is disabled by default.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fClOnEx</em> </td><td>enable/disable closing on exec</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if setting failed</td></tr> + </table> +</dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor()</a>, <a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="70b3b57e8661fbb4c5bc404b86225c3b"></a><!-- doxytag: member="Inotify::GetCapability" ref="70b3b57e8661fbb4c5bc404b86225c3b" args="(InotifyCapability_t cap)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t Inotify::GetCapability </td> + <td>(</td> + <td class="paramtype"><a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> </td> + <td class="paramname"> <em>cap</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Acquires a particular inotify capability/limit. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>cap</em> </td><td>capability/limit identifier </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>capability/limit value </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be acquired </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="734538233ba2136164f76f4df6c3654e"></a><!-- doxytag: member="Inotify::SetCapability" ref="734538233ba2136164f76f4df6c3654e" args="(InotifyCapability_t cap, uint32_t val)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Inotify::SetCapability </td> + <td>(</td> + <td class="paramtype"><a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> </td> + <td class="paramname"> <em>cap</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>val</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Modifies a particular inotify capability/limit. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>cap</em> </td><td>capability/limit identifier </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>val</em> </td><td>new capability/limit value </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be set </td></tr> + </table> +</dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Using this function requires root privileges. Beware of setting extensive values - it may seriously affect system performance and/or stability. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="d8e4a4a87d005c71c0b5ea9c6dd53c42"></a><!-- doxytag: member="Inotify::GetMaxEvents" ref="d8e4a4a87d005c71c0b5ea9c6dd53c42" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static uint32_t Inotify::GetMaxEvents </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the maximum number of events in the kernel queue. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>maximum number of events in the kernel queue </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be acquired </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="66d90ebfa516d4bd1463749def2b58f9"></a><!-- doxytag: member="Inotify::SetMaxEvents" ref="66d90ebfa516d4bd1463749def2b58f9" args="(uint32_t val)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static void Inotify::SetMaxEvents </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>val</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets the maximum number of events in the kernel queue. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>val</em> </td><td>new value </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be set </td></tr> + </table> +</dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="c18b7732f67832260fbbd47aebb8af51"></a><!-- doxytag: member="Inotify::GetMaxInstances" ref="c18b7732f67832260fbbd47aebb8af51" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static uint32_t Inotify::GetMaxInstances </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the maximum number of inotify instances per process. +<p> +It means the maximum number of open inotify file descriptors per running process.<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>maximum number of inotify instances </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be acquired </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="620c891962fe5acd26485c64e9b28d19"></a><!-- doxytag: member="Inotify::SetMaxInstances" ref="620c891962fe5acd26485c64e9b28d19" args="(uint32_t val)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static void Inotify::SetMaxInstances </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>val</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets the maximum number of inotify instances per process. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>val</em> </td><td>new value </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be set </td></tr> + </table> +</dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="86dae1b7a72c0d8fc2a632444a0f2f1f"></a><!-- doxytag: member="Inotify::GetMaxWatches" ref="86dae1b7a72c0d8fc2a632444a0f2f1f" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static uint32_t Inotify::GetMaxWatches </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the maximum number of inotify watches per instance. +<p> +It means the maximum number of inotify watches per inotify file descriptor.<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>maximum number of inotify watches </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be acquired </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="5064380cdb4a726ab33f3fa18d15c77a"></a><!-- doxytag: member="Inotify::SetMaxWatches" ref="5064380cdb4a726ab33f3fa18d15c77a" args="(uint32_t val)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static void Inotify::SetMaxWatches </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>val</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)<code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets the maximum number of inotify watches per instance. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>val</em> </td><td>new value </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if the given value cannot be set </td></tr> + </table> +</dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. </dd></dl> + +</div> +</div><p> +<hr><h2>Friends And Related Function Documentation</h2> +<a class="anchor" name="10880f490c33acd8bd24664fc7bce4ae"></a><!-- doxytag: member="Inotify::InotifyWatch" ref="10880f490c33acd8bd24664fc7bce4ae" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">friend class <a class="el" href="classInotifyWatch.html">InotifyWatch</a><code> [friend]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a><li><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyEvent-members.html b/shared/inotify/doc/html/classInotifyEvent-members.html new file mode 100644 index 00000000..47f8fdc1 --- /dev/null +++ b/shared/inotify/doc/html/classInotifyEvent-members.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyEvent Member List</h1>This is the complete list of members for <a class="el" href="classInotifyEvent.html">InotifyEvent</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">DumpTypes</a>(uint32_t uValue, std::string &rStr)</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#517abc6bd54c57cb767107187ea6a8fd">DumpTypes</a>(std::string &rStr) const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">GetCookie</a>() const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#83958af6b634d47173bde81b3bd5bbe6">GetDescriptor</a>() const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">GetLength</a>() const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">GetMask</a>() const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#eced3a88a6dea190c5df19c2a6599010">GetMaskByName</a>(const std::string &rName)</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">GetName</a>() const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#e053c52feebf6dae5a762e6baeba93db">GetName</a>(std::string &rName) const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">GetWatch</a>()</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent</a>()</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#6d7f3fc0f51580da4a3ec2348609df64">InotifyEvent</a>(const struct inotify_event *pEvt, InotifyWatch *pWatch)</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">IsType</a>(uint32_t uValue, uint32_t uType)</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#7fdee6664ec63ccc87ff1221abba9abc">IsType</a>(uint32_t uType) const</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">~InotifyEvent</a>()</td><td><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyEvent.html b/shared/inotify/doc/html/classInotifyEvent.html new file mode 100644 index 00000000..7b864a5c --- /dev/null +++ b/shared/inotify/doc/html/classInotifyEvent.html @@ -0,0 +1,487 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: InotifyEvent Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyEvent Class Reference</h1><!-- doxytag: class="InotifyEvent" -->inotify event class +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>></code> +<p> +<a href="classInotifyEvent-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#f416dbbd4e6ddd3c0eea6cb540f0b046"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#6d7f3fc0f51580da4a3ec2348609df64">InotifyEvent</a> (const struct inotify_event *pEvt, <a class="el" href="classInotifyWatch.html">InotifyWatch</a> *pWatch)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#6d7f3fc0f51580da4a3ec2348609df64"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">~InotifyEvent</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a48030da1d3a1b1741ca791c9e129888"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#83958af6b634d47173bde81b3bd5bbe6">GetDescriptor</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the event watch descriptor. <a href="#83958af6b634d47173bde81b3bd5bbe6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">GetMask</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the event mask. <a href="#2aadeb49530a62b06d98e22c335b1ec8"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#7fdee6664ec63ccc87ff1221abba9abc">IsType</a> (uint32_t uType) const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks for the event type. <a href="#7fdee6664ec63ccc87ff1221abba9abc"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">GetCookie</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the event cookie. <a href="#441dfd50abda0e81eb7e4f6d33c68e96"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">GetLength</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the event name length. <a href="#111954d74f0320745a68ef030064e987"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">GetName</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the event name. <a href="#a0524029d360591567c88595cb31df66"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#e053c52feebf6dae5a762e6baeba93db">GetName</a> (std::string &rName) const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Extracts the event name. <a href="#e053c52feebf6dae5a762e6baeba93db"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">GetWatch</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the source watch. <a href="#979cd46f53ed674331a5a6d47d1cde92"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#517abc6bd54c57cb767107187ea6a8fd">DumpTypes</a> (std::string &rStr) const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fills the string with all types contained in the event mask. <a href="#517abc6bd54c57cb767107187ea6a8fd"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">IsType</a> (uint32_t uValue, uint32_t uType)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks a value for the event type. <a href="#309ebf3c5b131522295185a926d551bb"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#eced3a88a6dea190c5df19c2a6599010">GetMaskByName</a> (const std::string &rName)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Finds the appropriate mask for a name. <a href="#eced3a88a6dea190c5df19c2a6599010"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">DumpTypes</a> (uint32_t uValue, std::string &rStr)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Fills the string with all types contained in an event mask value. <a href="#c08a0a26ea33dbe94aaf1ac830c103a5"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +inotify event class +<p> +It holds all information about inotify event and provides access to its particular values.<p> +This class is not (and is not intended to be) thread-safe and therefore it must not be used concurrently in multiple threads. +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="f416dbbd4e6ddd3c0eea6cb540f0b046"></a><!-- doxytag: member="InotifyEvent::InotifyEvent" ref="f416dbbd4e6ddd3c0eea6cb540f0b046" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyEvent::InotifyEvent </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor. +<p> +Creates a plain event. +</div> +</div><p> +<a class="anchor" name="6d7f3fc0f51580da4a3ec2348609df64"></a><!-- doxytag: member="InotifyEvent::InotifyEvent" ref="6d7f3fc0f51580da4a3ec2348609df64" args="(const struct inotify_event *pEvt, InotifyWatch *pWatch)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyEvent::InotifyEvent </td> + <td>(</td> + <td class="paramtype">const struct inotify_event * </td> + <td class="paramname"> <em>pEvt</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="classInotifyWatch.html">InotifyWatch</a> * </td> + <td class="paramname"> <em>pWatch</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor. +<p> +Creates an event based on inotify event data. For NULL pointers it works the same way as <a class="el" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent()</a>.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pEvt</em> </td><td>event data </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pWatch</em> </td><td>inotify watch </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="a48030da1d3a1b1741ca791c9e129888"></a><!-- doxytag: member="InotifyEvent::~InotifyEvent" ref="a48030da1d3a1b1741ca791c9e129888" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyEvent::~InotifyEvent </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Destructor. +<p> + +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="83958af6b634d47173bde81b3bd5bbe6"></a><!-- doxytag: member="InotifyEvent::GetDescriptor" ref="83958af6b634d47173bde81b3bd5bbe6" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int32_t InotifyEvent::GetDescriptor </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the event watch descriptor. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>watch descriptor</dd></dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">InotifyWatch::GetDescriptor()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="2aadeb49530a62b06d98e22c335b1ec8"></a><!-- doxytag: member="InotifyEvent::GetMask" ref="2aadeb49530a62b06d98e22c335b1ec8" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t InotifyEvent::GetMask </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the event mask. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>event mask</dd></dl> +<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">InotifyWatch::GetMask()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="309ebf3c5b131522295185a926d551bb"></a><!-- doxytag: member="InotifyEvent::IsType" ref="309ebf3c5b131522295185a926d551bb" args="(uint32_t uValue, uint32_t uType)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static bool InotifyEvent::IsType </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>uValue</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>uType</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Checks a value for the event type. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uValue</em> </td><td>checked value </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uType</em> </td><td>type which is checked for </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = the value contains the given type, false = otherwise </dd></dl> + +</div> +</div><p> +<a class="anchor" name="7fdee6664ec63ccc87ff1221abba9abc"></a><!-- doxytag: member="InotifyEvent::IsType" ref="7fdee6664ec63ccc87ff1221abba9abc" args="(uint32_t uType) const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool InotifyEvent::IsType </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>uType</em> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Checks for the event type. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uType</em> </td><td>type which is checked for </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = event mask contains the given type, false = otherwise </dd></dl> + +</div> +</div><p> +<a class="anchor" name="441dfd50abda0e81eb7e4f6d33c68e96"></a><!-- doxytag: member="InotifyEvent::GetCookie" ref="441dfd50abda0e81eb7e4f6d33c68e96" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t InotifyEvent::GetCookie </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the event cookie. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>event cookie </dd></dl> + +</div> +</div><p> +<a class="anchor" name="111954d74f0320745a68ef030064e987"></a><!-- doxytag: member="InotifyEvent::GetLength" ref="111954d74f0320745a68ef030064e987" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t InotifyEvent::GetLength </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the event name length. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>event name length </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a0524029d360591567c88595cb31df66"></a><!-- doxytag: member="InotifyEvent::GetName" ref="a0524029d360591567c88595cb31df66" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const std::string& InotifyEvent::GetName </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the event name. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>event name </dd></dl> + +</div> +</div><p> +<a class="anchor" name="e053c52feebf6dae5a762e6baeba93db"></a><!-- doxytag: member="InotifyEvent::GetName" ref="e053c52feebf6dae5a762e6baeba93db" args="(std::string &rName) const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void InotifyEvent::GetName </td> + <td>(</td> + <td class="paramtype">std::string & </td> + <td class="paramname"> <em>rName</em> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Extracts the event name. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>rName</em> </td><td>event name </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="979cd46f53ed674331a5a6d47d1cde92"></a><!-- doxytag: member="InotifyEvent::GetWatch" ref="979cd46f53ed674331a5a6d47d1cde92" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classInotifyWatch.html">InotifyWatch</a>* InotifyEvent::GetWatch </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the source watch. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>source watch </dd></dl> + +</div> +</div><p> +<a class="anchor" name="eced3a88a6dea190c5df19c2a6599010"></a><!-- doxytag: member="InotifyEvent::GetMaskByName" ref="eced3a88a6dea190c5df19c2a6599010" args="(const std::string &rName)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t InotifyEvent::GetMaskByName </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>rName</em> </td> + <td> ) </td> + <td width="100%"><code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Finds the appropriate mask for a name. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rName</em> </td><td>mask name </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>mask for name; 0 on failure </dd></dl> + +</div> +</div><p> +<a class="anchor" name="c08a0a26ea33dbe94aaf1ac830c103a5"></a><!-- doxytag: member="InotifyEvent::DumpTypes" ref="c08a0a26ea33dbe94aaf1ac830c103a5" args="(uint32_t uValue, std::string &rStr)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void InotifyEvent::DumpTypes </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>uValue</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">std::string & </td> + <td class="paramname"> <em>rStr</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Fills the string with all types contained in an event mask value. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uValue</em> </td><td>event mask value </td></tr> + <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>rStr</em> </td><td>dumped event types </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="517abc6bd54c57cb767107187ea6a8fd"></a><!-- doxytag: member="InotifyEvent::DumpTypes" ref="517abc6bd54c57cb767107187ea6a8fd" args="(std::string &rStr) const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void InotifyEvent::DumpTypes </td> + <td>(</td> + <td class="paramtype">std::string & </td> + <td class="paramname"> <em>rStr</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Fills the string with all types contained in the event mask. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[out]</tt> </td><td valign="top"><em>rStr</em> </td><td>dumped event types </td></tr> + </table> +</dl> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a><li><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyException-members.html b/shared/inotify/doc/html/classInotifyException-members.html new file mode 100644 index 00000000..edd5ac6b --- /dev/null +++ b/shared/inotify/doc/html/classInotifyException-members.html @@ -0,0 +1,31 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyException Member List</h1>This is the complete list of members for <a class="el" href="classInotifyException.html">InotifyException</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">GetErrorNumber</a>() const</td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">GetMessage</a>() const</td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">GetSource</a>() const</td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">InotifyException</a>(const std::string &rMsg="", int iErr=0, void *pSrc=NULL)</td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">m_err</a></td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">m_msg</a></td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">m_pSrc</a></td><td><a class="el" href="classInotifyException.html">InotifyException</a></td><td><code> [mutable, protected]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyException.html b/shared/inotify/doc/html/classInotifyException.html new file mode 100644 index 00000000..6e5f01e5 --- /dev/null +++ b/shared/inotify/doc/html/classInotifyException.html @@ -0,0 +1,227 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: InotifyException Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyException Class Reference</h1><!-- doxytag: class="InotifyException" -->Class for inotify exceptions. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>></code> +<p> +<a href="classInotifyException-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">InotifyException</a> (const std::string &rMsg="", int iErr=0, void *pSrc=NULL)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#900dc29e5cfb3ece6c1651d04773b2bb"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">GetMessage</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the exception message. <a href="#1c19a6c919c76332c95970ce7983d016"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">GetErrorNumber</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the exception error number. <a href="#3fda7827f1561f610e40bcd217bdc6fe"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">GetSource</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the exception source. <a href="#568200b75da77cc24927922760b3a5d3"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">m_msg</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">message <a href="#c113719bd6f4352e12876b2322f1c92c"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">m_err</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">error number <a href="#aa8a163c661ce70e34b3e3e7ad700854"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">m_pSrc</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">source <a href="#dd106c2255890025561245cf91fe1427"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Class for inotify exceptions. +<p> +This class allows to acquire information about exceptional events. It makes easier to log or display error messages and to identify problematic code locations.<p> +Although this class is basically thread-safe it is not intended to be shared between threads. +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="900dc29e5cfb3ece6c1651d04773b2bb"></a><!-- doxytag: member="InotifyException::InotifyException" ref="900dc29e5cfb3ece6c1651d04773b2bb" args="(const std::string &rMsg="", int iErr=0, void *pSrc=NULL)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyException::InotifyException </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>rMsg</em> = <code>""</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>iErr</em> = <code>0</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">void * </td> + <td class="paramname"> <em>pSrc</em> = <code>NULL</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor. +<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rMsg</em> </td><td>message </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>iErr</em> </td><td>error number (see errno.h) </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>pSrc</em> </td><td>source </td></tr> + </table> +</dl> + +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="1c19a6c919c76332c95970ce7983d016"></a><!-- doxytag: member="InotifyException::GetMessage" ref="1c19a6c919c76332c95970ce7983d016" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const std::string& InotifyException::GetMessage </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the exception message. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>message </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3fda7827f1561f610e40bcd217bdc6fe"></a><!-- doxytag: member="InotifyException::GetErrorNumber" ref="3fda7827f1561f610e40bcd217bdc6fe" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int InotifyException::GetErrorNumber </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the exception error number. +<p> +If not applicable this value is 0 (zero).<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>error number (standardized; see errno.h) </dd></dl> + +</div> +</div><p> +<a class="anchor" name="568200b75da77cc24927922760b3a5d3"></a><!-- doxytag: member="InotifyException::GetSource" ref="568200b75da77cc24927922760b3a5d3" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void* InotifyException::GetSource </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the exception source. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>source </dd></dl> + +</div> +</div><p> +<hr><h2>Member Data Documentation</h2> +<a class="anchor" name="c113719bd6f4352e12876b2322f1c92c"></a><!-- doxytag: member="InotifyException::m_msg" ref="c113719bd6f4352e12876b2322f1c92c" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">std::string <a class="el" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">InotifyException::m_msg</a><code> [protected]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +message +<p> + +</div> +</div><p> +<a class="anchor" name="aa8a163c661ce70e34b3e3e7ad700854"></a><!-- doxytag: member="InotifyException::m_err" ref="aa8a163c661ce70e34b3e3e7ad700854" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int <a class="el" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">InotifyException::m_err</a><code> [protected]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +error number +<p> + +</div> +</div><p> +<a class="anchor" name="dd106c2255890025561245cf91fe1427"></a><!-- doxytag: member="InotifyException::m_pSrc" ref="dd106c2255890025561245cf91fe1427" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void* <a class="el" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">InotifyException::m_pSrc</a><code> [mutable, protected]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +source +<p> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyWatch-members.html b/shared/inotify/doc/html/classInotifyWatch-members.html new file mode 100644 index 00000000..1809af8b --- /dev/null +++ b/shared/inotify/doc/html/classInotifyWatch-members.html @@ -0,0 +1,35 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyWatch Member List</h1>This is the complete list of members for <a class="el" href="classInotifyWatch.html">InotifyWatch</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">GetDescriptor</a>() const</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">GetInotify</a>()</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">GetMask</a>() const</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">GetPath</a>() const</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">Inotify</a> class</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a>(const std::string &rPath, int32_t uMask, bool fEnabled=true)</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">IsEnabled</a>() const</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">IsRecursive</a>() const</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">SetEnabled</a>(bool fEnabled)</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">SetMask</a>(uint32_t uMask)</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">~InotifyWatch</a>()</td><td><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/classInotifyWatch.html b/shared/inotify/doc/html/classInotifyWatch.html new file mode 100644 index 00000000..119c7873 --- /dev/null +++ b/shared/inotify/doc/html/classInotifyWatch.html @@ -0,0 +1,358 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: InotifyWatch Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>InotifyWatch Class Reference</h1><!-- doxytag: class="InotifyWatch" -->inotify watch class +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>></code> +<p> +<a href="classInotifyWatch-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a> (const std::string &rPath, int32_t uMask, bool fEnabled=true)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#c9c02f1dbd143eebd711eba03ac366e9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">~InotifyWatch</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#871c16b01aa8841b36246e5b629ecaef"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">GetDescriptor</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watch descriptor. <a href="#df771e1f81e2a6cc2780c9d2470e34c6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">GetPath</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watched file path. <a href="#89f897a4d98fa54de27730dd8be67966"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">GetMask</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watch event mask. <a href="#bab761a989c9fdf73aaad2a58e1ba7a0"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">SetMask</a> (uint32_t uMask) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the watch event mask. <a href="#3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classInotify.html">Inotify</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">GetInotify</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the appropriate inotify class instance. <a href="#cbf0042d06841f9503405b104e4c35d0"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">SetEnabled</a> (bool fEnabled) throw (InotifyException)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Enables/disables the watch. <a href="#a71aff8650fadff32a3c655ca50945f1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">IsEnabled</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the watch is enabled. <a href="#3d2a5c58a07449bc6ff192f6c14c4de0"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">IsRecursive</a> () const</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the watch is recursive. <a href="#1c8ab316b54cb7d1d0b17cbbe6b7d2f8"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">Inotify</a></td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +inotify watch class +<p> +It holds information about the inotify watch on a particular inode.<p> +If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="c9c02f1dbd143eebd711eba03ac366e9"></a><!-- doxytag: member="InotifyWatch::InotifyWatch" ref="c9c02f1dbd143eebd711eba03ac366e9" args="(const std::string &rPath, int32_t uMask, bool fEnabled=true)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyWatch::InotifyWatch </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>rPath</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int32_t </td> + <td class="paramname"> <em>uMask</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>fEnabled</em> = <code>true</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor. +<p> +Creates an inotify watch. Because this watch is inactive it has an invalid descriptor (-1).<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>rPath</em> </td><td>watched file path </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uMask</em> </td><td>mask for events </td></tr> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fEnabled</em> </td><td>events enabled yes/no </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="871c16b01aa8841b36246e5b629ecaef"></a><!-- doxytag: member="InotifyWatch::~InotifyWatch" ref="871c16b01aa8841b36246e5b629ecaef" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">InotifyWatch::~InotifyWatch </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Destructor. +<p> + +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="df771e1f81e2a6cc2780c9d2470e34c6"></a><!-- doxytag: member="InotifyWatch::GetDescriptor" ref="df771e1f81e2a6cc2780c9d2470e34c6" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int32_t InotifyWatch::GetDescriptor </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the watch descriptor. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>watch descriptor; -1 for inactive watch </dd></dl> + +</div> +</div><p> +<a class="anchor" name="89f897a4d98fa54de27730dd8be67966"></a><!-- doxytag: member="InotifyWatch::GetPath" ref="89f897a4d98fa54de27730dd8be67966" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const std::string& InotifyWatch::GetPath </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the watched file path. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>file path </dd></dl> + +</div> +</div><p> +<a class="anchor" name="bab761a989c9fdf73aaad2a58e1ba7a0"></a><!-- doxytag: member="InotifyWatch::GetMask" ref="bab761a989c9fdf73aaad2a58e1ba7a0" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">uint32_t InotifyWatch::GetMask </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the watch event mask. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>event mask </dd></dl> + +</div> +</div><p> +<a class="anchor" name="3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><!-- doxytag: member="InotifyWatch::SetMask" ref="3ad7fbc55c21b3fcd08c2d1d388e14b6" args="(uint32_t uMask)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void InotifyWatch::SetMask </td> + <td>(</td> + <td class="paramtype">uint32_t </td> + <td class="paramname"> <em>uMask</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets the watch event mask. +<p> +If the watch is active (added to an instance of <a class="el" href="classInotify.html">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>uMask</em> </td><td>event mask</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if changing fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="cbf0042d06841f9503405b104e4c35d0"></a><!-- doxytag: member="InotifyWatch::GetInotify" ref="cbf0042d06841f9503405b104e4c35d0" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classInotify.html">Inotify</a>* InotifyWatch::GetInotify </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the appropriate inotify class instance. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>inotify instance </dd></dl> + +</div> +</div><p> +<a class="anchor" name="a71aff8650fadff32a3c655ca50945f1"></a><!-- doxytag: member="InotifyWatch::SetEnabled" ref="a71aff8650fadff32a3c655ca50945f1" args="(bool fEnabled)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void InotifyWatch::SetEnabled </td> + <td>(</td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>fEnabled</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Enables/disables the watch. +<p> +If the watch is active (added to an instance of <a class="el" href="classInotify.html">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.<p> +Re-setting the current state has no effect.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>fEnabled</em> </td><td>set enabled yes/no</td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em> </td><td>thrown if enabling/disabling fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="3d2a5c58a07449bc6ff192f6c14c4de0"></a><!-- doxytag: member="InotifyWatch::IsEnabled" ref="3d2a5c58a07449bc6ff192f6c14c4de0" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool InotifyWatch::IsEnabled </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Checks whether the watch is enabled. +<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = enables, false = disabled </dd></dl> + +</div> +</div><p> +<a class="anchor" name="1c8ab316b54cb7d1d0b17cbbe6b7d2f8"></a><!-- doxytag: member="InotifyWatch::IsRecursive" ref="1c8ab316b54cb7d1d0b17cbbe6b7d2f8" args="() const" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool InotifyWatch::IsRecursive </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Checks whether the watch is recursive. +<p> +A recursive watch monitors a directory itself and all its subdirectories. This watch is a logical object which may have many underlying kernel watches.<p> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>currently always false (recursive watches not yet supported) </dd></dl> +<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Recursive watches are currently NOT supported. They are planned for future versions. </dd></dl> + +</div> +</div><p> +<hr><h2>Friends And Related Function Documentation</h2> +<a class="anchor" name="94bfb861dc18ca5d16abfcff90db8c86"></a><!-- doxytag: member="InotifyWatch::Inotify" ref="94bfb861dc18ca5d16abfcff90db8c86" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">friend class <a class="el" href="classInotify.html">Inotify</a><code> [friend]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a><li><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/doxygen.css b/shared/inotify/doc/html/doxygen.css new file mode 100644 index 00000000..c7db1a8a --- /dev/null +++ b/shared/inotify/doc/html/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; + white-space: nowrap; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } diff --git a/shared/inotify/doc/html/doxygen.png b/shared/inotify/doc/html/doxygen.png Binary files differnew file mode 100644 index 00000000..f0a274bb --- /dev/null +++ b/shared/inotify/doc/html/doxygen.png diff --git a/shared/inotify/doc/html/files.html b/shared/inotify/doc/html/files.html new file mode 100644 index 00000000..de3d916f --- /dev/null +++ b/shared/inotify/doc/html/files.html @@ -0,0 +1,27 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: File Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<h1>inotify-cxx File List</h1>Here is a list of all files with brief descriptions:<table> + <tr><td class="indexkey"><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></td><td class="indexvalue"><a class="el" href="classInotify.html">Inotify</a> C++ interface implementation </td></tr> + <tr><td class="indexkey"><a class="el" href="inotify-cxx_8h.html">inotify-cxx.h</a> <a href="inotify-cxx_8h-source.html">[code]</a></td><td class="indexvalue"><a class="el" href="classInotify.html">Inotify</a> C++ interface header </td></tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/functions.html b/shared/inotify/doc/html/functions.html new file mode 100644 index 00000000..e6c66f90 --- /dev/null +++ b/shared/inotify/doc/html/functions.html @@ -0,0 +1,178 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> +<div class="tabs"> + <ul> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_m"><span>m</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_w"><span>w</span></a></li> + <li><a href="#index_~"><span>~</span></a></li> + </ul> +</div> + +<p> +Here is a list of all class members with links to the classes they belong to: +<p> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>Add() +: <a class="el" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Inotify</a> +</ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>Close() +: <a class="el" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Inotify</a> +</ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>DumpTypes() +: <a class="el" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">InotifyEvent</a> +</ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FindWatch() +: <a class="el" href="classInotify.html#182d19b667c9e0899802b70a579eff40">Inotify</a> +</ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>GetCapability() +: <a class="el" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">Inotify</a> +<li>GetCookie() +: <a class="el" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">InotifyEvent</a> +<li>GetDescriptor() +: <a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">Inotify</a> +, <a class="el" href="classInotifyEvent.html#83958af6b634d47173bde81b3bd5bbe6">InotifyEvent</a> +, <a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">InotifyWatch</a> +<li>GetEnabledCount() +: <a class="el" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">Inotify</a> +<li>GetErrorNumber() +: <a class="el" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">InotifyException</a> +<li>GetEvent() +: <a class="el" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">Inotify</a> +<li>GetEventCount() +: <a class="el" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">Inotify</a> +<li>GetInotify() +: <a class="el" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">InotifyWatch</a> +<li>GetLength() +: <a class="el" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">InotifyEvent</a> +<li>GetMask() +: <a class="el" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">InotifyEvent</a> +, <a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">InotifyWatch</a> +<li>GetMaskByName() +: <a class="el" href="classInotifyEvent.html#eced3a88a6dea190c5df19c2a6599010">InotifyEvent</a> +<li>GetMaxEvents() +: <a class="el" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">Inotify</a> +<li>GetMaxInstances() +: <a class="el" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">Inotify</a> +<li>GetMaxWatches() +: <a class="el" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">Inotify</a> +<li>GetMessage() +: <a class="el" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">InotifyException</a> +<li>GetName() +: <a class="el" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">InotifyEvent</a> +<li>GetPath() +: <a class="el" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">InotifyWatch</a> +<li>GetSource() +: <a class="el" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">InotifyException</a> +<li>GetWatch() +: <a class="el" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">InotifyEvent</a> +<li>GetWatchCount() +: <a class="el" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">Inotify</a> +</ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>Inotify +: <a class="el" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">InotifyWatch</a> +, <a class="el" href="classInotify.html#a6fe6e9cb3343665eb968fcd5170cfb9">Inotify</a> +<li>InotifyEvent() +: <a class="el" href="classInotifyEvent.html#6d7f3fc0f51580da4a3ec2348609df64">InotifyEvent</a> +<li>InotifyException() +: <a class="el" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">InotifyException</a> +<li>InotifyWatch +: <a class="el" href="classInotify.html#10880f490c33acd8bd24664fc7bce4ae">Inotify</a> +, <a class="el" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a> +<li>IsEnabled() +: <a class="el" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">InotifyWatch</a> +<li>IsRecursive() +: <a class="el" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">InotifyWatch</a> +<li>IsType() +: <a class="el" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">InotifyEvent</a> +</ul> +<h3><a class="anchor" name="index_m">- m -</a></h3><ul> +<li>m_err +: <a class="el" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">InotifyException</a> +<li>m_msg +: <a class="el" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">InotifyException</a> +<li>m_pSrc +: <a class="el" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">InotifyException</a> +</ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>PeekEvent() +: <a class="el" href="classInotify.html#19cde43d082ff92bd02654610019300d">Inotify</a> +</ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>Remove() +: <a class="el" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Inotify</a> +<li>RemoveAll() +: <a class="el" href="classInotify.html#bc1fd5830ca561efb69bcd2283981741">Inotify</a> +</ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>SetCapability() +: <a class="el" href="classInotify.html#734538233ba2136164f76f4df6c3654e">Inotify</a> +<li>SetCloseOnExec() +: <a class="el" href="classInotify.html#124dd5816205900af61034d47ae65255">Inotify</a> +<li>SetEnabled() +: <a class="el" href="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">InotifyWatch</a> +<li>SetMask() +: <a class="el" href="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">InotifyWatch</a> +<li>SetMaxEvents() +: <a class="el" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">Inotify</a> +<li>SetMaxInstances() +: <a class="el" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">Inotify</a> +<li>SetMaxWatches() +: <a class="el" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">Inotify</a> +<li>SetNonBlock() +: <a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">Inotify</a> +</ul> +<h3><a class="anchor" name="index_w">- w -</a></h3><ul> +<li>WaitForEvents() +: <a class="el" href="classInotify.html#139c27c6643bb199619f3eae9b32e53b">Inotify</a> +</ul> +<h3><a class="anchor" name="index_~">- ~ -</a></h3><ul> +<li>~Inotify() +: <a class="el" href="classInotify.html#f19dd5e491395673e4798eb9dbf5f682">Inotify</a> +<li>~InotifyEvent() +: <a class="el" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">InotifyEvent</a> +<li>~InotifyWatch() +: <a class="el" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">InotifyWatch</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/functions_func.html b/shared/inotify/doc/html/functions_func.html new file mode 100644 index 00000000..eee3f008 --- /dev/null +++ b/shared/inotify/doc/html/functions_func.html @@ -0,0 +1,167 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members - Functions</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li id="current"><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> +<div class="tabs"> + <ul> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_w"><span>w</span></a></li> + <li><a href="#index_~"><span>~</span></a></li> + </ul> +</div> + +<p> + +<p> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>Add() +: <a class="el" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Inotify</a> +</ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>Close() +: <a class="el" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Inotify</a> +</ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>DumpTypes() +: <a class="el" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">InotifyEvent</a> +</ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FindWatch() +: <a class="el" href="classInotify.html#182d19b667c9e0899802b70a579eff40">Inotify</a> +</ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>GetCapability() +: <a class="el" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">Inotify</a> +<li>GetCookie() +: <a class="el" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">InotifyEvent</a> +<li>GetDescriptor() +: <a class="el" href="classInotify.html#678271faf4799840ad71805163a24b13">Inotify</a> +, <a class="el" href="classInotifyEvent.html#83958af6b634d47173bde81b3bd5bbe6">InotifyEvent</a> +, <a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">InotifyWatch</a> +<li>GetEnabledCount() +: <a class="el" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">Inotify</a> +<li>GetErrorNumber() +: <a class="el" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">InotifyException</a> +<li>GetEvent() +: <a class="el" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">Inotify</a> +<li>GetEventCount() +: <a class="el" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">Inotify</a> +<li>GetInotify() +: <a class="el" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">InotifyWatch</a> +<li>GetLength() +: <a class="el" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">InotifyEvent</a> +<li>GetMask() +: <a class="el" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">InotifyEvent</a> +, <a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">InotifyWatch</a> +<li>GetMaskByName() +: <a class="el" href="classInotifyEvent.html#eced3a88a6dea190c5df19c2a6599010">InotifyEvent</a> +<li>GetMaxEvents() +: <a class="el" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">Inotify</a> +<li>GetMaxInstances() +: <a class="el" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">Inotify</a> +<li>GetMaxWatches() +: <a class="el" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">Inotify</a> +<li>GetMessage() +: <a class="el" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">InotifyException</a> +<li>GetName() +: <a class="el" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">InotifyEvent</a> +<li>GetPath() +: <a class="el" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">InotifyWatch</a> +<li>GetSource() +: <a class="el" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">InotifyException</a> +<li>GetWatch() +: <a class="el" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">InotifyEvent</a> +<li>GetWatchCount() +: <a class="el" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">Inotify</a> +</ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>Inotify() +: <a class="el" href="classInotify.html#a6fe6e9cb3343665eb968fcd5170cfb9">Inotify</a> +<li>InotifyEvent() +: <a class="el" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent</a> +<li>InotifyException() +: <a class="el" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">InotifyException</a> +<li>InotifyWatch() +: <a class="el" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a> +<li>IsEnabled() +: <a class="el" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">InotifyWatch</a> +<li>IsRecursive() +: <a class="el" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">InotifyWatch</a> +<li>IsType() +: <a class="el" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">InotifyEvent</a> +</ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>PeekEvent() +: <a class="el" href="classInotify.html#19cde43d082ff92bd02654610019300d">Inotify</a> +</ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>Remove() +: <a class="el" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Inotify</a> +<li>RemoveAll() +: <a class="el" href="classInotify.html#bc1fd5830ca561efb69bcd2283981741">Inotify</a> +</ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>SetCapability() +: <a class="el" href="classInotify.html#734538233ba2136164f76f4df6c3654e">Inotify</a> +<li>SetCloseOnExec() +: <a class="el" href="classInotify.html#124dd5816205900af61034d47ae65255">Inotify</a> +<li>SetEnabled() +: <a class="el" href="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">InotifyWatch</a> +<li>SetMask() +: <a class="el" href="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">InotifyWatch</a> +<li>SetMaxEvents() +: <a class="el" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">Inotify</a> +<li>SetMaxInstances() +: <a class="el" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">Inotify</a> +<li>SetMaxWatches() +: <a class="el" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">Inotify</a> +<li>SetNonBlock() +: <a class="el" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">Inotify</a> +</ul> +<h3><a class="anchor" name="index_w">- w -</a></h3><ul> +<li>WaitForEvents() +: <a class="el" href="classInotify.html#139c27c6643bb199619f3eae9b32e53b">Inotify</a> +</ul> +<h3><a class="anchor" name="index_~">- ~ -</a></h3><ul> +<li>~Inotify() +: <a class="el" href="classInotify.html#f19dd5e491395673e4798eb9dbf5f682">Inotify</a> +<li>~InotifyEvent() +: <a class="el" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">InotifyEvent</a> +<li>~InotifyWatch() +: <a class="el" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">InotifyWatch</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/functions_rela.html b/shared/inotify/doc/html/functions_rela.html new file mode 100644 index 00000000..c7108d04 --- /dev/null +++ b/shared/inotify/doc/html/functions_rela.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members - Related Functions</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li id="current"><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>Inotify +: <a class="el" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">InotifyWatch</a> +<li>InotifyWatch +: <a class="el" href="classInotify.html#10880f490c33acd8bd24664fc7bce4ae">Inotify</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/functions_vars.html b/shared/inotify/doc/html/functions_vars.html new file mode 100644 index 00000000..56dfc9b5 --- /dev/null +++ b/shared/inotify/doc/html/functions_vars.html @@ -0,0 +1,41 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members - Variables</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li id="current"><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>m_err +: <a class="el" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">InotifyException</a> +<li>m_msg +: <a class="el" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">InotifyException</a> +<li>m_pSrc +: <a class="el" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">InotifyException</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/globals.html b/shared/inotify/doc/html/globals.html new file mode 100644 index 00000000..c7601336 --- /dev/null +++ b/shared/inotify/doc/html/globals.html @@ -0,0 +1,76 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li id="current"><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_type.html"><span>Typedefs</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + <li><a href="globals_eval.html"><span>Enumerator</span></a></li> + <li><a href="globals_defs.html"><span>Defines</span></a></li> + </ul> +</div> +Here is a list of all file members with links to the files they belong to: +<p> +<ul> +<li>DUMP_SEP +: <a class="el" href="inotify-cxx_8cpp.html#6e5d8f74743466e712bbaf3b1de1e93d">inotify-cxx.cpp</a> +<li>IN_EXC_MSG +: <a class="el" href="inotify-cxx_8h.html#fe6b93f7e09db7022f1f9dd102932e12">inotify-cxx.h</a> +<li>IN_LOCK_DECL +: <a class="el" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">inotify-cxx.h</a> +<li>IN_LOCK_DONE +: <a class="el" href="inotify-cxx_8h.html#08422ec66fb587c1684afbaa575a53dd">inotify-cxx.h</a> +<li>IN_LOCK_INIT +: <a class="el" href="inotify-cxx_8h.html#981aa546075fba39715fd2f63a41f575">inotify-cxx.h</a> +<li>IN_MAX_EVENTS +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">inotify-cxx.h</a> +<li>IN_MAX_INSTANCES +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">inotify-cxx.h</a> +<li>IN_MAX_WATCHES +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">inotify-cxx.h</a> +<li>IN_READ_BEGIN +: <a class="el" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">inotify-cxx.h</a> +<li>IN_READ_END +: <a class="el" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">inotify-cxx.h</a> +<li>IN_READ_END_NOTHROW +: <a class="el" href="inotify-cxx_8h.html#5c6a5be1898ef17662795cc4b420c851">inotify-cxx.h</a> +<li>IN_WATCH_MAP +: <a class="el" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">inotify-cxx.h</a> +<li>IN_WP_MAP +: <a class="el" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">inotify-cxx.h</a> +<li>IN_WRITE_BEGIN +: <a class="el" href="inotify-cxx_8h.html#c3a6d87ace9403f7ac58f931bbcd9599">inotify-cxx.h</a> +<li>IN_WRITE_END +: <a class="el" href="inotify-cxx_8h.html#f8aeac51b3b4ef56f1791c5c1a2e9cf5">inotify-cxx.h</a> +<li>IN_WRITE_END_NOTHROW +: <a class="el" href="inotify-cxx_8h.html#7e68c4884137939c5e3301f40c198dc7">inotify-cxx.h</a> +<li>INOTIFY_BUFLEN +: <a class="el" href="inotify-cxx_8h.html#a84911f8e42d71161b60d4a28940abb4">inotify-cxx.h</a> +<li>INOTIFY_EVENT_SIZE +: <a class="el" href="inotify-cxx_8h.html#f64b4cc985ba26f31a9cb242153a5014">inotify-cxx.h</a> +<li>InotifyCapability_t +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">inotify-cxx.h</a> +<li>PROCFS_INOTIFY_BASE +: <a class="el" href="inotify-cxx_8cpp.html#481097f28678020b2cbb26dd071a0085">inotify-cxx.cpp</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/globals_defs.html b/shared/inotify/doc/html/globals_defs.html new file mode 100644 index 00000000..33cb5703 --- /dev/null +++ b/shared/inotify/doc/html/globals_defs.html @@ -0,0 +1,64 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li id="current"><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_type.html"><span>Typedefs</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + <li><a href="globals_eval.html"><span>Enumerator</span></a></li> + <li id="current"><a href="globals_defs.html"><span>Defines</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>DUMP_SEP +: <a class="el" href="inotify-cxx_8cpp.html#6e5d8f74743466e712bbaf3b1de1e93d">inotify-cxx.cpp</a> +<li>IN_EXC_MSG +: <a class="el" href="inotify-cxx_8h.html#fe6b93f7e09db7022f1f9dd102932e12">inotify-cxx.h</a> +<li>IN_LOCK_DECL +: <a class="el" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">inotify-cxx.h</a> +<li>IN_LOCK_DONE +: <a class="el" href="inotify-cxx_8h.html#08422ec66fb587c1684afbaa575a53dd">inotify-cxx.h</a> +<li>IN_LOCK_INIT +: <a class="el" href="inotify-cxx_8h.html#981aa546075fba39715fd2f63a41f575">inotify-cxx.h</a> +<li>IN_READ_BEGIN +: <a class="el" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">inotify-cxx.h</a> +<li>IN_READ_END +: <a class="el" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">inotify-cxx.h</a> +<li>IN_READ_END_NOTHROW +: <a class="el" href="inotify-cxx_8h.html#5c6a5be1898ef17662795cc4b420c851">inotify-cxx.h</a> +<li>IN_WRITE_BEGIN +: <a class="el" href="inotify-cxx_8h.html#c3a6d87ace9403f7ac58f931bbcd9599">inotify-cxx.h</a> +<li>IN_WRITE_END +: <a class="el" href="inotify-cxx_8h.html#f8aeac51b3b4ef56f1791c5c1a2e9cf5">inotify-cxx.h</a> +<li>IN_WRITE_END_NOTHROW +: <a class="el" href="inotify-cxx_8h.html#7e68c4884137939c5e3301f40c198dc7">inotify-cxx.h</a> +<li>INOTIFY_BUFLEN +: <a class="el" href="inotify-cxx_8h.html#a84911f8e42d71161b60d4a28940abb4">inotify-cxx.h</a> +<li>INOTIFY_EVENT_SIZE +: <a class="el" href="inotify-cxx_8h.html#f64b4cc985ba26f31a9cb242153a5014">inotify-cxx.h</a> +<li>PROCFS_INOTIFY_BASE +: <a class="el" href="inotify-cxx_8cpp.html#481097f28678020b2cbb26dd071a0085">inotify-cxx.cpp</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/globals_enum.html b/shared/inotify/doc/html/globals_enum.html new file mode 100644 index 00000000..f5505c8a --- /dev/null +++ b/shared/inotify/doc/html/globals_enum.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li id="current"><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_type.html"><span>Typedefs</span></a></li> + <li id="current"><a href="globals_enum.html"><span>Enumerations</span></a></li> + <li><a href="globals_eval.html"><span>Enumerator</span></a></li> + <li><a href="globals_defs.html"><span>Defines</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>InotifyCapability_t +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">inotify-cxx.h</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/globals_eval.html b/shared/inotify/doc/html/globals_eval.html new file mode 100644 index 00000000..3e27eec9 --- /dev/null +++ b/shared/inotify/doc/html/globals_eval.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li id="current"><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li><a href="globals_type.html"><span>Typedefs</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + <li id="current"><a href="globals_eval.html"><span>Enumerator</span></a></li> + <li><a href="globals_defs.html"><span>Defines</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>IN_MAX_EVENTS +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">inotify-cxx.h</a> +<li>IN_MAX_INSTANCES +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">inotify-cxx.h</a> +<li>IN_MAX_WATCHES +: <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">inotify-cxx.h</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/globals_type.html b/shared/inotify/doc/html/globals_type.html new file mode 100644 index 00000000..1e371ed2 --- /dev/null +++ b/shared/inotify/doc/html/globals_type.html @@ -0,0 +1,40 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li id="current"><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="globals.html"><span>All</span></a></li> + <li id="current"><a href="globals_type.html"><span>Typedefs</span></a></li> + <li><a href="globals_enum.html"><span>Enumerations</span></a></li> + <li><a href="globals_eval.html"><span>Enumerator</span></a></li> + <li><a href="globals_defs.html"><span>Defines</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>IN_WATCH_MAP +: <a class="el" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">inotify-cxx.h</a> +<li>IN_WP_MAP +: <a class="el" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">inotify-cxx.h</a> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/index.html b/shared/inotify/doc/html/index.html new file mode 100644 index 00000000..aa2d9b87 --- /dev/null +++ b/shared/inotify/doc/html/index.html @@ -0,0 +1,20 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: Main Page</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li id="current"><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<h1>inotify-cxx Documentation</h1> +<p> +<h3 align="center">0.7.2 </h3><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/inotify-cxx_8cpp.html b/shared/inotify/doc/html/inotify-cxx_8cpp.html new file mode 100644 index 00000000..3fdd5140 --- /dev/null +++ b/shared/inotify/doc/html/inotify-cxx_8cpp.html @@ -0,0 +1,90 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: inotify-cxx.cpp File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<h1>inotify-cxx.cpp File Reference</h1>inotify C++ interface implementation <a href="#_details">More...</a> +<p> +<code>#include <errno.h></code><br> +<code>#include <unistd.h></code><br> +<code>#include <fcntl.h></code><br> +<code>#include "<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>"</code><br> +<table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8cpp.html#481097f28678020b2cbb26dd071a0085">PROCFS_INOTIFY_BASE</a> "/proc/sys/fs/inotify/"</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">procfs inotify base path <a href="#481097f28678020b2cbb26dd071a0085"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8cpp.html#6e5d8f74743466e712bbaf3b1de1e93d">DUMP_SEP</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">dump separator (between particular entries) <a href="#6e5d8f74743466e712bbaf3b1de1e93d"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +inotify C++ interface implementation +<p> +inotify C++ interface<p> +Copyright (C) 2006, 2007 Lukas Jelinek <<a href="mailto:lukas@aiken.cz">lukas@aiken.cz</a>><p> +This program is free software; you can redistribute it and/or modify it under the terms of one of the following licenses:<p> +<ul> +<li>1. X11-style license (see LICENSE-X11) </li> +<li>2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) </li> +<li>3. GNU General Public License, version 2 (see LICENSE-GPL)</li> +</ul> +If you want to help with choosing the best license for you, please visit <a href="http://www.gnu.org/licenses/license-list.html.">http://www.gnu.org/licenses/license-list.html.</a> <hr><h2>Define Documentation</h2> +<a class="anchor" name="6e5d8f74743466e712bbaf3b1de1e93d"></a><!-- doxytag: member="inotify-cxx.cpp::DUMP_SEP" ref="6e5d8f74743466e712bbaf3b1de1e93d" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define DUMP_SEP </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<b>Value:</b><div class="fragment"><pre class="fragment">({ \ + <span class="keywordflow">if</span> (!rStr.empty()) { \ + rStr.append(<span class="stringliteral">","</span>); \ + } \ + }) +</pre></div>dump separator (between particular entries) +<p> + +</div> +</div><p> +<a class="anchor" name="481097f28678020b2cbb26dd071a0085"></a><!-- doxytag: member="inotify-cxx.cpp::PROCFS_INOTIFY_BASE" ref="481097f28678020b2cbb26dd071a0085" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define PROCFS_INOTIFY_BASE "/proc/sys/fs/inotify/" </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +procfs inotify base path +<p> + +</div> +</div><p> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/inotify-cxx_8h-source.html b/shared/inotify/doc/html/inotify-cxx_8h-source.html new file mode 100644 index 00000000..5500b217 --- /dev/null +++ b/shared/inotify/doc/html/inotify-cxx_8h-source.html @@ -0,0 +1,505 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: inotify-cxx.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<h1>inotify-cxx.h</h1><a href="inotify-cxx_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 +<a name="l00003"></a>00003 +<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _INOTIFYCXX_H_</span> +<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _INOTIFYCXX_H_</span> +<a name="l00028"></a>00028 <span class="preprocessor"></span> +<a name="l00029"></a>00029 <span class="preprocessor">#include <stdint.h></span> +<a name="l00030"></a>00030 <span class="preprocessor">#include <string></span> +<a name="l00031"></a>00031 <span class="preprocessor">#include <deque></span> +<a name="l00032"></a>00032 <span class="preprocessor">#include <map></span> +<a name="l00033"></a>00033 +<a name="l00034"></a>00034 <span class="comment">// Please ensure that the following headers take the right place</span> +<a name="l00035"></a>00035 <span class="preprocessor">#include <sys/syscall.h></span> +<a name="l00036"></a>00036 <span class="preprocessor">#include <sys/inotify.h></span> +<a name="l00037"></a>00037 +<a name="l00038"></a>00038 <span class="comment">// Use this if syscalls not defined</span> +<a name="l00039"></a>00039 <span class="preprocessor">#ifndef __NR_inotify_init</span> +<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include <sys/inotify-syscalls.h></span> +<a name="l00041"></a>00041 <span class="preprocessor">#endif // __NR_inotify_init</span> +<a name="l00042"></a>00042 <span class="preprocessor"></span> +<a name="l00044"></a><a class="code" href="inotify-cxx_8h.html#f64b4cc985ba26f31a9cb242153a5014">00044</a> <span class="preprocessor">#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))</span> +<a name="l00045"></a>00045 <span class="preprocessor"></span> +<a name="l00047"></a><a class="code" href="inotify-cxx_8h.html#a84911f8e42d71161b60d4a28940abb4">00047</a> <span class="preprocessor">#define INOTIFY_BUFLEN (1024 * (INOTIFY_EVENT_SIZE + 16))</span> +<a name="l00048"></a>00048 <span class="preprocessor"></span> +<a name="l00050"></a>00050 +<a name="l00053"></a><a class="code" href="inotify-cxx_8h.html#fe6b93f7e09db7022f1f9dd102932e12">00053</a> <span class="preprocessor">#define IN_EXC_MSG(msg) (std::string(__PRETTY_FUNCTION__) + ": " + msg)</span> +<a name="l00054"></a>00054 <span class="preprocessor"></span> +<a name="l00056"></a><a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">00056</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> +<a name="l00057"></a>00057 { +<a name="l00058"></a>00058 <a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">IN_MAX_EVENTS</a> = 0, +<a name="l00059"></a>00059 <a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">IN_MAX_INSTANCES</a> = 1, +<a name="l00060"></a><a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">00060</a> <a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">IN_MAX_WATCHES</a> = 2 +<a name="l00061"></a>00061 } <a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a>; +<a name="l00062"></a>00062 +<a name="l00064"></a>00064 +<a name="l00082"></a>00082 <span class="preprocessor">#ifdef INOTIFY_THREAD_SAFE</span> +<a name="l00083"></a>00083 <span class="preprocessor"></span> +<a name="l00084"></a>00084 <span class="preprocessor">#include <pthread.h></span> +<a name="l00085"></a>00085 +<a name="l00086"></a>00086 <span class="preprocessor">#define IN_LOCK_DECL mutable pthread_rwlock_t __m_lock;</span> +<a name="l00087"></a>00087 <span class="preprocessor"></span> +<a name="l00088"></a>00088 <span class="preprocessor">#define IN_LOCK_INIT \</span> +<a name="l00089"></a>00089 <span class="preprocessor"> { \</span> +<a name="l00090"></a>00090 <span class="preprocessor"> pthread_rwlockattr_t attr; \</span> +<a name="l00091"></a>00091 <span class="preprocessor"> int res = 0; \</span> +<a name="l00092"></a>00092 <span class="preprocessor"> if ((res = pthread_rwlockattr_init(&attr)) != 0) \</span> +<a name="l00093"></a>00093 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("cannot initialize lock attributes"), res, this); \</span> +<a name="l00094"></a>00094 <span class="preprocessor"> if ((res = pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NP)) != 0) \</span> +<a name="l00095"></a>00095 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("cannot set lock kind"), res, this); \</span> +<a name="l00096"></a>00096 <span class="preprocessor"> if ((res = pthread_rwlock_init(&__m_lock, &attr)) != 0) \</span> +<a name="l00097"></a>00097 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("cannot initialize lock"), res, this); \</span> +<a name="l00098"></a>00098 <span class="preprocessor"> pthread_rwlockattr_destroy(&attr); \</span> +<a name="l00099"></a>00099 <span class="preprocessor"> }</span> +<a name="l00100"></a>00100 <span class="preprocessor"></span> +<a name="l00101"></a>00101 <span class="preprocessor">#define IN_LOCK_DONE pthread_rwlock_destroy(&__m_lock);</span> +<a name="l00102"></a>00102 <span class="preprocessor"></span> +<a name="l00103"></a>00103 <span class="preprocessor">#define IN_READ_BEGIN \</span> +<a name="l00104"></a>00104 <span class="preprocessor"> { \</span> +<a name="l00105"></a>00105 <span class="preprocessor"> int res = pthread_rwlock_rdlock(&__m_lock); \</span> +<a name="l00106"></a>00106 <span class="preprocessor"> if (res != 0) \</span> +<a name="l00107"></a>00107 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("locking for reading failed"), res, (void*) this); \</span> +<a name="l00108"></a>00108 <span class="preprocessor"> }</span> +<a name="l00109"></a>00109 <span class="preprocessor"></span> +<a name="l00110"></a>00110 <span class="preprocessor">#define IN_READ_END \</span> +<a name="l00111"></a>00111 <span class="preprocessor"> { \</span> +<a name="l00112"></a>00112 <span class="preprocessor"> int res = pthread_rwlock_unlock(&__m_lock); \</span> +<a name="l00113"></a>00113 <span class="preprocessor"> if (res != 0) \</span> +<a name="l00114"></a>00114 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("unlocking failed"), res, (void*) this); \</span> +<a name="l00115"></a>00115 <span class="preprocessor"> }</span> +<a name="l00116"></a>00116 <span class="preprocessor"></span> +<a name="l00117"></a>00117 <span class="preprocessor">#define IN_READ_END_NOTHROW pthread_rwlock_unlock(&__m_lock);</span> +<a name="l00118"></a>00118 <span class="preprocessor"></span> +<a name="l00119"></a>00119 <span class="preprocessor">#define IN_WRITE_BEGIN \</span> +<a name="l00120"></a>00120 <span class="preprocessor"> { \</span> +<a name="l00121"></a>00121 <span class="preprocessor"> int res = pthread_rwlock_wrlock(&__m_lock); \</span> +<a name="l00122"></a>00122 <span class="preprocessor"> if (res != 0) \</span> +<a name="l00123"></a>00123 <span class="preprocessor"> throw InotifyException(IN_EXC_MSG("locking for writing failed"), res, (void*) this); \</span> +<a name="l00124"></a>00124 <span class="preprocessor"> }</span> +<a name="l00125"></a>00125 <span class="preprocessor"></span> +<a name="l00126"></a>00126 <span class="preprocessor">#define IN_WRITE_END IN_READ_END</span> +<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define IN_WRITE_END_NOTHROW IN_READ_END_NOTHROW</span> +<a name="l00128"></a>00128 <span class="preprocessor"></span> +<a name="l00129"></a>00129 <span class="preprocessor">#else // INOTIFY_THREAD_SAFE</span> +<a name="l00130"></a>00130 <span class="preprocessor"></span> +<a name="l00131"></a><a class="code" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">00131</a> <span class="preprocessor">#define IN_LOCK_DECL</span> +<a name="l00132"></a><a class="code" href="inotify-cxx_8h.html#981aa546075fba39715fd2f63a41f575">00132</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_LOCK_INIT</span> +<a name="l00133"></a><a class="code" href="inotify-cxx_8h.html#08422ec66fb587c1684afbaa575a53dd">00133</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_LOCK_DONE</span> +<a name="l00134"></a><a class="code" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">00134</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_READ_BEGIN</span> +<a name="l00135"></a><a class="code" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">00135</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_READ_END</span> +<a name="l00136"></a><a class="code" href="inotify-cxx_8h.html#5c6a5be1898ef17662795cc4b420c851">00136</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_READ_END_NOTHROW</span> +<a name="l00137"></a><a class="code" href="inotify-cxx_8h.html#c3a6d87ace9403f7ac58f931bbcd9599">00137</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_WRITE_BEGIN</span> +<a name="l00138"></a><a class="code" href="inotify-cxx_8h.html#f8aeac51b3b4ef56f1791c5c1a2e9cf5">00138</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_WRITE_END</span> +<a name="l00139"></a><a class="code" href="inotify-cxx_8h.html#7e68c4884137939c5e3301f40c198dc7">00139</a> <span class="preprocessor"></span><span class="preprocessor">#define IN_WRITE_END_NOTHROW</span> +<a name="l00140"></a>00140 <span class="preprocessor"></span> +<a name="l00141"></a>00141 <span class="preprocessor">#endif // INOTIFY_THREAD_SAFE</span> +<a name="l00142"></a>00142 <span class="preprocessor"></span> +<a name="l00143"></a>00143 +<a name="l00144"></a>00144 +<a name="l00145"></a>00145 +<a name="l00146"></a>00146 <span class="comment">// forward declaration</span> +<a name="l00147"></a>00147 <span class="keyword">class </span><a class="code" href="classInotifyWatch.html">InotifyWatch</a>; +<a name="l00148"></a>00148 <span class="keyword">class </span><a class="code" href="classInotify.html">Inotify</a>; +<a name="l00149"></a>00149 +<a name="l00150"></a>00150 +<a name="l00152"></a>00152 +<a name="l00160"></a><a class="code" href="classInotifyException.html">00160</a> <span class="keyword">class </span><a class="code" href="classInotifyException.html">InotifyException</a> +<a name="l00161"></a>00161 { +<a name="l00162"></a>00162 <span class="keyword">public</span>: +<a name="l00164"></a>00164 +<a name="l00169"></a><a class="code" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">00169</a> <a class="code" href="classInotifyException.html#900dc29e5cfb3ece6c1651d04773b2bb">InotifyException</a>(<span class="keyword">const</span> std::string& rMsg = <span class="stringliteral">""</span>, <span class="keywordtype">int</span> iErr = 0, <span class="keywordtype">void</span>* pSrc = NULL) +<a name="l00170"></a>00170 : <a class="code" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">m_msg</a>(rMsg), +<a name="l00171"></a>00171 <a class="code" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">m_err</a>(iErr) +<a name="l00172"></a>00172 { +<a name="l00173"></a>00173 <a class="code" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">m_pSrc</a> = pSrc; +<a name="l00174"></a>00174 } +<a name="l00175"></a>00175 +<a name="l00177"></a>00177 +<a name="l00180"></a><a class="code" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">00180</a> <span class="keyword">inline</span> <span class="keyword">const</span> std::string& <a class="code" href="classInotifyException.html#1c19a6c919c76332c95970ce7983d016">GetMessage</a>()<span class="keyword"> const</span> +<a name="l00181"></a>00181 <span class="keyword"> </span>{ +<a name="l00182"></a>00182 <span class="keywordflow">return</span> <a class="code" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">m_msg</a>; +<a name="l00183"></a>00183 } +<a name="l00184"></a>00184 +<a name="l00186"></a>00186 +<a name="l00191"></a><a class="code" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">00191</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classInotifyException.html#3fda7827f1561f610e40bcd217bdc6fe">GetErrorNumber</a>()<span class="keyword"> const</span> +<a name="l00192"></a>00192 <span class="keyword"> </span>{ +<a name="l00193"></a>00193 <span class="keywordflow">return</span> <a class="code" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">m_err</a>; +<a name="l00194"></a>00194 } +<a name="l00195"></a>00195 +<a name="l00197"></a>00197 +<a name="l00200"></a><a class="code" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">00200</a> <span class="keyword">inline</span> <span class="keywordtype">void</span>* <a class="code" href="classInotifyException.html#568200b75da77cc24927922760b3a5d3">GetSource</a>()<span class="keyword"> const</span> +<a name="l00201"></a>00201 <span class="keyword"> </span>{ +<a name="l00202"></a>00202 <span class="keywordflow">return</span> <a class="code" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">m_pSrc</a>; +<a name="l00203"></a>00203 } +<a name="l00204"></a>00204 +<a name="l00205"></a>00205 <span class="keyword">protected</span>: +<a name="l00206"></a><a class="code" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">00206</a> std::string <a class="code" href="classInotifyException.html#c113719bd6f4352e12876b2322f1c92c">m_msg</a>; +<a name="l00207"></a><a class="code" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">00207</a> <span class="keywordtype">int</span> <a class="code" href="classInotifyException.html#aa8a163c661ce70e34b3e3e7ad700854">m_err</a>; +<a name="l00208"></a><a class="code" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">00208</a> <span class="keyword">mutable</span> <span class="keywordtype">void</span>* <a class="code" href="classInotifyException.html#dd106c2255890025561245cf91fe1427">m_pSrc</a>; +<a name="l00209"></a>00209 }; +<a name="l00210"></a>00210 +<a name="l00211"></a>00211 +<a name="l00213"></a>00213 +<a name="l00221"></a><a class="code" href="classInotifyEvent.html">00221</a> <span class="keyword">class </span><a class="code" href="classInotifyEvent.html">InotifyEvent</a> +<a name="l00222"></a>00222 { +<a name="l00223"></a>00223 <span class="keyword">public</span>: +<a name="l00225"></a>00225 +<a name="l00228"></a><a class="code" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">00228</a> <a class="code" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent</a>() +<a name="l00229"></a>00229 : m_uMask(0), +<a name="l00230"></a>00230 m_uCookie(0) +<a name="l00231"></a>00231 { +<a name="l00232"></a>00232 m_pWatch = NULL; +<a name="l00233"></a>00233 } +<a name="l00234"></a>00234 +<a name="l00236"></a>00236 +<a name="l00243"></a><a class="code" href="classInotifyEvent.html#6d7f3fc0f51580da4a3ec2348609df64">00243</a> <a class="code" href="classInotifyEvent.html#f416dbbd4e6ddd3c0eea6cb540f0b046">InotifyEvent</a>(<span class="keyword">const</span> <span class="keyword">struct</span> inotify_event* pEvt, <a class="code" href="classInotifyWatch.html">InotifyWatch</a>* pWatch) +<a name="l00244"></a>00244 : m_uMask(0), +<a name="l00245"></a>00245 m_uCookie(0) +<a name="l00246"></a>00246 { +<a name="l00247"></a>00247 <span class="keywordflow">if</span> (pEvt != NULL) { +<a name="l00248"></a>00248 m_uMask = (uint32_t) pEvt->mask; +<a name="l00249"></a>00249 m_uCookie = (uint32_t) pEvt->cookie; +<a name="l00250"></a>00250 <span class="keywordflow">if</span> (pEvt->name != NULL) { +<a name="l00251"></a>00251 m_name = pEvt->len > 0 +<a name="l00252"></a>00252 ? pEvt->name +<a name="l00253"></a>00253 : <span class="stringliteral">""</span>; +<a name="l00254"></a>00254 } +<a name="l00255"></a>00255 m_pWatch = pWatch; +<a name="l00256"></a>00256 } +<a name="l00257"></a>00257 <span class="keywordflow">else</span> { +<a name="l00258"></a>00258 m_pWatch = NULL; +<a name="l00259"></a>00259 } +<a name="l00260"></a>00260 } +<a name="l00261"></a>00261 +<a name="l00263"></a><a class="code" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">00263</a> <a class="code" href="classInotifyEvent.html#a48030da1d3a1b1741ca791c9e129888">~InotifyEvent</a>() {} +<a name="l00264"></a>00264 +<a name="l00266"></a>00266 +<a name="l00271"></a>00271 int32_t <a class="code" href="classInotifyEvent.html#83958af6b634d47173bde81b3bd5bbe6">GetDescriptor</a>() <span class="keyword">const</span>; +<a name="l00272"></a>00272 +<a name="l00274"></a>00274 +<a name="l00279"></a><a class="code" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">00279</a> <span class="keyword">inline</span> uint32_t <a class="code" href="classInotifyEvent.html#2aadeb49530a62b06d98e22c335b1ec8">GetMask</a>()<span class="keyword"> const</span> +<a name="l00280"></a>00280 <span class="keyword"> </span>{ +<a name="l00281"></a>00281 <span class="keywordflow">return</span> m_uMask; +<a name="l00282"></a>00282 } +<a name="l00283"></a>00283 +<a name="l00285"></a>00285 +<a name="l00290"></a><a class="code" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">00290</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">IsType</a>(uint32_t uValue, uint32_t uType) +<a name="l00291"></a>00291 { +<a name="l00292"></a>00292 <span class="keywordflow">return</span> ((uValue & uType) != 0) && ((~uValue & uType) == 0); +<a name="l00293"></a>00293 } +<a name="l00294"></a>00294 +<a name="l00296"></a>00296 +<a name="l00300"></a><a class="code" href="classInotifyEvent.html#7fdee6664ec63ccc87ff1221abba9abc">00300</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">IsType</a>(uint32_t uType)<span class="keyword"> const</span> +<a name="l00301"></a>00301 <span class="keyword"> </span>{ +<a name="l00302"></a>00302 <span class="keywordflow">return</span> <a class="code" href="classInotifyEvent.html#309ebf3c5b131522295185a926d551bb">IsType</a>(m_uMask, uType); +<a name="l00303"></a>00303 } +<a name="l00304"></a>00304 +<a name="l00306"></a>00306 +<a name="l00309"></a><a class="code" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">00309</a> <span class="keyword">inline</span> uint32_t <a class="code" href="classInotifyEvent.html#441dfd50abda0e81eb7e4f6d33c68e96">GetCookie</a>()<span class="keyword"> const</span> +<a name="l00310"></a>00310 <span class="keyword"> </span>{ +<a name="l00311"></a>00311 <span class="keywordflow">return</span> m_uCookie; +<a name="l00312"></a>00312 } +<a name="l00313"></a>00313 +<a name="l00315"></a>00315 +<a name="l00318"></a><a class="code" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">00318</a> <span class="keyword">inline</span> uint32_t <a class="code" href="classInotifyEvent.html#111954d74f0320745a68ef030064e987">GetLength</a>()<span class="keyword"> const</span> +<a name="l00319"></a>00319 <span class="keyword"> </span>{ +<a name="l00320"></a>00320 <span class="keywordflow">return</span> (uint32_t) m_name.length(); +<a name="l00321"></a>00321 } +<a name="l00322"></a>00322 +<a name="l00324"></a>00324 +<a name="l00327"></a><a class="code" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">00327</a> <span class="keyword">inline</span> <span class="keyword">const</span> std::string& <a class="code" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">GetName</a>()<span class="keyword"> const</span> +<a name="l00328"></a>00328 <span class="keyword"> </span>{ +<a name="l00329"></a>00329 <span class="keywordflow">return</span> m_name; +<a name="l00330"></a>00330 } +<a name="l00331"></a>00331 +<a name="l00333"></a>00333 +<a name="l00336"></a><a class="code" href="classInotifyEvent.html#e053c52feebf6dae5a762e6baeba93db">00336</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">GetName</a>(std::string& rName)<span class="keyword"> const</span> +<a name="l00337"></a>00337 <span class="keyword"> </span>{ +<a name="l00338"></a>00338 rName = <a class="code" href="classInotifyEvent.html#a0524029d360591567c88595cb31df66">GetName</a>(); +<a name="l00339"></a>00339 } +<a name="l00340"></a>00340 +<a name="l00342"></a>00342 +<a name="l00345"></a><a class="code" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">00345</a> <span class="keyword">inline</span> <a class="code" href="classInotifyWatch.html">InotifyWatch</a>* <a class="code" href="classInotifyEvent.html#979cd46f53ed674331a5a6d47d1cde92">GetWatch</a>() +<a name="l00346"></a>00346 { +<a name="l00347"></a>00347 <span class="keywordflow">return</span> m_pWatch; +<a name="l00348"></a>00348 } +<a name="l00349"></a>00349 +<a name="l00351"></a>00351 +<a name="l00355"></a>00355 <span class="keyword">static</span> uint32_t <a class="code" href="classInotifyEvent.html#eced3a88a6dea190c5df19c2a6599010">GetMaskByName</a>(<span class="keyword">const</span> std::string& rName); +<a name="l00356"></a>00356 +<a name="l00358"></a>00358 +<a name="l00362"></a>00362 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">DumpTypes</a>(uint32_t uValue, std::string& rStr); +<a name="l00363"></a>00363 +<a name="l00365"></a>00365 +<a name="l00368"></a>00368 <span class="keywordtype">void</span> <a class="code" href="classInotifyEvent.html#c08a0a26ea33dbe94aaf1ac830c103a5">DumpTypes</a>(std::string& rStr) <span class="keyword">const</span>; +<a name="l00369"></a>00369 +<a name="l00370"></a>00370 <span class="keyword">private</span>: +<a name="l00371"></a>00371 uint32_t m_uMask; +<a name="l00372"></a>00372 uint32_t m_uCookie; +<a name="l00373"></a>00373 std::string m_name; +<a name="l00374"></a>00374 <a class="code" href="classInotifyWatch.html">InotifyWatch</a>* m_pWatch; +<a name="l00375"></a>00375 }; +<a name="l00376"></a>00376 +<a name="l00377"></a>00377 +<a name="l00378"></a>00378 +<a name="l00380"></a>00380 +<a name="l00386"></a><a class="code" href="classInotifyWatch.html">00386</a> <span class="keyword">class </span><a class="code" href="classInotifyWatch.html">InotifyWatch</a> +<a name="l00387"></a>00387 { +<a name="l00388"></a>00388 <span class="keyword">public</span>: +<a name="l00390"></a>00390 +<a name="l00398"></a><a class="code" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">00398</a> <a class="code" href="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a>(<span class="keyword">const</span> std::string& rPath, int32_t uMask, <span class="keywordtype">bool</span> fEnabled = <span class="keyword">true</span>) +<a name="l00399"></a>00399 : m_path(rPath), +<a name="l00400"></a>00400 m_uMask(uMask), +<a name="l00401"></a>00401 m_wd((int32_t) -1), +<a name="l00402"></a>00402 m_fEnabled(fEnabled) +<a name="l00403"></a>00403 { +<a name="l00404"></a>00404 <a class="code" href="inotify-cxx_8h.html#981aa546075fba39715fd2f63a41f575">IN_LOCK_INIT</a> +<a name="l00405"></a>00405 } +<a name="l00406"></a>00406 +<a name="l00408"></a><a class="code" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">00408</a> <a class="code" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">~InotifyWatch</a>() +<a name="l00409"></a>00409 { +<a name="l00410"></a>00410 <a class="code" href="inotify-cxx_8h.html#08422ec66fb587c1684afbaa575a53dd">IN_LOCK_DONE</a> +<a name="l00411"></a>00411 } +<a name="l00412"></a>00412 +<a name="l00414"></a>00414 +<a name="l00417"></a><a class="code" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">00417</a> <span class="keyword">inline</span> int32_t <a class="code" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">GetDescriptor</a>()<span class="keyword"> const</span> +<a name="l00418"></a>00418 <span class="keyword"> </span>{ +<a name="l00419"></a>00419 <span class="keywordflow">return</span> m_wd; +<a name="l00420"></a>00420 } +<a name="l00421"></a>00421 +<a name="l00423"></a>00423 +<a name="l00426"></a><a class="code" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">00426</a> <span class="keyword">inline</span> <span class="keyword">const</span> std::string& <a class="code" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">GetPath</a>()<span class="keyword"> const</span> +<a name="l00427"></a>00427 <span class="keyword"> </span>{ +<a name="l00428"></a>00428 <span class="keywordflow">return</span> m_path; +<a name="l00429"></a>00429 } +<a name="l00430"></a>00430 +<a name="l00432"></a>00432 +<a name="l00435"></a><a class="code" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">00435</a> <span class="keyword">inline</span> uint32_t <a class="code" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">GetMask</a>()<span class="keyword"> const</span> +<a name="l00436"></a>00436 <span class="keyword"> </span>{ +<a name="l00437"></a>00437 <span class="keywordflow">return</span> (uint32_t) m_uMask; +<a name="l00438"></a>00438 } +<a name="l00439"></a>00439 +<a name="l00441"></a>00441 +<a name="l00450"></a>00450 <span class="keywordtype">void</span> <a class="code" href="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">SetMask</a>(uint32_t uMask) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00451"></a>00451 +<a name="l00453"></a>00453 +<a name="l00456"></a><a class="code" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">00456</a> <span class="keyword">inline</span> <a class="code" href="classInotify.html">Inotify</a>* <a class="code" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">GetInotify</a>() +<a name="l00457"></a>00457 { +<a name="l00458"></a>00458 <span class="keywordflow">return</span> m_pInotify; +<a name="l00459"></a>00459 } +<a name="l00460"></a>00460 +<a name="l00462"></a>00462 +<a name="l00473"></a>00473 <span class="keywordtype">void</span> <a class="code" href="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">SetEnabled</a>(<span class="keywordtype">bool</span> fEnabled) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00474"></a>00474 +<a name="l00476"></a>00476 +<a name="l00479"></a><a class="code" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">00479</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">IsEnabled</a>()<span class="keyword"> const</span> +<a name="l00480"></a>00480 <span class="keyword"> </span>{ +<a name="l00481"></a>00481 <span class="keywordflow">return</span> m_fEnabled; +<a name="l00482"></a>00482 } +<a name="l00483"></a>00483 +<a name="l00485"></a>00485 +<a name="l00494"></a><a class="code" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">00494</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">IsRecursive</a>()<span class="keyword"> const</span> +<a name="l00495"></a>00495 <span class="keyword"> </span>{ +<a name="l00496"></a>00496 <span class="keywordflow">return</span> <span class="keyword">false</span>; +<a name="l00497"></a>00497 } +<a name="l00498"></a>00498 +<a name="l00499"></a>00499 <span class="keyword">private</span>: +<a name="l00500"></a><a class="code" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">00500</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classInotify.html">Inotify</a>; +<a name="l00501"></a>00501 +<a name="l00502"></a>00502 std::string m_path; +<a name="l00503"></a>00503 uint32_t m_uMask; +<a name="l00504"></a>00504 int32_t m_wd; +<a name="l00505"></a>00505 <a class="code" href="classInotify.html">Inotify</a>* m_pInotify; +<a name="l00506"></a>00506 <span class="keywordtype">bool</span> m_fEnabled; +<a name="l00507"></a>00507 +<a name="l00508"></a>00508 <a class="code" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">IN_LOCK_DECL</a> +<a name="l00509"></a>00509 +<a name="l00511"></a>00511 +<a name="l00516"></a>00516 <span class="keywordtype">void</span> __Disable(); +<a name="l00517"></a>00517 }; +<a name="l00518"></a>00518 +<a name="l00519"></a>00519 +<a name="l00521"></a><a class="code" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">00521</a> <span class="keyword">typedef</span> std::map<int32_t, InotifyWatch*> <a class="code" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">IN_WATCH_MAP</a>; +<a name="l00522"></a>00522 +<a name="l00524"></a><a class="code" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">00524</a> <span class="keyword">typedef</span> std::map<std::string, InotifyWatch*> <a class="code" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">IN_WP_MAP</a>; +<a name="l00525"></a>00525 +<a name="l00526"></a>00526 +<a name="l00528"></a>00528 +<a name="l00534"></a><a class="code" href="classInotify.html">00534</a> <span class="keyword">class </span><a class="code" href="classInotify.html">Inotify</a> +<a name="l00535"></a>00535 { +<a name="l00536"></a>00536 <span class="keyword">public</span>: +<a name="l00538"></a>00538 +<a name="l00544"></a>00544 <a class="code" href="classInotify.html#a6fe6e9cb3343665eb968fcd5170cfb9">Inotify</a>() <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00545"></a>00545 +<a name="l00547"></a>00547 +<a name="l00550"></a>00550 <a class="code" href="classInotify.html#f19dd5e491395673e4798eb9dbf5f682">~Inotify</a>(); +<a name="l00551"></a>00551 +<a name="l00553"></a>00553 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#86ae86c43ea1a72f562ca46393309635">Close</a>(); +<a name="l00554"></a>00554 +<a name="l00556"></a>00556 +<a name="l00561"></a>00561 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Add</a>(<a class="code" href="classInotifyWatch.html">InotifyWatch</a>* pWatch) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00562"></a>00562 +<a name="l00564"></a>00564 +<a name="l00569"></a><a class="code" href="classInotify.html#35dab56d3e10bf28b5e457871adddb58">00569</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Add</a>(<a class="code" href="classInotifyWatch.html">InotifyWatch</a>& rWatch) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00570"></a>00570 { +<a name="l00571"></a>00571 <a class="code" href="classInotify.html#2ef771ebaf982d76ebe19b3f5bc9cd83">Add</a>(&rWatch); +<a name="l00572"></a>00572 } +<a name="l00573"></a>00573 +<a name="l00575"></a>00575 +<a name="l00582"></a>00582 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Remove</a>(<a class="code" href="classInotifyWatch.html">InotifyWatch</a>* pWatch) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00583"></a>00583 +<a name="l00585"></a>00585 +<a name="l00592"></a><a class="code" href="classInotify.html#ac1a52b2ff6bfec07021a44e55d496a6">00592</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Remove</a>(<a class="code" href="classInotifyWatch.html">InotifyWatch</a>& rWatch) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00593"></a>00593 { +<a name="l00594"></a>00594 <a class="code" href="classInotify.html#21c39bb8e5bbc1941b945c18f9005b84">Remove</a>(&rWatch); +<a name="l00595"></a>00595 } +<a name="l00596"></a>00596 +<a name="l00598"></a>00598 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#bc1fd5830ca561efb69bcd2283981741">RemoveAll</a>(); +<a name="l00599"></a>00599 +<a name="l00601"></a>00601 +<a name="l00609"></a><a class="code" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">00609</a> <span class="keyword">inline</span> size_t <a class="code" href="classInotify.html#b53b7935bda7425b002946d78bfe5863">GetWatchCount</a>()<span class="keyword"> const</span> +<a name="l00610"></a>00610 <span class="keyword"> </span>{ +<a name="l00611"></a>00611 <a class="code" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">IN_READ_BEGIN</a> +<a name="l00612"></a>00612 size_t n = (size_t) m_paths.size(); +<a name="l00613"></a>00613 <a class="code" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">IN_READ_END</a> +<a name="l00614"></a>00614 <span class="keywordflow">return</span> n; +<a name="l00615"></a>00615 } +<a name="l00616"></a>00616 +<a name="l00618"></a>00618 +<a name="l00623"></a><a class="code" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">00623</a> <span class="keyword">inline</span> size_t <a class="code" href="classInotify.html#9bf5f7716649d5b5f468c2242fb5e099">GetEnabledCount</a>()<span class="keyword"> const</span> +<a name="l00624"></a>00624 <span class="keyword"> </span>{ +<a name="l00625"></a>00625 <a class="code" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">IN_READ_BEGIN</a> +<a name="l00626"></a>00626 size_t n = (size_t) m_watches.size(); +<a name="l00627"></a>00627 <a class="code" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">IN_READ_END</a> +<a name="l00628"></a>00628 <span class="keywordflow">return</span> n; +<a name="l00629"></a>00629 } +<a name="l00630"></a>00630 +<a name="l00632"></a>00632 +<a name="l00643"></a>00643 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#139c27c6643bb199619f3eae9b32e53b">WaitForEvents</a>(<span class="keywordtype">bool</span> fNoIntr = <span class="keyword">false</span>) throw (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00644"></a>00644 +<a name="l00646"></a>00646 +<a name="l00652"></a><a class="code" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">00652</a> inline size_t <a class="code" href="classInotify.html#a3c533f956871f904949832ac8f5fbde">GetEventCount</a>() +<a name="l00653"></a>00653 { +<a name="l00654"></a>00654 <a class="code" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">IN_READ_BEGIN</a> +<a name="l00655"></a>00655 size_t n = (size_t) m_events.size(); +<a name="l00656"></a>00656 <a class="code" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">IN_READ_END</a> +<a name="l00657"></a>00657 <span class="keywordflow">return</span> n; +<a name="l00658"></a>00658 } +<a name="l00659"></a>00659 +<a name="l00661"></a>00661 +<a name="l00669"></a>00669 <span class="keywordtype">bool</span> <a class="code" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">GetEvent</a>(<a class="code" href="classInotifyEvent.html">InotifyEvent</a>* pEvt) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00670"></a>00670 +<a name="l00672"></a>00672 +<a name="l00679"></a><a class="code" href="classInotify.html#b028c8fa988f6bbb2ef773db3ea3a2d3">00679</a> <span class="keywordtype">bool</span> <a class="code" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">GetEvent</a>(<a class="code" href="classInotifyEvent.html">InotifyEvent</a>& rEvt) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00680"></a>00680 { +<a name="l00681"></a>00681 <span class="keywordflow">return</span> <a class="code" href="classInotify.html#490a3f824c6d041d31ccaabe9bd92008">GetEvent</a>(&rEvt); +<a name="l00682"></a>00682 } +<a name="l00683"></a>00683 +<a name="l00685"></a>00685 +<a name="l00693"></a>00693 <span class="keywordtype">bool</span> <a class="code" href="classInotify.html#19cde43d082ff92bd02654610019300d">PeekEvent</a>(<a class="code" href="classInotifyEvent.html">InotifyEvent</a>* pEvt) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00694"></a>00694 +<a name="l00696"></a>00696 +<a name="l00703"></a><a class="code" href="classInotify.html#287dc0d238fa6edc3269441cb284f979">00703</a> <span class="keywordtype">bool</span> <a class="code" href="classInotify.html#19cde43d082ff92bd02654610019300d">PeekEvent</a>(<a class="code" href="classInotifyEvent.html">InotifyEvent</a>& rEvt) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00704"></a>00704 { +<a name="l00705"></a>00705 <span class="keywordflow">return</span> <a class="code" href="classInotify.html#19cde43d082ff92bd02654610019300d">PeekEvent</a>(&rEvt); +<a name="l00706"></a>00706 } +<a name="l00707"></a>00707 +<a name="l00709"></a>00709 +<a name="l00715"></a>00715 <a class="code" href="classInotifyWatch.html">InotifyWatch</a>* <a class="code" href="classInotify.html#182d19b667c9e0899802b70a579eff40">FindWatch</a>(<span class="keywordtype">int</span> iDescriptor); +<a name="l00716"></a>00716 +<a name="l00718"></a>00718 +<a name="l00728"></a>00728 <a class="code" href="classInotifyWatch.html">InotifyWatch</a>* <a class="code" href="classInotify.html#182d19b667c9e0899802b70a579eff40">FindWatch</a>(<span class="keyword">const</span> std::string& rPath); +<a name="l00729"></a>00729 +<a name="l00731"></a>00731 +<a name="l00739"></a><a class="code" href="classInotify.html#678271faf4799840ad71805163a24b13">00739</a> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="classInotify.html#678271faf4799840ad71805163a24b13">GetDescriptor</a>()<span class="keyword"> const</span> +<a name="l00740"></a>00740 <span class="keyword"> </span>{ +<a name="l00741"></a>00741 <span class="keywordflow">return</span> m_fd; +<a name="l00742"></a>00742 } +<a name="l00743"></a>00743 +<a name="l00745"></a>00745 +<a name="l00758"></a>00758 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#b2c8ab8ad4322fb6f0dae0eae442402b">SetNonBlock</a>(<span class="keywordtype">bool</span> fNonBlock) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00759"></a>00759 +<a name="l00761"></a>00761 +<a name="l00774"></a>00774 <span class="keywordtype">void</span> <a class="code" href="classInotify.html#124dd5816205900af61034d47ae65255">SetCloseOnExec</a>(<span class="keywordtype">bool</span> fClOnEx) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00775"></a>00775 +<a name="l00777"></a>00777 +<a name="l00782"></a>00782 <span class="keyword">static</span> uint32_t <a class="code" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> cap) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00783"></a>00783 +<a name="l00785"></a>00785 +<a name="l00793"></a>00793 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> cap, uint32_t val) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00794"></a>00794 +<a name="l00796"></a>00796 +<a name="l00800"></a><a class="code" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">00800</a> <span class="keyword">inline</span> <span class="keyword">static</span> uint32_t <a class="code" href="classInotify.html#d8e4a4a87d005c71c0b5ea9c6dd53c42">GetMaxEvents</a>() throw (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00801"></a>00801 { +<a name="l00802"></a>00802 <span class="keywordflow">return</span> <a class="code" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">IN_MAX_EVENTS</a>); +<a name="l00803"></a>00803 } +<a name="l00804"></a>00804 +<a name="l00806"></a>00806 +<a name="l00814"></a><a class="code" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">00814</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#66d90ebfa516d4bd1463749def2b58f9">SetMaxEvents</a>(uint32_t val) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00815"></a>00815 { +<a name="l00816"></a>00816 <a class="code" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">IN_MAX_EVENTS</a>, val); +<a name="l00817"></a>00817 } +<a name="l00818"></a>00818 +<a name="l00820"></a>00820 +<a name="l00827"></a><a class="code" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">00827</a> <span class="keyword">inline</span> <span class="keyword">static</span> uint32_t <a class="code" href="classInotify.html#c18b7732f67832260fbbd47aebb8af51">GetMaxInstances</a>() throw (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00828"></a>00828 { +<a name="l00829"></a>00829 <span class="keywordflow">return</span> <a class="code" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">IN_MAX_INSTANCES</a>); +<a name="l00830"></a>00830 } +<a name="l00831"></a>00831 +<a name="l00833"></a>00833 +<a name="l00841"></a><a class="code" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">00841</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#620c891962fe5acd26485c64e9b28d19">SetMaxInstances</a>(uint32_t val) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00842"></a>00842 { +<a name="l00843"></a>00843 <a class="code" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">IN_MAX_INSTANCES</a>, val); +<a name="l00844"></a>00844 } +<a name="l00845"></a>00845 +<a name="l00847"></a>00847 +<a name="l00854"></a><a class="code" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">00854</a> <span class="keyword">inline</span> <span class="keyword">static</span> uint32_t <a class="code" href="classInotify.html#86dae1b7a72c0d8fc2a632444a0f2f1f">GetMaxWatches</a>() throw (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00855"></a>00855 { +<a name="l00856"></a>00856 <span class="keywordflow">return</span> <a class="code" href="classInotify.html#70b3b57e8661fbb4c5bc404b86225c3b">GetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">IN_MAX_WATCHES</a>); +<a name="l00857"></a>00857 } +<a name="l00858"></a>00858 +<a name="l00860"></a>00860 +<a name="l00868"></a><a class="code" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">00868</a> <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classInotify.html#5064380cdb4a726ab33f3fa18d15c77a">SetMaxWatches</a>(uint32_t val) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>) +<a name="l00869"></a>00869 { +<a name="l00870"></a>00870 <a class="code" href="classInotify.html#734538233ba2136164f76f4df6c3654e">SetCapability</a>(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">IN_MAX_WATCHES</a>, val); +<a name="l00871"></a>00871 } +<a name="l00872"></a>00872 +<a name="l00873"></a>00873 <span class="keyword">private</span>: +<a name="l00874"></a>00874 <span class="keywordtype">int</span> m_fd; +<a name="l00875"></a>00875 IN_WATCH_MAP m_watches; +<a name="l00876"></a>00876 IN_WP_MAP m_paths; +<a name="l00877"></a>00877 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> m_buf[<a class="code" href="inotify-cxx_8h.html#a84911f8e42d71161b60d4a28940abb4">INOTIFY_BUFLEN</a>]; +<a name="l00878"></a>00878 std::deque<InotifyEvent> m_events; +<a name="l00879"></a>00879 +<a name="l00880"></a>00880 <a class="code" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">IN_LOCK_DECL</a> +<a name="l00881"></a>00881 +<a name="l00882"></a><a class="code" href="classInotify.html#10880f490c33acd8bd24664fc7bce4ae">00882</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classInotifyWatch.html">InotifyWatch</a>; +<a name="l00883"></a>00883 +<a name="l00884"></a>00884 <span class="keyword">static</span> std::string GetCapabilityPath(<a class="code" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> cap) <span class="keywordflow">throw</span> (<a class="code" href="classInotifyException.html">InotifyException</a>); +<a name="l00885"></a>00885 }; +<a name="l00886"></a>00886 +<a name="l00887"></a>00887 +<a name="l00888"></a>00888 <span class="preprocessor">#endif //_INOTIFYCXX_H_</span> +<a name="l00889"></a>00889 <span class="preprocessor"></span> +</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/inotify-cxx_8h.html b/shared/inotify/doc/html/inotify-cxx_8h.html new file mode 100644 index 00000000..1d6f065e --- /dev/null +++ b/shared/inotify/doc/html/inotify-cxx_8h.html @@ -0,0 +1,366 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>inotify-cxx: inotify-cxx.h File Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + <li><a href="globals.html"><span>File Members</span></a></li> + </ul></div> +<h1>inotify-cxx.h File Reference</h1>inotify C++ interface header <a href="#_details">More...</a> +<p> +<code>#include <stdint.h></code><br> +<code>#include <string></code><br> +<code>#include <deque></code><br> +<code>#include <map></code><br> +<code>#include <sys/syscall.h></code><br> +<code>#include <sys/inotify.h></code><br> +<code>#include <sys/inotify-syscalls.h></code><br> + +<p> +<a href="inotify-cxx_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Classes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyException.html">InotifyException</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Class for inotify exceptions. <a href="classInotifyException.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyEvent.html">InotifyEvent</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">inotify event class <a href="classInotifyEvent.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html">InotifyWatch</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">inotify watch class <a href="classInotifyWatch.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotify.html">Inotify</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">inotify class <a href="classInotify.html#_details">More...</a><br></td></tr> +<tr><td colspan="2"><br><h2>Defines</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#f64b4cc985ba26f31a9cb242153a5014">INOTIFY_EVENT_SIZE</a> (sizeof(struct inotify_event))</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Event struct size. <a href="#f64b4cc985ba26f31a9cb242153a5014"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#a84911f8e42d71161b60d4a28940abb4">INOTIFY_BUFLEN</a> (1024 * (INOTIFY_EVENT_SIZE + 16))</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Event buffer length. <a href="#a84911f8e42d71161b60d4a28940abb4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#fe6b93f7e09db7022f1f9dd102932e12">IN_EXC_MSG</a>(msg) (std::string(__PRETTY_FUNCTION__) + ": " + msg)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Helper macro for creating exception messages. <a href="#fe6b93f7e09db7022f1f9dd102932e12"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#904d25c0fd931e1bad4f9d5cd346a766">IN_LOCK_DECL</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">inotify-cxx thread safety <a href="#904d25c0fd931e1bad4f9d5cd346a766"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#981aa546075fba39715fd2f63a41f575">IN_LOCK_INIT</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#08422ec66fb587c1684afbaa575a53dd">IN_LOCK_DONE</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#963a97dc42487e86715b4e04639b0db8">IN_READ_BEGIN</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#0b82080ab6709175341b97e1f3c3955d">IN_READ_END</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#5c6a5be1898ef17662795cc4b420c851">IN_READ_END_NOTHROW</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#c3a6d87ace9403f7ac58f931bbcd9599">IN_WRITE_BEGIN</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#f8aeac51b3b4ef56f1791c5c1a2e9cf5">IN_WRITE_END</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#7e68c4884137939c5e3301f40c198dc7">IN_WRITE_END_NOTHROW</a></td></tr> + +<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::map< int32_t,<br> + <a class="el" href="classInotifyWatch.html">InotifyWatch</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">IN_WATCH_MAP</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Mapping from watch descriptors to watch objects. <a href="#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef std::map< std::string,<br> + <a class="el" href="classInotifyWatch.html">InotifyWatch</a> * > </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">IN_WP_MAP</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Mapping from paths to watch objects. <a href="#5dd7761ff5a6b7cc7271950aebb7ddf6"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> { <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1">IN_MAX_EVENTS</a> = 0, +<a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9">IN_MAX_INSTANCES</a> = 1, +<a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429">IN_MAX_WATCHES</a> = 2 + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">inotify capability/limit identifiers <a href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">More...</a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +inotify C++ interface header +<p> +inotify C++ interface<p> +Copyright (C) 2006, 2007 Lukas Jelinek, <<a href="mailto:lukas@aiken.cz">lukas@aiken.cz</a>><p> +This program is free software; you can redistribute it and/or modify it under the terms of one of the following licenses:<p> +<ul> +<li>1. X11-style license (see LICENSE-X11) </li> +<li>2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) </li> +<li>3. GNU General Public License, version 2 (see LICENSE-GPL)</li> +</ul> +If you want to help with choosing the best license for you, please visit <a href="http://www.gnu.org/licenses/license-list.html.">http://www.gnu.org/licenses/license-list.html.</a> <hr><h2>Define Documentation</h2> +<a class="anchor" name="fe6b93f7e09db7022f1f9dd102932e12"></a><!-- doxytag: member="inotify-cxx.h::IN_EXC_MSG" ref="fe6b93f7e09db7022f1f9dd102932e12" args="(msg)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_EXC_MSG </td> + <td>(</td> + <td class="paramtype">msg </td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> (std::string(__PRETTY_FUNCTION__) + ": " + msg)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Helper macro for creating exception messages. +<p> +It prepends the message by the function name. +</div> +</div><p> +<a class="anchor" name="904d25c0fd931e1bad4f9d5cd346a766"></a><!-- doxytag: member="inotify-cxx.h::IN_LOCK_DECL" ref="904d25c0fd931e1bad4f9d5cd346a766" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_LOCK_DECL </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +inotify-cxx thread safety +<p> +If this symbol is defined you can use this interface safely threaded applications. Remember that it slightly degrades performance.<p> +Even if INOTIFY_THREAD_SAFE is defined some classes stay unsafe. If you must use them (must you?) in more than one thread concurrently you need to implement explicite locking.<p> +You need not to define INOTIFY_THREAD_SAFE in that cases where the application is multithreaded but all the inotify infrastructure will be managed only in one thread. This is the recommended way.<p> +Locking may fail (it is very rare but not impossible). In this case an exception is thrown. But if unlocking fails in case of an error it does nothing (this failure is ignored). +</div> +</div><p> +<a class="anchor" name="08422ec66fb587c1684afbaa575a53dd"></a><!-- doxytag: member="inotify-cxx.h::IN_LOCK_DONE" ref="08422ec66fb587c1684afbaa575a53dd" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_LOCK_DONE </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="981aa546075fba39715fd2f63a41f575"></a><!-- doxytag: member="inotify-cxx.h::IN_LOCK_INIT" ref="981aa546075fba39715fd2f63a41f575" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_LOCK_INIT </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="963a97dc42487e86715b4e04639b0db8"></a><!-- doxytag: member="inotify-cxx.h::IN_READ_BEGIN" ref="963a97dc42487e86715b4e04639b0db8" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_READ_BEGIN </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="0b82080ab6709175341b97e1f3c3955d"></a><!-- doxytag: member="inotify-cxx.h::IN_READ_END" ref="0b82080ab6709175341b97e1f3c3955d" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_READ_END </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="5c6a5be1898ef17662795cc4b420c851"></a><!-- doxytag: member="inotify-cxx.h::IN_READ_END_NOTHROW" ref="5c6a5be1898ef17662795cc4b420c851" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_READ_END_NOTHROW </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="c3a6d87ace9403f7ac58f931bbcd9599"></a><!-- doxytag: member="inotify-cxx.h::IN_WRITE_BEGIN" ref="c3a6d87ace9403f7ac58f931bbcd9599" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_WRITE_BEGIN </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="f8aeac51b3b4ef56f1791c5c1a2e9cf5"></a><!-- doxytag: member="inotify-cxx.h::IN_WRITE_END" ref="f8aeac51b3b4ef56f1791c5c1a2e9cf5" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_WRITE_END </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="7e68c4884137939c5e3301f40c198dc7"></a><!-- doxytag: member="inotify-cxx.h::IN_WRITE_END_NOTHROW" ref="7e68c4884137939c5e3301f40c198dc7" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define IN_WRITE_END_NOTHROW </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="a84911f8e42d71161b60d4a28940abb4"></a><!-- doxytag: member="inotify-cxx.h::INOTIFY_BUFLEN" ref="a84911f8e42d71161b60d4a28940abb4" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define INOTIFY_BUFLEN (1024 * (INOTIFY_EVENT_SIZE + 16)) </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Event buffer length. +<p> + +</div> +</div><p> +<a class="anchor" name="f64b4cc985ba26f31a9cb242153a5014"></a><!-- doxytag: member="inotify-cxx.h::INOTIFY_EVENT_SIZE" ref="f64b4cc985ba26f31a9cb242153a5014" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event)) </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Event struct size. +<p> + +</div> +</div><p> +<hr><h2>Typedef Documentation</h2> +<a class="anchor" name="e6b5ebcb4e0d6a9f5ca8da26bc00cc2a"></a><!-- doxytag: member="inotify-cxx.h::IN_WATCH_MAP" ref="e6b5ebcb4e0d6a9f5ca8da26bc00cc2a" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">typedef std::map<int32_t, <a class="el" href="classInotifyWatch.html">InotifyWatch</a>*> <a class="el" href="inotify-cxx_8h.html#e6b5ebcb4e0d6a9f5ca8da26bc00cc2a">IN_WATCH_MAP</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Mapping from watch descriptors to watch objects. +<p> + +</div> +</div><p> +<a class="anchor" name="5dd7761ff5a6b7cc7271950aebb7ddf6"></a><!-- doxytag: member="inotify-cxx.h::IN_WP_MAP" ref="5dd7761ff5a6b7cc7271950aebb7ddf6" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">typedef std::map<std::string, <a class="el" href="classInotifyWatch.html">InotifyWatch</a>*> <a class="el" href="inotify-cxx_8h.html#5dd7761ff5a6b7cc7271950aebb7ddf6">IN_WP_MAP</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Mapping from paths to watch objects. +<p> + +</div> +</div><p> +<hr><h2>Enumeration Type Documentation</h2> +<a class="anchor" name="bccd39d32dd83905178cf42edaae5c4d"></a><!-- doxytag: member="inotify-cxx.h::InotifyCapability_t" ref="bccd39d32dd83905178cf42edaae5c4d" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="inotify-cxx_8h.html#bccd39d32dd83905178cf42edaae5c4d">InotifyCapability_t</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +inotify capability/limit identifiers +<p> +<dl compact><dt><b>Enumerator: </b></dt><dd> +<table border="0" cellspacing="2" cellpadding="0"> +<tr><td valign="top"><em><a class="anchor" name="bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1"></a><!-- doxytag: member="IN_MAX_EVENTS" ref="bccd39d32dd83905178cf42edaae5c4d18e969c9c44523b38a13b0a207286dd1" args="" -->IN_MAX_EVENTS</em> </td><td> +max. events in the kernel queue </td></tr> +<tr><td valign="top"><em><a class="anchor" name="bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9"></a><!-- doxytag: member="IN_MAX_INSTANCES" ref="bccd39d32dd83905178cf42edaae5c4d43cc45296a9afe5cb68f568176608dd9" args="" -->IN_MAX_INSTANCES</em> </td><td> +max. inotify file descriptors per process </td></tr> +<tr><td valign="top"><em><a class="anchor" name="bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429"></a><!-- doxytag: member="IN_MAX_WATCHES" ref="bccd39d32dd83905178cf42edaae5c4d594390780d2bdcec064c00aec1f20429" args="" -->IN_MAX_WATCHES</em> </td><td> +max. watches per file descriptor </td></tr> +</table> +</dl> + +</div> +</div><p> +<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> diff --git a/shared/inotify/doc/html/tab_b.gif b/shared/inotify/doc/html/tab_b.gif Binary files differnew file mode 100644 index 00000000..0d623483 --- /dev/null +++ b/shared/inotify/doc/html/tab_b.gif diff --git a/shared/inotify/doc/html/tab_l.gif b/shared/inotify/doc/html/tab_l.gif Binary files differnew file mode 100644 index 00000000..9b1e6337 --- /dev/null +++ b/shared/inotify/doc/html/tab_l.gif diff --git a/shared/inotify/doc/html/tab_r.gif b/shared/inotify/doc/html/tab_r.gif Binary files differnew file mode 100644 index 00000000..ce9dd9f5 --- /dev/null +++ b/shared/inotify/doc/html/tab_r.gif diff --git a/shared/inotify/doc/html/tabs.css b/shared/inotify/doc/html/tabs.css new file mode 100644 index 00000000..a61552a6 --- /dev/null +++ b/shared/inotify/doc/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/shared/inotify/doc/man/man3/Inotify.3 b/shared/inotify/doc/man/man3/Inotify.3 new file mode 100644 index 00000000..23188784 --- /dev/null +++ b/shared/inotify/doc/man/man3/Inotify.3 @@ -0,0 +1,642 @@ +.TH "Inotify" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +Inotify \- inotify class + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include <inotify-cxx.h>\fP +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBInotify\fP () throw (InotifyException)" +.br +.RI "\fIConstructor. \fP" +.ti -1c +.RI "\fB~Inotify\fP ()" +.br +.RI "\fIDestructor. \fP" +.ti -1c +.RI "void \fBClose\fP ()" +.br +.RI "\fIRemoves all watches and closes the inotify device. \fP" +.ti -1c +.RI "void \fBAdd\fP (\fBInotifyWatch\fP *pWatch) throw (InotifyException)" +.br +.RI "\fIAdds a new watch. \fP" +.ti -1c +.RI "void \fBAdd\fP (\fBInotifyWatch\fP &rWatch) throw (InotifyException)" +.br +.RI "\fIAdds a new watch. \fP" +.ti -1c +.RI "void \fBRemove\fP (\fBInotifyWatch\fP *pWatch) throw (InotifyException)" +.br +.RI "\fIRemoves a watch. \fP" +.ti -1c +.RI "void \fBRemove\fP (\fBInotifyWatch\fP &rWatch) throw (InotifyException)" +.br +.RI "\fIRemoves a watch. \fP" +.ti -1c +.RI "void \fBRemoveAll\fP ()" +.br +.RI "\fIRemoves all watches. \fP" +.ti -1c +.RI "size_t \fBGetWatchCount\fP () const" +.br +.RI "\fIReturns the count of watches. \fP" +.ti -1c +.RI "size_t \fBGetEnabledCount\fP () const" +.br +.RI "\fIReturns the count of enabled watches. \fP" +.ti -1c +.RI "void \fBWaitForEvents\fP (bool fNoIntr=false) throw (InotifyException)" +.br +.RI "\fIWaits for inotify events. \fP" +.ti -1c +.RI "size_t \fBGetEventCount\fP ()" +.br +.RI "\fIReturns the count of received and queued events. \fP" +.ti -1c +.RI "bool \fBGetEvent\fP (\fBInotifyEvent\fP *pEvt) throw (InotifyException)" +.br +.RI "\fIExtracts a queued inotify event. \fP" +.ti -1c +.RI "bool \fBGetEvent\fP (\fBInotifyEvent\fP &rEvt) throw (InotifyException)" +.br +.RI "\fIExtracts a queued inotify event. \fP" +.ti -1c +.RI "bool \fBPeekEvent\fP (\fBInotifyEvent\fP *pEvt) throw (InotifyException)" +.br +.RI "\fIExtracts a queued inotify event (without removing). \fP" +.ti -1c +.RI "bool \fBPeekEvent\fP (\fBInotifyEvent\fP &rEvt) throw (InotifyException)" +.br +.RI "\fIExtracts a queued inotify event (without removing). \fP" +.ti -1c +.RI "\fBInotifyWatch\fP * \fBFindWatch\fP (int iDescriptor)" +.br +.RI "\fISearches for a watch by a watch descriptor. \fP" +.ti -1c +.RI "\fBInotifyWatch\fP * \fBFindWatch\fP (const std::string &rPath)" +.br +.RI "\fISearches for a watch by a filesystem path. \fP" +.ti -1c +.RI "int \fBGetDescriptor\fP () const" +.br +.RI "\fIReturns the file descriptor. \fP" +.ti -1c +.RI "void \fBSetNonBlock\fP (bool fNonBlock) throw (InotifyException)" +.br +.RI "\fIEnables/disables non-blocking mode. \fP" +.ti -1c +.RI "void \fBSetCloseOnExec\fP (bool fClOnEx) throw (InotifyException)" +.br +.RI "\fIEnables/disables closing on exec. \fP" +.in -1c +.SS "Static Public Member Functions" + +.in +1c +.ti -1c +.RI "static uint32_t \fBGetCapability\fP (\fBInotifyCapability_t\fP cap) throw (InotifyException)" +.br +.RI "\fIAcquires a particular inotify capability/limit. \fP" +.ti -1c +.RI "static void \fBSetCapability\fP (\fBInotifyCapability_t\fP cap, uint32_t val) throw (InotifyException)" +.br +.RI "\fIModifies a particular inotify capability/limit. \fP" +.ti -1c +.RI "static uint32_t \fBGetMaxEvents\fP () throw (InotifyException)" +.br +.RI "\fIReturns the maximum number of events in the kernel queue. \fP" +.ti -1c +.RI "static void \fBSetMaxEvents\fP (uint32_t val) throw (InotifyException)" +.br +.RI "\fISets the maximum number of events in the kernel queue. \fP" +.ti -1c +.RI "static uint32_t \fBGetMaxInstances\fP () throw (InotifyException)" +.br +.RI "\fIReturns the maximum number of inotify instances per process. \fP" +.ti -1c +.RI "static void \fBSetMaxInstances\fP (uint32_t val) throw (InotifyException)" +.br +.RI "\fISets the maximum number of inotify instances per process. \fP" +.ti -1c +.RI "static uint32_t \fBGetMaxWatches\fP () throw (InotifyException)" +.br +.RI "\fIReturns the maximum number of inotify watches per instance. \fP" +.ti -1c +.RI "static void \fBSetMaxWatches\fP (uint32_t val) throw (InotifyException)" +.br +.RI "\fISets the maximum number of inotify watches per instance. \fP" +.in -1c +.SS "Friends" + +.in +1c +.ti -1c +.RI "class \fBInotifyWatch\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +inotify class + +It holds information about the inotify device descriptor and manages the event queue. +.PP +If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. +.PP +.SH "Constructor & Destructor Documentation" +.PP +.SS "Inotify::Inotify () throw (\fBInotifyException\fP)" +.PP +Constructor. +.PP +Creates and initializes an instance of inotify communication object (opens the inotify device). +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if inotify isn't available +.RE +.PP + +.SS "Inotify::~Inotify ()" +.PP +Destructor. +.PP +Calls \fBClose()\fP due to clean-up. +.SH "Member Function Documentation" +.PP +.SS "void Inotify::Close ()" +.PP +Removes all watches and closes the inotify device. +.PP +.SS "void Inotify::Add (\fBInotifyWatch\fP * pWatch) throw (\fBInotifyException\fP)" +.PP +Adds a new watch. +.PP +\fBParameters:\fP +.RS 4 +\fIpWatch\fP inotify watch +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if adding failed +.RE +.PP + +.SS "void Inotify::Add (\fBInotifyWatch\fP & rWatch) throw (\fBInotifyException\fP)\fC [inline]\fP" +.PP +Adds a new watch. +.PP +\fBParameters:\fP +.RS 4 +\fIrWatch\fP inotify watch +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if adding failed +.RE +.PP + +.SS "void Inotify::Remove (\fBInotifyWatch\fP * pWatch) throw (\fBInotifyException\fP)" +.PP +Removes a watch. +.PP +If the given watch is not present it does nothing. +.PP +\fBParameters:\fP +.RS 4 +\fIpWatch\fP inotify watch +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if removing failed +.RE +.PP + +.SS "void Inotify::Remove (\fBInotifyWatch\fP & rWatch) throw (\fBInotifyException\fP)\fC [inline]\fP" +.PP +Removes a watch. +.PP +If the given watch is not present it does nothing. +.PP +\fBParameters:\fP +.RS 4 +\fIrWatch\fP inotify watch +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if removing failed +.RE +.PP + +.SS "void Inotify::RemoveAll ()" +.PP +Removes all watches. +.PP +.SS "size_t Inotify::GetWatchCount () const\fC [inline]\fP" +.PP +Returns the count of watches. +.PP +This is the total count of all watches (regardless whether enabled or not). +.PP +\fBReturns:\fP +.RS 4 +count of watches +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBGetEnabledCount()\fP +.RE +.PP + +.SS "size_t Inotify::GetEnabledCount () const\fC [inline]\fP" +.PP +Returns the count of enabled watches. +.PP +\fBReturns:\fP +.RS 4 +count of enabled watches +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBGetWatchCount()\fP +.RE +.PP + +.SS "void Inotify::WaitForEvents (bool fNoIntr = \fCfalse\fP) throw (\fBInotifyException\fP)" +.PP +Waits for inotify events. +.PP +It waits until one or more events occur. When called in nonblocking mode it only retrieves occurred events to the internal queue and exits. +.PP +\fBParameters:\fP +.RS 4 +\fIfNoIntr\fP if true it re-calls the system call after a handled signal +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if reading events failed +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBSetNonBlock()\fP +.RE +.PP + +.SS "size_t Inotify::GetEventCount ()\fC [inline]\fP" +.PP +Returns the count of received and queued events. +.PP +This number is related to the events in the queue inside this object, not to the events pending in the kernel. +.PP +\fBReturns:\fP +.RS 4 +count of events +.RE +.PP + +.SS "bool Inotify::GetEvent (\fBInotifyEvent\fP * pEvt) throw (\fBInotifyException\fP)" +.PP +Extracts a queued inotify event. +.PP +The extracted event is removed from the queue. If the pointer is NULL it does nothing. +.PP +\fBParameters:\fP +.RS 4 +\fIpEvt\fP event object +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the provided pointer is NULL +.RE +.PP + +.SS "bool Inotify::GetEvent (\fBInotifyEvent\fP & rEvt) throw (\fBInotifyException\fP)\fC [inline]\fP" +.PP +Extracts a queued inotify event. +.PP +The extracted event is removed from the queue. +.PP +\fBParameters:\fP +.RS 4 +\fIrEvt\fP event object +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown only in very anomalous cases +.RE +.PP + +.SS "bool Inotify::PeekEvent (\fBInotifyEvent\fP * pEvt) throw (\fBInotifyException\fP)" +.PP +Extracts a queued inotify event (without removing). +.PP +The extracted event stays in the queue. If the pointer is NULL it does nothing. +.PP +\fBParameters:\fP +.RS 4 +\fIpEvt\fP event object +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the provided pointer is NULL +.RE +.PP + +.SS "bool Inotify::PeekEvent (\fBInotifyEvent\fP & rEvt) throw (\fBInotifyException\fP)\fC [inline]\fP" +.PP +Extracts a queued inotify event (without removing). +.PP +The extracted event stays in the queue. +.PP +\fBParameters:\fP +.RS 4 +\fIrEvt\fP event object +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown only in very anomalous cases +.RE +.PP + +.SS "\fBInotifyWatch\fP * Inotify::FindWatch (int iDescriptor)" +.PP +Searches for a watch by a watch descriptor. +.PP +It tries to find a watch by the given descriptor. +.PP +\fBParameters:\fP +.RS 4 +\fIiDescriptor\fP watch descriptor +.RE +.PP +\fBReturns:\fP +.RS 4 +pointer to a watch; NULL if no such watch exists +.RE +.PP + +.SS "\fBInotifyWatch\fP * Inotify::FindWatch (const std::string & rPath)" +.PP +Searches for a watch by a filesystem path. +.PP +It tries to find a watch by the given filesystem path. +.PP +\fBParameters:\fP +.RS 4 +\fIrPath\fP filesystem path +.RE +.PP +\fBReturns:\fP +.RS 4 +pointer to a watch; NULL if no such watch exists +.RE +.PP +\fBAttention:\fP +.RS 4 +The path must be exactly identical to the one used for the searched watch. Be careful about absolute/relative and case-insensitive paths. +.RE +.PP + +.SS "int Inotify::GetDescriptor () const\fC [inline]\fP" +.PP +Returns the file descriptor. +.PP +The descriptor can be used in standard low-level file functions (poll(), select(), fcntl() etc.). +.PP +\fBReturns:\fP +.RS 4 +valid file descriptor or -1 for inactive object +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBSetNonBlock()\fP +.RE +.PP + +.SS "void Inotify::SetNonBlock (bool fNonBlock) throw (\fBInotifyException\fP)" +.PP +Enables/disables non-blocking mode. +.PP +Use this mode if you want to monitor the descriptor (acquired thru \fBGetDescriptor()\fP) in functions such as poll(), select() etc. +.PP +Non-blocking mode is disabled by default. +.PP +\fBParameters:\fP +.RS 4 +\fIfNonBlock\fP enable/disable non-blocking mode +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if setting mode failed +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBGetDescriptor()\fP, \fBSetCloseOnExec()\fP +.RE +.PP + +.SS "void Inotify::SetCloseOnExec (bool fClOnEx) throw (\fBInotifyException\fP)" +.PP +Enables/disables closing on exec. +.PP +Enable this if you want to close the descriptor when executing another program. Otherwise, the descriptor will be inherited. +.PP +Closing on exec is disabled by default. +.PP +\fBParameters:\fP +.RS 4 +\fIfClOnEx\fP enable/disable closing on exec +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if setting failed +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBGetDescriptor()\fP, \fBSetNonBlock()\fP +.RE +.PP + +.SS "uint32_t Inotify::GetCapability (\fBInotifyCapability_t\fP cap) throw (\fBInotifyException\fP)\fC [static]\fP" +.PP +Acquires a particular inotify capability/limit. +.PP +\fBParameters:\fP +.RS 4 +\fIcap\fP capability/limit identifier +.RE +.PP +\fBReturns:\fP +.RS 4 +capability/limit value +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be acquired +.RE +.PP + +.SS "void Inotify::SetCapability (\fBInotifyCapability_t\fP cap, uint32_t val) throw (\fBInotifyException\fP)\fC [static]\fP" +.PP +Modifies a particular inotify capability/limit. +.PP +\fBParameters:\fP +.RS 4 +\fIcap\fP capability/limit identifier +.br +\fIval\fP new capability/limit value +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be set +.RE +.PP +\fBAttention:\fP +.RS 4 +Using this function requires root privileges. Beware of setting extensive values - it may seriously affect system performance and/or stability. +.RE +.PP + +.SS "static uint32_t Inotify::GetMaxEvents () throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Returns the maximum number of events in the kernel queue. +.PP +\fBReturns:\fP +.RS 4 +maximum number of events in the kernel queue +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be acquired +.RE +.PP + +.SS "static void Inotify::SetMaxEvents (uint32_t val) throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Sets the maximum number of events in the kernel queue. +.PP +\fBParameters:\fP +.RS 4 +\fIval\fP new value +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be set +.RE +.PP +\fBAttention:\fP +.RS 4 +Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. +.RE +.PP + +.SS "static uint32_t Inotify::GetMaxInstances () throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Returns the maximum number of inotify instances per process. +.PP +It means the maximum number of open inotify file descriptors per running process. +.PP +\fBReturns:\fP +.RS 4 +maximum number of inotify instances +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be acquired +.RE +.PP + +.SS "static void Inotify::SetMaxInstances (uint32_t val) throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Sets the maximum number of inotify instances per process. +.PP +\fBParameters:\fP +.RS 4 +\fIval\fP new value +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be set +.RE +.PP +\fBAttention:\fP +.RS 4 +Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. +.RE +.PP + +.SS "static uint32_t Inotify::GetMaxWatches () throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Returns the maximum number of inotify watches per instance. +.PP +It means the maximum number of inotify watches per inotify file descriptor. +.PP +\fBReturns:\fP +.RS 4 +maximum number of inotify watches +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be acquired +.RE +.PP + +.SS "static void Inotify::SetMaxWatches (uint32_t val) throw (\fBInotifyException\fP)\fC [inline, static]\fP" +.PP +Sets the maximum number of inotify watches per instance. +.PP +\fBParameters:\fP +.RS 4 +\fIval\fP new value +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if the given value cannot be set +.RE +.PP +\fBAttention:\fP +.RS 4 +Using this function requires root privileges. Beware of setting extensive values - the greater value is set here the more physical memory may be used for the inotify infrastructure. +.RE +.PP + +.SH "Friends And Related Function Documentation" +.PP +.SS "friend class \fBInotifyWatch\fP\fC [friend]\fP" +.PP + + +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/doc/man/man3/InotifyEvent.3 b/shared/inotify/doc/man/man3/InotifyEvent.3 new file mode 100644 index 00000000..51899460 --- /dev/null +++ b/shared/inotify/doc/man/man3/InotifyEvent.3 @@ -0,0 +1,268 @@ +.TH "InotifyEvent" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +InotifyEvent \- inotify event class + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include <inotify-cxx.h>\fP +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBInotifyEvent\fP ()" +.br +.RI "\fIConstructor. \fP" +.ti -1c +.RI "\fBInotifyEvent\fP (const struct inotify_event *pEvt, \fBInotifyWatch\fP *pWatch)" +.br +.RI "\fIConstructor. \fP" +.ti -1c +.RI "\fB~InotifyEvent\fP ()" +.br +.RI "\fIDestructor. \fP" +.ti -1c +.RI "int32_t \fBGetDescriptor\fP () const" +.br +.RI "\fIReturns the event watch descriptor. \fP" +.ti -1c +.RI "uint32_t \fBGetMask\fP () const" +.br +.RI "\fIReturns the event mask. \fP" +.ti -1c +.RI "bool \fBIsType\fP (uint32_t uType) const" +.br +.RI "\fIChecks for the event type. \fP" +.ti -1c +.RI "uint32_t \fBGetCookie\fP () const" +.br +.RI "\fIReturns the event cookie. \fP" +.ti -1c +.RI "uint32_t \fBGetLength\fP () const" +.br +.RI "\fIReturns the event name length. \fP" +.ti -1c +.RI "const std::string & \fBGetName\fP () const" +.br +.RI "\fIReturns the event name. \fP" +.ti -1c +.RI "void \fBGetName\fP (std::string &rName) const" +.br +.RI "\fIExtracts the event name. \fP" +.ti -1c +.RI "\fBInotifyWatch\fP * \fBGetWatch\fP ()" +.br +.RI "\fIReturns the source watch. \fP" +.ti -1c +.RI "void \fBDumpTypes\fP (std::string &rStr) const" +.br +.RI "\fIFills the string with all types contained in the event mask. \fP" +.in -1c +.SS "Static Public Member Functions" + +.in +1c +.ti -1c +.RI "static bool \fBIsType\fP (uint32_t uValue, uint32_t uType)" +.br +.RI "\fIChecks a value for the event type. \fP" +.ti -1c +.RI "static uint32_t \fBGetMaskByName\fP (const std::string &rName)" +.br +.RI "\fIFinds the appropriate mask for a name. \fP" +.ti -1c +.RI "static void \fBDumpTypes\fP (uint32_t uValue, std::string &rStr)" +.br +.RI "\fIFills the string with all types contained in an event mask value. \fP" +.in -1c +.SH "Detailed Description" +.PP +inotify event class + +It holds all information about inotify event and provides access to its particular values. +.PP +This class is not (and is not intended to be) thread-safe and therefore it must not be used concurrently in multiple threads. +.PP +.SH "Constructor & Destructor Documentation" +.PP +.SS "InotifyEvent::InotifyEvent ()\fC [inline]\fP" +.PP +Constructor. +.PP +Creates a plain event. +.SS "InotifyEvent::InotifyEvent (const struct inotify_event * pEvt, \fBInotifyWatch\fP * pWatch)\fC [inline]\fP" +.PP +Constructor. +.PP +Creates an event based on inotify event data. For NULL pointers it works the same way as \fBInotifyEvent()\fP. +.PP +\fBParameters:\fP +.RS 4 +\fIpEvt\fP event data +.br +\fIpWatch\fP inotify watch +.RE +.PP + +.SS "InotifyEvent::~InotifyEvent ()\fC [inline]\fP" +.PP +Destructor. +.PP +.SH "Member Function Documentation" +.PP +.SS "int32_t InotifyEvent::GetDescriptor () const" +.PP +Returns the event watch descriptor. +.PP +\fBReturns:\fP +.RS 4 +watch descriptor +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBInotifyWatch::GetDescriptor()\fP +.RE +.PP + +.SS "uint32_t InotifyEvent::GetMask () const\fC [inline]\fP" +.PP +Returns the event mask. +.PP +\fBReturns:\fP +.RS 4 +event mask +.RE +.PP +\fBSee also:\fP +.RS 4 +\fBInotifyWatch::GetMask()\fP +.RE +.PP + +.SS "static bool InotifyEvent::IsType (uint32_t uValue, uint32_t uType)\fC [inline, static]\fP" +.PP +Checks a value for the event type. +.PP +\fBParameters:\fP +.RS 4 +\fIuValue\fP checked value +.br +\fIuType\fP type which is checked for +.RE +.PP +\fBReturns:\fP +.RS 4 +true = the value contains the given type, false = otherwise +.RE +.PP + +.SS "bool InotifyEvent::IsType (uint32_t uType) const\fC [inline]\fP" +.PP +Checks for the event type. +.PP +\fBParameters:\fP +.RS 4 +\fIuType\fP type which is checked for +.RE +.PP +\fBReturns:\fP +.RS 4 +true = event mask contains the given type, false = otherwise +.RE +.PP + +.SS "uint32_t InotifyEvent::GetCookie () const\fC [inline]\fP" +.PP +Returns the event cookie. +.PP +\fBReturns:\fP +.RS 4 +event cookie +.RE +.PP + +.SS "uint32_t InotifyEvent::GetLength () const\fC [inline]\fP" +.PP +Returns the event name length. +.PP +\fBReturns:\fP +.RS 4 +event name length +.RE +.PP + +.SS "const std::string& InotifyEvent::GetName () const\fC [inline]\fP" +.PP +Returns the event name. +.PP +\fBReturns:\fP +.RS 4 +event name +.RE +.PP + +.SS "void InotifyEvent::GetName (std::string & rName) const\fC [inline]\fP" +.PP +Extracts the event name. +.PP +\fBParameters:\fP +.RS 4 +\fIrName\fP event name +.RE +.PP + +.SS "\fBInotifyWatch\fP* InotifyEvent::GetWatch ()\fC [inline]\fP" +.PP +Returns the source watch. +.PP +\fBReturns:\fP +.RS 4 +source watch +.RE +.PP + +.SS "uint32_t InotifyEvent::GetMaskByName (const std::string & rName)\fC [static]\fP" +.PP +Finds the appropriate mask for a name. +.PP +\fBParameters:\fP +.RS 4 +\fIrName\fP mask name +.RE +.PP +\fBReturns:\fP +.RS 4 +mask for name; 0 on failure +.RE +.PP + +.SS "void InotifyEvent::DumpTypes (uint32_t uValue, std::string & rStr)\fC [static]\fP" +.PP +Fills the string with all types contained in an event mask value. +.PP +\fBParameters:\fP +.RS 4 +\fIuValue\fP event mask value +.br +\fIrStr\fP dumped event types +.RE +.PP + +.SS "void InotifyEvent::DumpTypes (std::string & rStr) const" +.PP +Fills the string with all types contained in the event mask. +.PP +\fBParameters:\fP +.RS 4 +\fIrStr\fP dumped event types +.RE +.PP + + +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/doc/man/man3/InotifyException.3 b/shared/inotify/doc/man/man3/InotifyException.3 new file mode 100644 index 00000000..90c5990d --- /dev/null +++ b/shared/inotify/doc/man/man3/InotifyException.3 @@ -0,0 +1,125 @@ +.TH "InotifyException" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +InotifyException \- Class for inotify exceptions. + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include <inotify-cxx.h>\fP +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBInotifyException\fP (const std::string &rMsg='', int iErr=0, void *pSrc=NULL)" +.br +.RI "\fIConstructor. \fP" +.ti -1c +.RI "const std::string & \fBGetMessage\fP () const" +.br +.RI "\fIReturns the exception message. \fP" +.ti -1c +.RI "int \fBGetErrorNumber\fP () const" +.br +.RI "\fIReturns the exception error number. \fP" +.ti -1c +.RI "void * \fBGetSource\fP () const" +.br +.RI "\fIReturns the exception source. \fP" +.in -1c +.SS "Protected Attributes" + +.in +1c +.ti -1c +.RI "std::string \fBm_msg\fP" +.br +.RI "\fImessage \fP" +.ti -1c +.RI "int \fBm_err\fP" +.br +.RI "\fIerror number \fP" +.ti -1c +.RI "void * \fBm_pSrc\fP" +.br +.RI "\fIsource \fP" +.in -1c +.SH "Detailed Description" +.PP +Class for inotify exceptions. + +This class allows to acquire information about exceptional events. It makes easier to log or display error messages and to identify problematic code locations. +.PP +Although this class is basically thread-safe it is not intended to be shared between threads. +.PP +.SH "Constructor & Destructor Documentation" +.PP +.SS "InotifyException::InotifyException (const std::string & rMsg = \fC''\fP, int iErr = \fC0\fP, void * pSrc = \fCNULL\fP)\fC [inline]\fP" +.PP +Constructor. +.PP +\fBParameters:\fP +.RS 4 +\fIrMsg\fP message +.br +\fIiErr\fP error number (see errno.h) +.br +\fIpSrc\fP source +.RE +.PP + +.SH "Member Function Documentation" +.PP +.SS "const std::string& InotifyException::GetMessage () const\fC [inline]\fP" +.PP +Returns the exception message. +.PP +\fBReturns:\fP +.RS 4 +message +.RE +.PP + +.SS "int InotifyException::GetErrorNumber () const\fC [inline]\fP" +.PP +Returns the exception error number. +.PP +If not applicable this value is 0 (zero). +.PP +\fBReturns:\fP +.RS 4 +error number (standardized; see errno.h) +.RE +.PP + +.SS "void* InotifyException::GetSource () const\fC [inline]\fP" +.PP +Returns the exception source. +.PP +\fBReturns:\fP +.RS 4 +source +.RE +.PP + +.SH "Member Data Documentation" +.PP +.SS "std::string \fBInotifyException::m_msg\fP\fC [protected]\fP" +.PP +message +.PP +.SS "int \fBInotifyException::m_err\fP\fC [protected]\fP" +.PP +error number +.PP +.SS "void* \fBInotifyException::m_pSrc\fP\fC [mutable, protected]\fP" +.PP +source +.PP + + +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/doc/man/man3/InotifyWatch.3 b/shared/inotify/doc/man/man3/InotifyWatch.3 new file mode 100644 index 00000000..ea352997 --- /dev/null +++ b/shared/inotify/doc/man/man3/InotifyWatch.3 @@ -0,0 +1,207 @@ +.TH "InotifyWatch" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +InotifyWatch \- inotify watch class + +.PP +.SH SYNOPSIS +.br +.PP +\fC#include <inotify-cxx.h>\fP +.PP +.SS "Public Member Functions" + +.in +1c +.ti -1c +.RI "\fBInotifyWatch\fP (const std::string &rPath, int32_t uMask, bool fEnabled=true)" +.br +.RI "\fIConstructor. \fP" +.ti -1c +.RI "\fB~InotifyWatch\fP ()" +.br +.RI "\fIDestructor. \fP" +.ti -1c +.RI "int32_t \fBGetDescriptor\fP () const" +.br +.RI "\fIReturns the watch descriptor. \fP" +.ti -1c +.RI "const std::string & \fBGetPath\fP () const" +.br +.RI "\fIReturns the watched file path. \fP" +.ti -1c +.RI "uint32_t \fBGetMask\fP () const" +.br +.RI "\fIReturns the watch event mask. \fP" +.ti -1c +.RI "void \fBSetMask\fP (uint32_t uMask) throw (InotifyException)" +.br +.RI "\fISets the watch event mask. \fP" +.ti -1c +.RI "\fBInotify\fP * \fBGetInotify\fP ()" +.br +.RI "\fIReturns the appropriate inotify class instance. \fP" +.ti -1c +.RI "void \fBSetEnabled\fP (bool fEnabled) throw (InotifyException)" +.br +.RI "\fIEnables/disables the watch. \fP" +.ti -1c +.RI "bool \fBIsEnabled\fP () const" +.br +.RI "\fIChecks whether the watch is enabled. \fP" +.ti -1c +.RI "bool \fBIsRecursive\fP () const" +.br +.RI "\fIChecks whether the watch is recursive. \fP" +.in -1c +.SS "Friends" + +.in +1c +.ti -1c +.RI "class \fBInotify\fP" +.br +.in -1c +.SH "Detailed Description" +.PP +inotify watch class + +It holds information about the inotify watch on a particular inode. +.PP +If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. +.PP +.SH "Constructor & Destructor Documentation" +.PP +.SS "InotifyWatch::InotifyWatch (const std::string & rPath, int32_t uMask, bool fEnabled = \fCtrue\fP)\fC [inline]\fP" +.PP +Constructor. +.PP +Creates an inotify watch. Because this watch is inactive it has an invalid descriptor (-1). +.PP +\fBParameters:\fP +.RS 4 +\fIrPath\fP watched file path +.br +\fIuMask\fP mask for events +.br +\fIfEnabled\fP events enabled yes/no +.RE +.PP + +.SS "InotifyWatch::~InotifyWatch ()\fC [inline]\fP" +.PP +Destructor. +.PP +.SH "Member Function Documentation" +.PP +.SS "int32_t InotifyWatch::GetDescriptor () const\fC [inline]\fP" +.PP +Returns the watch descriptor. +.PP +\fBReturns:\fP +.RS 4 +watch descriptor; -1 for inactive watch +.RE +.PP + +.SS "const std::string& InotifyWatch::GetPath () const\fC [inline]\fP" +.PP +Returns the watched file path. +.PP +\fBReturns:\fP +.RS 4 +file path +.RE +.PP + +.SS "uint32_t InotifyWatch::GetMask () const\fC [inline]\fP" +.PP +Returns the watch event mask. +.PP +\fBReturns:\fP +.RS 4 +event mask +.RE +.PP + +.SS "void InotifyWatch::SetMask (uint32_t uMask) throw (\fBInotifyException\fP)" +.PP +Sets the watch event mask. +.PP +If the watch is active (added to an instance of \fBInotify\fP) this method may fail due to unsuccessful re-setting the watch in the kernel. +.PP +\fBParameters:\fP +.RS 4 +\fIuMask\fP event mask +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if changing fails +.RE +.PP + +.SS "\fBInotify\fP* InotifyWatch::GetInotify ()\fC [inline]\fP" +.PP +Returns the appropriate inotify class instance. +.PP +\fBReturns:\fP +.RS 4 +inotify instance +.RE +.PP + +.SS "void InotifyWatch::SetEnabled (bool fEnabled) throw (\fBInotifyException\fP)" +.PP +Enables/disables the watch. +.PP +If the watch is active (added to an instance of \fBInotify\fP) this method may fail due to unsuccessful re-setting the watch in the kernel. +.PP +Re-setting the current state has no effect. +.PP +\fBParameters:\fP +.RS 4 +\fIfEnabled\fP set enabled yes/no +.RE +.PP +\fBExceptions:\fP +.RS 4 +\fI\fBInotifyException\fP\fP thrown if enabling/disabling fails +.RE +.PP + +.SS "bool InotifyWatch::IsEnabled () const\fC [inline]\fP" +.PP +Checks whether the watch is enabled. +.PP +\fBReturns:\fP +.RS 4 +true = enables, false = disabled +.RE +.PP + +.SS "bool InotifyWatch::IsRecursive () const\fC [inline]\fP" +.PP +Checks whether the watch is recursive. +.PP +A recursive watch monitors a directory itself and all its subdirectories. This watch is a logical object which may have many underlying kernel watches. +.PP +\fBReturns:\fP +.RS 4 +currently always false (recursive watches not yet supported) +.RE +.PP +\fBAttention:\fP +.RS 4 +Recursive watches are currently NOT supported. They are planned for future versions. +.RE +.PP + +.SH "Friends And Related Function Documentation" +.PP +.SS "friend class \fBInotify\fP\fC [friend]\fP" +.PP + + +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/doc/man/man3/inotify-cxx.cpp.3 b/shared/inotify/doc/man/man3/inotify-cxx.cpp.3 new file mode 100644 index 00000000..dd326b47 --- /dev/null +++ b/shared/inotify/doc/man/man3/inotify-cxx.cpp.3 @@ -0,0 +1,70 @@ +.TH "inotify-cxx.cpp" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +inotify-cxx.cpp \- inotify C++ interface implementation +.SH SYNOPSIS +.br +.PP +\fC#include <errno.h>\fP +.br +\fC#include <unistd.h>\fP +.br +\fC#include <fcntl.h>\fP +.br +\fC#include 'inotify-cxx.h'\fP +.br + +.SS "Defines" + +.in +1c +.ti -1c +.RI "#define \fBPROCFS_INOTIFY_BASE\fP '/proc/sys/fs/inotify/'" +.br +.RI "\fIprocfs inotify base path \fP" +.ti -1c +.RI "#define \fBDUMP_SEP\fP" +.br +.RI "\fIdump separator (between particular entries) \fP" +.in -1c +.SH "Detailed Description" +.PP +inotify C++ interface implementation + +inotify C++ interface +.PP +Copyright (C) 2006, 2007 Lukas Jelinek <lukas@aiken.cz> +.PP +This program is free software; you can redistribute it and/or modify it under the terms of one of the following licenses: +.PP +.PD 0 +.IP "\(bu" 2 +1. X11-style license (see LICENSE-X11) +.IP "\(bu" 2 +2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) +.IP "\(bu" 2 +3. GNU General Public License, version 2 (see LICENSE-GPL) +.PP +If you want to help with choosing the best license for you, please visit http://www.gnu.org/licenses/license-list.html. +.SH "Define Documentation" +.PP +.SS "#define DUMP_SEP" +.PP +\fBValue:\fP +.PP +.nf +({ \ + if (!rStr.empty()) { \ + rStr.append(','); \ + } \ + }) +.fi +dump separator (between particular entries) +.PP +.SS "#define PROCFS_INOTIFY_BASE '/proc/sys/fs/inotify/'" +.PP +procfs inotify base path +.PP +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/doc/man/man3/inotify-cxx.h.3 b/shared/inotify/doc/man/man3/inotify-cxx.h.3 new file mode 100644 index 00000000..4e0ec8b3 --- /dev/null +++ b/shared/inotify/doc/man/man3/inotify-cxx.h.3 @@ -0,0 +1,198 @@ +.TH "inotify-cxx.h" 3 "18 Apr 2007" "Version 0.7.2" "inotify-cxx" \" -*- nroff -*- +.ad l +.nh +.SH NAME +inotify-cxx.h \- inotify C++ interface header +.SH SYNOPSIS +.br +.PP +\fC#include <stdint.h>\fP +.br +\fC#include <string>\fP +.br +\fC#include <deque>\fP +.br +\fC#include <map>\fP +.br +\fC#include <sys/syscall.h>\fP +.br +\fC#include <sys/inotify.h>\fP +.br +\fC#include <sys/inotify-syscalls.h>\fP +.br + +.SS "Classes" + +.in +1c +.ti -1c +.RI "class \fBInotifyException\fP" +.br +.RI "\fIClass for inotify exceptions. \fP" +.ti -1c +.RI "class \fBInotifyEvent\fP" +.br +.RI "\fIinotify event class \fP" +.ti -1c +.RI "class \fBInotifyWatch\fP" +.br +.RI "\fIinotify watch class \fP" +.ti -1c +.RI "class \fBInotify\fP" +.br +.RI "\fIinotify class \fP" +.in -1c +.SS "Defines" + +.in +1c +.ti -1c +.RI "#define \fBINOTIFY_EVENT_SIZE\fP (sizeof(struct inotify_event))" +.br +.RI "\fIEvent struct size. \fP" +.ti -1c +.RI "#define \fBINOTIFY_BUFLEN\fP (1024 * (INOTIFY_EVENT_SIZE + 16))" +.br +.RI "\fIEvent buffer length. \fP" +.ti -1c +.RI "#define \fBIN_EXC_MSG\fP(msg) (std::string(__PRETTY_FUNCTION__) + ': ' + msg)" +.br +.RI "\fIHelper macro for creating exception messages. \fP" +.ti -1c +.RI "#define \fBIN_LOCK_DECL\fP" +.br +.RI "\fIinotify-cxx thread safety \fP" +.ti -1c +.RI "#define \fBIN_LOCK_INIT\fP" +.br +.ti -1c +.RI "#define \fBIN_LOCK_DONE\fP" +.br +.ti -1c +.RI "#define \fBIN_READ_BEGIN\fP" +.br +.ti -1c +.RI "#define \fBIN_READ_END\fP" +.br +.ti -1c +.RI "#define \fBIN_READ_END_NOTHROW\fP" +.br +.ti -1c +.RI "#define \fBIN_WRITE_BEGIN\fP" +.br +.ti -1c +.RI "#define \fBIN_WRITE_END\fP" +.br +.ti -1c +.RI "#define \fBIN_WRITE_END_NOTHROW\fP" +.br +.in -1c +.SS "Typedefs" + +.in +1c +.ti -1c +.RI "typedef std::map< int32_t, \fBInotifyWatch\fP * > \fBIN_WATCH_MAP\fP" +.br +.RI "\fIMapping from watch descriptors to watch objects. \fP" +.ti -1c +.RI "typedef std::map< std::string, \fBInotifyWatch\fP * > \fBIN_WP_MAP\fP" +.br +.RI "\fIMapping from paths to watch objects. \fP" +.in -1c +.SS "Enumerations" + +.in +1c +.ti -1c +.RI "enum \fBInotifyCapability_t\fP { \fBIN_MAX_EVENTS\fP = 0, \fBIN_MAX_INSTANCES\fP = 1, \fBIN_MAX_WATCHES\fP = 2 }" +.br +.RI "\fIinotify capability/limit identifiers \fP" +.in -1c +.SH "Detailed Description" +.PP +inotify C++ interface header + +inotify C++ interface +.PP +Copyright (C) 2006, 2007 Lukas Jelinek, <lukas@aiken.cz> +.PP +This program is free software; you can redistribute it and/or modify it under the terms of one of the following licenses: +.PP +.PD 0 +.IP "\(bu" 2 +1. X11-style license (see LICENSE-X11) +.IP "\(bu" 2 +2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) +.IP "\(bu" 2 +3. GNU General Public License, version 2 (see LICENSE-GPL) +.PP +If you want to help with choosing the best license for you, please visit http://www.gnu.org/licenses/license-list.html. +.SH "Define Documentation" +.PP +.SS "#define IN_EXC_MSG(msg) (std::string(__PRETTY_FUNCTION__) + ': ' + msg)" +.PP +Helper macro for creating exception messages. +.PP +It prepends the message by the function name. +.SS "#define IN_LOCK_DECL" +.PP +inotify-cxx thread safety +.PP +If this symbol is defined you can use this interface safely threaded applications. Remember that it slightly degrades performance. +.PP +Even if INOTIFY_THREAD_SAFE is defined some classes stay unsafe. If you must use them (must you?) in more than one thread concurrently you need to implement explicite locking. +.PP +You need not to define INOTIFY_THREAD_SAFE in that cases where the application is multithreaded but all the inotify infrastructure will be managed only in one thread. This is the recommended way. +.PP +Locking may fail (it is very rare but not impossible). In this case an exception is thrown. But if unlocking fails in case of an error it does nothing (this failure is ignored). +.SS "#define IN_LOCK_DONE" +.PP +.SS "#define IN_LOCK_INIT" +.PP +.SS "#define IN_READ_BEGIN" +.PP +.SS "#define IN_READ_END" +.PP +.SS "#define IN_READ_END_NOTHROW" +.PP +.SS "#define IN_WRITE_BEGIN" +.PP +.SS "#define IN_WRITE_END" +.PP +.SS "#define IN_WRITE_END_NOTHROW" +.PP +.SS "#define INOTIFY_BUFLEN (1024 * (INOTIFY_EVENT_SIZE + 16))" +.PP +Event buffer length. +.PP +.SS "#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))" +.PP +Event struct size. +.PP +.SH "Typedef Documentation" +.PP +.SS "typedef std::map<int32_t, \fBInotifyWatch\fP*> \fBIN_WATCH_MAP\fP" +.PP +Mapping from watch descriptors to watch objects. +.PP +.SS "typedef std::map<std::string, \fBInotifyWatch\fP*> \fBIN_WP_MAP\fP" +.PP +Mapping from paths to watch objects. +.PP +.SH "Enumeration Type Documentation" +.PP +.SS "enum \fBInotifyCapability_t\fP" +.PP +inotify capability/limit identifiers +.PP +\fBEnumerator: \fP +.in +1c +.TP +\fB\fIIN_MAX_EVENTS \fP\fP +max. events in the kernel queue +.TP +\fB\fIIN_MAX_INSTANCES \fP\fP +max. inotify file descriptors per process +.TP +\fB\fIIN_MAX_WATCHES \fP\fP +max. watches per file descriptor +.SH "Author" +.PP +Generated automatically by Doxygen for inotify-cxx from the source code. diff --git a/shared/inotify/inotify-cxx.cpp b/shared/inotify/inotify-cxx.cpp new file mode 100644 index 00000000..7870e825 --- /dev/null +++ b/shared/inotify/inotify-cxx.cpp @@ -0,0 +1,630 @@ + +/// inotify C++ interface implementation +/** + * \file inotify-cxx.cpp + * + * inotify C++ interface + * + * Copyright (C) 2006, 2007 Lukas Jelinek <lukas@aiken.cz> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of one of the following licenses: + * + * \li 1. X11-style license (see LICENSE-X11) + * \li 2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) + * \li 3. GNU General Public License, version 2 (see LICENSE-GPL) + * + * If you want to help with choosing the best license for you, + * please visit http://www.gnu.org/licenses/license-list.html. + * + */ + + +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> + +#include "inotify-cxx.h" + +/// procfs inotify base path +#define PROCFS_INOTIFY_BASE "/proc/sys/fs/inotify/" + +/// dump separator (between particular entries) +#define DUMP_SEP \ + ({ \ + if (!rStr.empty()) { \ + rStr.append(","); \ + } \ + }) + + + +int32_t InotifyEvent::GetDescriptor() const +{ + return m_pWatch != NULL // if watch exists + ? m_pWatch->GetDescriptor() // return its descriptor + : -1; // else return -1 +} + +uint32_t InotifyEvent::GetMaskByName(const std::string& rName) +{ + if (rName == "IN_ACCESS") + return IN_ACCESS; + else if (rName == "IN_MODIFY") + return IN_MODIFY; + else if (rName == "IN_ATTRIB") + return IN_ATTRIB; + else if (rName == "IN_CLOSE_WRITE") + return IN_CLOSE_WRITE; + else if (rName == "IN_CLOSE_NOWRITE") + return IN_CLOSE_NOWRITE; + else if (rName == "IN_OPEN") + return IN_OPEN; + else if (rName == "IN_MOVED_FROM") + return IN_MOVED_FROM; + else if (rName == "IN_MOVED_TO") + return IN_MOVED_TO; + else if (rName == "IN_CREATE") + return IN_CREATE; + else if (rName == "IN_DELETE") + return IN_DELETE; + else if (rName == "IN_DELETE_SELF") + return IN_DELETE_SELF; + else if (rName == "IN_UNMOUNT") + return IN_UNMOUNT; + else if (rName == "IN_Q_OVERFLOW") + return IN_Q_OVERFLOW; + else if (rName == "IN_IGNORED") + return IN_IGNORED; + else if (rName == "IN_CLOSE") + return IN_CLOSE; + else if (rName == "IN_MOVE") + return IN_MOVE; + else if (rName == "IN_ISDIR") + return IN_ISDIR; + else if (rName == "IN_ONESHOT") + return IN_ONESHOT; + else if (rName == "IN_ALL_EVENTS") + return IN_ALL_EVENTS; + +#ifdef IN_DONT_FOLLOW + else if (rName == "IN_DONT_FOLLOW") + return IN_DONT_FOLLOW; +#endif // IN_DONT_FOLLOW + +#ifdef IN_ONLYDIR + else if (rName == "IN_ONLYDIR") + return IN_ONLYDIR; +#endif // IN_ONLYDIR + +#ifdef IN_MOVE_SELF + else if (rName == "IN_MOVE_SELF") + return IN_MOVE_SELF; +#endif // IN_MOVE_SELF + + return (uint32_t) 0; +} + +void InotifyEvent::DumpTypes(uint32_t uValue, std::string& rStr) +{ + rStr = ""; + + if (IsType(uValue, IN_ALL_EVENTS)) { + rStr.append("IN_ALL_EVENTS"); + } + else { + if (IsType(uValue, IN_ACCESS)) { + DUMP_SEP; + rStr.append("IN_ACCESS"); + } + if (IsType(uValue, IN_MODIFY)) { + DUMP_SEP; + rStr.append("IN_MODIFY"); + } + if (IsType(uValue, IN_ATTRIB)) { + DUMP_SEP; + rStr.append("IN_ATTRIB"); + } + if (IsType(uValue, IN_CREATE)) { + DUMP_SEP; + rStr.append("IN_CREATE"); + } + if (IsType(uValue, IN_DELETE)) { + DUMP_SEP; + rStr.append("IN_DELETE"); + } + if (IsType(uValue, IN_DELETE_SELF)) { + DUMP_SEP; + rStr.append("IN_DELETE_SELF"); + } + if (IsType(uValue, IN_OPEN)) { + DUMP_SEP; + rStr.append("IN_OPEN"); + } + if (IsType(uValue, IN_CLOSE)) { + DUMP_SEP; + rStr.append("IN_CLOSE"); + } + +#ifdef IN_MOVE_SELF + if (IsType(uValue, IN_MOVE_SELF)) { + DUMP_SEP; + rStr.append("IN_MOVE_SELF"); + } +#endif // IN_MOVE_SELF + + else { + if (IsType(uValue, IN_CLOSE_WRITE)) { + DUMP_SEP; + rStr.append("IN_CLOSE_WRITE"); + } + if (IsType(uValue, IN_CLOSE_NOWRITE)) { + DUMP_SEP; + rStr.append("IN_CLOSE_NOWRITE"); + } + } + if (IsType(uValue, IN_MOVE)) { + DUMP_SEP; + rStr.append("IN_MOVE"); + } + else { + if (IsType(uValue, IN_MOVED_FROM)) { + DUMP_SEP; + rStr.append("IN_MOVED_FROM"); + } + if (IsType(uValue, IN_MOVED_TO)) { + DUMP_SEP; + rStr.append("IN_MOVED_TO"); + } + } + } + if (IsType(uValue, IN_UNMOUNT)) { + DUMP_SEP; + rStr.append("IN_UNMOUNT"); + } + if (IsType(uValue, IN_Q_OVERFLOW)) { + DUMP_SEP; + rStr.append("IN_Q_OVERFLOW"); + } + if (IsType(uValue, IN_IGNORED)) { + DUMP_SEP; + rStr.append("IN_IGNORED"); + } + if (IsType(uValue, IN_ISDIR)) { + DUMP_SEP; + rStr.append("IN_ISDIR"); + } + if (IsType(uValue, IN_ONESHOT)) { + DUMP_SEP; + rStr.append("IN_ONESHOT"); + } + +#ifdef IN_DONT_FOLLOW + if (IsType(uValue, IN_DONT_FOLLOW)) { + DUMP_SEP; + rStr.append("IN_DONT_FOLLOW"); + } +#endif // IN_DONT_FOLLOW + +#ifdef IN_ONLYDIR + if (IsType(uValue, IN_ONLYDIR)) { + DUMP_SEP; + rStr.append("IN_ONLYDIR"); + } +#endif // IN_ONLYDIR +} + +void InotifyEvent::DumpTypes(std::string& rStr) const +{ + DumpTypes(m_uMask, rStr); +} + + +void InotifyWatch::SetMask(uint32_t uMask) throw (InotifyException) +{ + IN_WRITE_BEGIN + + if (m_wd != -1) { + int wd = inotify_add_watch(m_pInotify->GetDescriptor(), m_path.c_str(), uMask); + if (wd != m_wd) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("changing mask failed"), wd == -1 ? errno : EINVAL, this); + } + } + + m_uMask = uMask; + + IN_WRITE_END +} + +void InotifyWatch::SetEnabled(bool fEnabled) throw (InotifyException) +{ + IN_WRITE_BEGIN + + if (fEnabled == m_fEnabled) { + IN_WRITE_END_NOTHROW + return; + } + + if (m_pInotify != NULL) { + if (fEnabled) { + m_wd = inotify_add_watch(m_pInotify->GetDescriptor(), m_path.c_str(), m_uMask); + if (m_wd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("enabling watch failed"), errno, this); + } + m_pInotify->m_watches.insert(IN_WATCH_MAP::value_type(m_wd, this)); + } + else { + if (inotify_rm_watch(m_pInotify->GetDescriptor(), m_wd) != 0) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("disabling watch failed"), errno, this); + } + m_pInotify->m_watches.erase(m_wd); + m_wd = -1; + } + } + + m_fEnabled = fEnabled; + + IN_WRITE_END +} + +void InotifyWatch::__Disable() +{ + IN_WRITE_BEGIN + + if (!m_fEnabled) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("event cannot occur on disabled watch"), EINVAL, this); + } + + if (m_pInotify != NULL) { + m_pInotify->m_watches.erase(m_wd); + m_wd = -1; + } + + m_fEnabled = false; + + IN_WRITE_END +} + + +Inotify::Inotify() throw (InotifyException) +{ + IN_LOCK_INIT + + m_fd = inotify_init(); + if (m_fd == -1) { + IN_LOCK_DONE + throw InotifyException(IN_EXC_MSG("inotify init failed"), errno, NULL); + } +} + +Inotify::~Inotify() +{ + Close(); + + IN_LOCK_DONE +} + +void Inotify::Close() +{ + IN_WRITE_BEGIN + + if (m_fd != -1) { + RemoveAll(); + close(m_fd); + m_fd = -1; + } + + IN_WRITE_END +} + +void Inotify::Add(InotifyWatch* pWatch) throw (InotifyException) +{ + IN_WRITE_BEGIN + + // invalid descriptor - this case shouldn't occur - go away + if (m_fd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("invalid file descriptor"), EBUSY, this); + } + + // this path already watched - go away + if (FindWatch(pWatch->GetPath()) != NULL) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("path already watched"), EBUSY, this); + } + + // for enabled watch + if (pWatch->IsEnabled()) { + + // try to add watch to kernel + int wd = inotify_add_watch(m_fd, pWatch->GetPath().c_str(), pWatch->GetMask()); + + // adding failed - go away + if (wd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("adding watch failed"), errno, this); + } + + // this path already watched (but defined another way) + InotifyWatch* pW = FindWatch(wd); + if (pW != NULL) { + + // try to recover old watch because it may be modified - then go away + if (inotify_add_watch(m_fd, pW->GetPath().c_str(), pW->GetMask()) < 0) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("watch collision detected and recovery failed"), errno, this); + } + else { + // recovery failed - go away + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("path already watched (but defined another way)"), EBUSY, this); + } + } + + pWatch->m_wd = wd; + m_watches.insert(IN_WATCH_MAP::value_type(pWatch->m_wd, pWatch)); + } + + m_paths.insert(IN_WP_MAP::value_type(pWatch->m_path, pWatch)); + pWatch->m_pInotify = this; + + IN_WRITE_END +} + +void Inotify::Remove(InotifyWatch* pWatch) throw (InotifyException) +{ + IN_WRITE_BEGIN + + // invalid descriptor - this case shouldn't occur - go away + if (m_fd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("invalid file descriptor"), EBUSY, this); + } + + // for enabled watch + if (pWatch->m_wd != -1) { + + // removing watch failed - go away + if (inotify_rm_watch(m_fd, pWatch->m_wd) == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("removing watch failed"), errno, this); + } + m_watches.erase(pWatch->m_wd); + pWatch->m_wd = -1; + } + + m_paths.erase(pWatch->m_path); + pWatch->m_pInotify = NULL; + + IN_WRITE_END +} + +void Inotify::RemoveAll() +{ + IN_WRITE_BEGIN + + IN_WP_MAP::iterator it = m_paths.begin(); + while (it != m_paths.end()) { + InotifyWatch* pW = (*it).second; + if (pW->m_wd != -1) { + inotify_rm_watch(m_fd, pW->m_wd); + pW->m_wd = -1; + } + pW->m_pInotify = NULL; + it++; + } + + m_watches.clear(); + m_paths.clear(); + + IN_WRITE_END +} + +void Inotify::WaitForEvents(bool fNoIntr) throw (InotifyException) +{ + ssize_t len = 0; + + do { + len = read(m_fd, m_buf, INOTIFY_BUFLEN); + } while (fNoIntr && len == -1 && errno == EINTR); + + if (len == -1 && !(errno == EWOULDBLOCK || errno == EINTR)) + throw InotifyException(IN_EXC_MSG("reading events failed"), errno, this); + + if (len == -1) + return; + + IN_WRITE_BEGIN + + ssize_t i = 0; + while (i < len) { + struct inotify_event* pEvt = (struct inotify_event*) &m_buf[i]; + InotifyWatch* pW = FindWatch(pEvt->wd); + if (pW != NULL) { + InotifyEvent evt(pEvt, pW); + if ( InotifyEvent::IsType(pW->GetMask(), IN_ONESHOT) + || InotifyEvent::IsType(evt.GetMask(), IN_IGNORED)) + pW->__Disable(); + m_events.push_back(evt); + } + i += INOTIFY_EVENT_SIZE + (ssize_t) pEvt->len; + } + + IN_WRITE_END +} + +bool Inotify::GetEvent(InotifyEvent* pEvt) throw (InotifyException) +{ + if (pEvt == NULL) + throw InotifyException(IN_EXC_MSG("null pointer to event"), EINVAL, this); + + IN_WRITE_BEGIN + + bool b = !m_events.empty(); + if (b) { + *pEvt = m_events.front(); + m_events.pop_front(); + } + + IN_WRITE_END + + return b; +} + +bool Inotify::PeekEvent(InotifyEvent* pEvt) throw (InotifyException) +{ + if (pEvt == NULL) + throw InotifyException(IN_EXC_MSG("null pointer to event"), EINVAL, this); + + IN_READ_BEGIN + + bool b = !m_events.empty(); + if (b) { + *pEvt = m_events.front(); + } + + IN_READ_END + + return b; +} + +InotifyWatch* Inotify::FindWatch(int iDescriptor) +{ + IN_READ_BEGIN + + IN_WATCH_MAP::iterator it = m_watches.find(iDescriptor); + InotifyWatch* pW = it == m_watches.end() ? NULL : (*it).second; + + IN_READ_END + + return pW; +} + +InotifyWatch* Inotify::FindWatch(const std::string& rPath) +{ + IN_READ_BEGIN + + IN_WP_MAP::iterator it = m_paths.find(rPath); + InotifyWatch* pW = it == m_paths.end() ? NULL : (*it).second; + + IN_READ_END + + return pW; +} + +void Inotify::SetNonBlock(bool fNonBlock) throw (InotifyException) +{ + IN_WRITE_BEGIN + + if (m_fd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("invalid file descriptor"), EBUSY, this); + } + + int res = fcntl(m_fd, F_GETFL); + if (res == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("cannot get inotify flags"), errno, this); + } + + if (fNonBlock) { + res |= O_NONBLOCK; + } + else { + res &= ~O_NONBLOCK; + } + + if (fcntl(m_fd, F_SETFL, res) == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("cannot set inotify flags"), errno, this); + } + + IN_WRITE_END +} + +void Inotify::SetCloseOnExec(bool fClOnEx) throw (InotifyException) +{ + IN_WRITE_BEGIN + + if (m_fd == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("invalid file descriptor"), EBUSY, this); + } + + int res = fcntl(m_fd, F_GETFD); + if (res == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("cannot get inotify flags"), errno, this); + } + + if (fClOnEx) { + res |= FD_CLOEXEC; + } + else { + res &= ~FD_CLOEXEC; + } + + if (fcntl(m_fd, F_SETFD, res) == -1) { + IN_WRITE_END_NOTHROW + throw InotifyException(IN_EXC_MSG("cannot set inotify flags"), errno, this); + } + + IN_WRITE_END +} + +uint32_t Inotify::GetCapability(InotifyCapability_t cap) throw (InotifyException) +{ + FILE* f = fopen(GetCapabilityPath(cap).c_str(), "r"); + if (f == NULL) + throw InotifyException(IN_EXC_MSG("cannot get capability"), errno, NULL); + + unsigned int val = 0; + if (fscanf(f, "%u", &val) != 1) { + fclose(f); + throw InotifyException(IN_EXC_MSG("cannot get capability"), EIO, NULL); + } + + fclose(f); + + return (uint32_t) val; +} + +void Inotify::SetCapability(InotifyCapability_t cap, uint32_t val) throw (InotifyException) +{ + FILE* f = fopen(GetCapabilityPath(cap).c_str(), "w"); + if (f == NULL) + throw InotifyException(IN_EXC_MSG("cannot set capability"), errno, NULL); + + if (fprintf(f, "%u", (unsigned int) val) <= 0) { + fclose(f); + throw InotifyException(IN_EXC_MSG("cannot set capability"), EIO, NULL); + } + + fclose(f); +} + +std::string Inotify::GetCapabilityPath(InotifyCapability_t cap) throw (InotifyException) +{ + std::string path(PROCFS_INOTIFY_BASE); + + switch (cap) { + case IN_MAX_EVENTS: + path.append("max_queued_events"); + break; + case IN_MAX_INSTANCES: + path.append("max_user_instances"); + break; + case IN_MAX_WATCHES: + path.append("max_user_watches"); + break; + default: + throw InotifyException(IN_EXC_MSG("unknown capability type"), EINVAL, NULL); + } + + return path; +} + diff --git a/shared/inotify/inotify-cxx.h b/shared/inotify/inotify-cxx.h new file mode 100644 index 00000000..4170972f --- /dev/null +++ b/shared/inotify/inotify-cxx.h @@ -0,0 +1,889 @@ + +/// inotify C++ interface header +/** + * \file inotify-cxx.h + * + * inotify C++ interface + * + * Copyright (C) 2006, 2007 Lukas Jelinek, <lukas@aiken.cz> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of one of the following licenses: + * + * \li 1. X11-style license (see LICENSE-X11) + * \li 2. GNU Lesser General Public License, version 2.1 (see LICENSE-LGPL) + * \li 3. GNU General Public License, version 2 (see LICENSE-GPL) + * + * If you want to help with choosing the best license for you, + * please visit http://www.gnu.org/licenses/license-list.html. + * + */ + + + + + +#ifndef _INOTIFYCXX_H_ +#define _INOTIFYCXX_H_ + +#include <stdint.h> +#include <string> +#include <deque> +#include <map> + +// Please ensure that the following headers take the right place +#include <sys/syscall.h> +#include <sys/inotify.h> + +// Use this if syscalls not defined +#ifndef __NR_inotify_init +#include <sys/inotify-syscalls.h> +#endif // __NR_inotify_init + +/// Event struct size +#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event)) + +/// Event buffer length +#define INOTIFY_BUFLEN (1024 * (INOTIFY_EVENT_SIZE + 16)) + +/// Helper macro for creating exception messages. +/** + * It prepends the message by the function name. + */ +#define IN_EXC_MSG(msg) (std::string(__PRETTY_FUNCTION__) + ": " + msg) + +/// inotify capability/limit identifiers +typedef enum +{ + IN_MAX_EVENTS = 0, ///< max. events in the kernel queue + IN_MAX_INSTANCES = 1, ///< max. inotify file descriptors per process + IN_MAX_WATCHES = 2 ///< max. watches per file descriptor +} InotifyCapability_t; + +/// inotify-cxx thread safety +/** + * If this symbol is defined you can use this interface safely + * threaded applications. Remember that it slightly degrades + * performance. + * + * Even if INOTIFY_THREAD_SAFE is defined some classes stay + * unsafe. If you must use them (must you?) in more than one + * thread concurrently you need to implement explicite locking. + * + * You need not to define INOTIFY_THREAD_SAFE in that cases + * where the application is multithreaded but all the inotify + * infrastructure will be managed only in one thread. This is + * the recommended way. + * + * Locking may fail (it is very rare but not impossible). In this + * case an exception is thrown. But if unlocking fails in case + * of an error it does nothing (this failure is ignored). + */ +#ifdef INOTIFY_THREAD_SAFE + +#include <pthread.h> + +#define IN_LOCK_DECL mutable pthread_rwlock_t __m_lock; + +#define IN_LOCK_INIT \ + { \ + pthread_rwlockattr_t attr; \ + int res = 0; \ + if ((res = pthread_rwlockattr_init(&attr)) != 0) \ + throw InotifyException(IN_EXC_MSG("cannot initialize lock attributes"), res, this); \ + if ((res = pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NP)) != 0) \ + throw InotifyException(IN_EXC_MSG("cannot set lock kind"), res, this); \ + if ((res = pthread_rwlock_init(&__m_lock, &attr)) != 0) \ + throw InotifyException(IN_EXC_MSG("cannot initialize lock"), res, this); \ + pthread_rwlockattr_destroy(&attr); \ + } + +#define IN_LOCK_DONE pthread_rwlock_destroy(&__m_lock); + +#define IN_READ_BEGIN \ + { \ + int res = pthread_rwlock_rdlock(&__m_lock); \ + if (res != 0) \ + throw InotifyException(IN_EXC_MSG("locking for reading failed"), res, (void*) this); \ + } + +#define IN_READ_END \ + { \ + int res = pthread_rwlock_unlock(&__m_lock); \ + if (res != 0) \ + throw InotifyException(IN_EXC_MSG("unlocking failed"), res, (void*) this); \ + } + +#define IN_READ_END_NOTHROW pthread_rwlock_unlock(&__m_lock); + +#define IN_WRITE_BEGIN \ + { \ + int res = pthread_rwlock_wrlock(&__m_lock); \ + if (res != 0) \ + throw InotifyException(IN_EXC_MSG("locking for writing failed"), res, (void*) this); \ + } + +#define IN_WRITE_END IN_READ_END +#define IN_WRITE_END_NOTHROW IN_READ_END_NOTHROW + +#else // INOTIFY_THREAD_SAFE + +#define IN_LOCK_DECL +#define IN_LOCK_INIT +#define IN_LOCK_DONE +#define IN_READ_BEGIN +#define IN_READ_END +#define IN_READ_END_NOTHROW +#define IN_WRITE_BEGIN +#define IN_WRITE_END +#define IN_WRITE_END_NOTHROW + +#endif // INOTIFY_THREAD_SAFE + + + + +// forward declaration +class InotifyWatch; +class Inotify; + + +/// Class for inotify exceptions +/** + * This class allows to acquire information about exceptional + * events. It makes easier to log or display error messages + * and to identify problematic code locations. + * + * Although this class is basically thread-safe it is not intended + * to be shared between threads. + */ +class InotifyException +{ +public: + /// Constructor + /** + * \param[in] rMsg message + * \param[in] iErr error number (see errno.h) + * \param[in] pSrc source + */ + InotifyException(const std::string& rMsg = "", int iErr = 0, void* pSrc = NULL) + : m_msg(rMsg), + m_err(iErr) + { + m_pSrc = pSrc; + } + + /// Returns the exception message. + /** + * \return message + */ + inline const std::string& GetMessage() const + { + return m_msg; + } + + /// Returns the exception error number. + /** + * If not applicable this value is 0 (zero). + * + * \return error number (standardized; see errno.h) + */ + inline int GetErrorNumber() const + { + return m_err; + } + + /// Returns the exception source. + /** + * \return source + */ + inline void* GetSource() const + { + return m_pSrc; + } + +protected: + std::string m_msg; ///< message + int m_err; ///< error number + mutable void* m_pSrc; ///< source +}; + + +/// inotify event class +/** + * It holds all information about inotify event and provides + * access to its particular values. + * + * This class is not (and is not intended to be) thread-safe + * and therefore it must not be used concurrently in multiple + * threads. + */ +class InotifyEvent +{ +public: + /// Constructor. + /** + * Creates a plain event. + */ + InotifyEvent() + : m_uMask(0), + m_uCookie(0) + { + m_pWatch = NULL; + } + + /// Constructor. + /** + * Creates an event based on inotify event data. + * For NULL pointers it works the same way as InotifyEvent(). + * + * \param[in] pEvt event data + * \param[in] pWatch inotify watch + */ + InotifyEvent(const struct inotify_event* pEvt, InotifyWatch* pWatch) + : m_uMask(0), + m_uCookie(0) + { + if (pEvt != NULL) { + m_uMask = (uint32_t) pEvt->mask; + m_uCookie = (uint32_t) pEvt->cookie; + if (pEvt->name != NULL) { + m_name = pEvt->len > 0 + ? pEvt->name + : ""; + } + m_pWatch = pWatch; + } + else { + m_pWatch = NULL; + } + } + + /// Destructor. + ~InotifyEvent() {} + + /// Returns the event watch descriptor. + /** + * \return watch descriptor + * + * \sa InotifyWatch::GetDescriptor() + */ + int32_t GetDescriptor() const; + + /// Returns the event mask. + /** + * \return event mask + * + * \sa InotifyWatch::GetMask() + */ + inline uint32_t GetMask() const + { + return m_uMask; + } + + /// Checks a value for the event type. + /** + * \param[in] uValue checked value + * \param[in] uType type which is checked for + * \return true = the value contains the given type, false = otherwise + */ + inline static bool IsType(uint32_t uValue, uint32_t uType) + { + return ((uValue & uType) != 0) && ((~uValue & uType) == 0); + } + + /// Checks for the event type. + /** + * \param[in] uType type which is checked for + * \return true = event mask contains the given type, false = otherwise + */ + inline bool IsType(uint32_t uType) const + { + return IsType(m_uMask, uType); + } + + /// Returns the event cookie. + /** + * \return event cookie + */ + inline uint32_t GetCookie() const + { + return m_uCookie; + } + + /// Returns the event name length. + /** + * \return event name length + */ + inline uint32_t GetLength() const + { + return (uint32_t) m_name.length(); + } + + /// Returns the event name. + /** + * \return event name + */ + inline const std::string& GetName() const + { + return m_name; + } + + /// Extracts the event name. + /** + * \param[out] rName event name + */ + inline void GetName(std::string& rName) const + { + rName = GetName(); + } + + /// Returns the source watch. + /** + * \return source watch + */ + inline InotifyWatch* GetWatch() + { + return m_pWatch; + } + + /// Finds the appropriate mask for a name. + /** + * \param[in] rName mask name + * \return mask for name; 0 on failure + */ + static uint32_t GetMaskByName(const std::string& rName); + + /// Fills the string with all types contained in an event mask value. + /** + * \param[in] uValue event mask value + * \param[out] rStr dumped event types + */ + static void DumpTypes(uint32_t uValue, std::string& rStr); + + /// Fills the string with all types contained in the event mask. + /** + * \param[out] rStr dumped event types + */ + void DumpTypes(std::string& rStr) const; + +private: + uint32_t m_uMask; ///< mask + uint32_t m_uCookie; ///< cookie + std::string m_name; ///< name + InotifyWatch* m_pWatch; ///< source watch +}; + + + +/// inotify watch class +/** + * It holds information about the inotify watch on a particular + * inode. + * + * If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. + */ +class InotifyWatch +{ +public: + /// Constructor. + /** + * Creates an inotify watch. Because this watch is + * inactive it has an invalid descriptor (-1). + * + * \param[in] rPath watched file path + * \param[in] uMask mask for events + * \param[in] fEnabled events enabled yes/no + */ + InotifyWatch(const std::string& rPath, int32_t uMask, bool fEnabled = true) + : m_path(rPath), + m_uMask(uMask), + m_wd((int32_t) -1), + m_fEnabled(fEnabled) + { + IN_LOCK_INIT + } + + /// Destructor. + ~InotifyWatch() + { + IN_LOCK_DONE + } + + /// Returns the watch descriptor. + /** + * \return watch descriptor; -1 for inactive watch + */ + inline int32_t GetDescriptor() const + { + return m_wd; + } + + /// Returns the watched file path. + /** + * \return file path + */ + inline const std::string& GetPath() const + { + return m_path; + } + + /// Returns the watch event mask. + /** + * \return event mask + */ + inline uint32_t GetMask() const + { + return (uint32_t) m_uMask; + } + + /// Sets the watch event mask. + /** + * If the watch is active (added to an instance of Inotify) + * this method may fail due to unsuccessful re-setting + * the watch in the kernel. + * + * \param[in] uMask event mask + * + * \throw InotifyException thrown if changing fails + */ + void SetMask(uint32_t uMask) throw (InotifyException); + + /// Returns the appropriate inotify class instance. + /** + * \return inotify instance + */ + inline Inotify* GetInotify() + { + return m_pInotify; + } + + /// Enables/disables the watch. + /** + * If the watch is active (added to an instance of Inotify) + * this method may fail due to unsuccessful re-setting + * the watch in the kernel. + * + * Re-setting the current state has no effect. + * + * \param[in] fEnabled set enabled yes/no + * + * \throw InotifyException thrown if enabling/disabling fails + */ + void SetEnabled(bool fEnabled) throw (InotifyException); + + /// Checks whether the watch is enabled. + /** + * \return true = enables, false = disabled + */ + inline bool IsEnabled() const + { + return m_fEnabled; + } + + /// Checks whether the watch is recursive. + /** + * A recursive watch monitors a directory itself and all + * its subdirectories. This watch is a logical object + * which may have many underlying kernel watches. + * + * \return currently always false (recursive watches not yet supported) + * \attention Recursive watches are currently NOT supported. + * They are planned for future versions. + */ + inline bool IsRecursive() const + { + return false; + } + +private: + friend class Inotify; + + std::string m_path; ///< watched file path + uint32_t m_uMask; ///< event mask + int32_t m_wd; ///< watch descriptor + Inotify* m_pInotify; ///< inotify object + bool m_fEnabled; ///< events enabled yes/no + + IN_LOCK_DECL + + /// Disables the watch (due to removing by the kernel). + /** + * This method must be called after receiving an event. + * It ensures the watch object is consistent with the kernel + * data. + */ + void __Disable(); +}; + + +/// Mapping from watch descriptors to watch objects. +typedef std::map<int32_t, InotifyWatch*> IN_WATCH_MAP; + +/// Mapping from paths to watch objects. +typedef std::map<std::string, InotifyWatch*> IN_WP_MAP; + + +/// inotify class +/** + * It holds information about the inotify device descriptor + * and manages the event queue. + * + * If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. + */ +class Inotify +{ +public: + /// Constructor. + /** + * Creates and initializes an instance of inotify communication + * object (opens the inotify device). + * + * \throw InotifyException thrown if inotify isn't available + */ + Inotify() throw (InotifyException); + + /// Destructor. + /** + * Calls Close() due to clean-up. + */ + ~Inotify(); + + /// Removes all watches and closes the inotify device. + void Close(); + + /// Adds a new watch. + /** + * \param[in] pWatch inotify watch + * + * \throw InotifyException thrown if adding failed + */ + void Add(InotifyWatch* pWatch) throw (InotifyException); + + /// Adds a new watch. + /** + * \param[in] rWatch inotify watch + * + * \throw InotifyException thrown if adding failed + */ + inline void Add(InotifyWatch& rWatch) throw (InotifyException) + { + Add(&rWatch); + } + + /// Removes a watch. + /** + * If the given watch is not present it does nothing. + * + * \param[in] pWatch inotify watch + * + * \throw InotifyException thrown if removing failed + */ + void Remove(InotifyWatch* pWatch) throw (InotifyException); + + /// Removes a watch. + /** + * If the given watch is not present it does nothing. + * + * \param[in] rWatch inotify watch + * + * \throw InotifyException thrown if removing failed + */ + inline void Remove(InotifyWatch& rWatch) throw (InotifyException) + { + Remove(&rWatch); + } + + /// Removes all watches. + void RemoveAll(); + + /// Returns the count of watches. + /** + * This is the total count of all watches (regardless whether + * enabled or not). + * + * \return count of watches + * + * \sa GetEnabledCount() + */ + inline size_t GetWatchCount() const + { + IN_READ_BEGIN + size_t n = (size_t) m_paths.size(); + IN_READ_END + return n; + } + + /// Returns the count of enabled watches. + /** + * \return count of enabled watches + * + * \sa GetWatchCount() + */ + inline size_t GetEnabledCount() const + { + IN_READ_BEGIN + size_t n = (size_t) m_watches.size(); + IN_READ_END + return n; + } + + /// Waits for inotify events. + /** + * It waits until one or more events occur. When called + * in nonblocking mode it only retrieves occurred events + * to the internal queue and exits. + * + * \param[in] fNoIntr if true it re-calls the system call after a handled signal + * + * \throw InotifyException thrown if reading events failed + * + * \sa SetNonBlock() + */ + void WaitForEvents(bool fNoIntr = false) throw (InotifyException); + + /// Returns the count of received and queued events. + /** + * This number is related to the events in the queue inside + * this object, not to the events pending in the kernel. + * + * \return count of events + */ + inline size_t GetEventCount() + { + IN_READ_BEGIN + size_t n = (size_t) m_events.size(); + IN_READ_END + return n; + } + + /// Extracts a queued inotify event. + /** + * The extracted event is removed from the queue. + * If the pointer is NULL it does nothing. + * + * \param[in,out] pEvt event object + * + * \throw InotifyException thrown if the provided pointer is NULL + */ + bool GetEvent(InotifyEvent* pEvt) throw (InotifyException); + + /// Extracts a queued inotify event. + /** + * The extracted event is removed from the queue. + * + * \param[in,out] rEvt event object + * + * \throw InotifyException thrown only in very anomalous cases + */ + bool GetEvent(InotifyEvent& rEvt) throw (InotifyException) + { + return GetEvent(&rEvt); + } + + /// Extracts a queued inotify event (without removing). + /** + * The extracted event stays in the queue. + * If the pointer is NULL it does nothing. + * + * \param[in,out] pEvt event object + * + * \throw InotifyException thrown if the provided pointer is NULL + */ + bool PeekEvent(InotifyEvent* pEvt) throw (InotifyException); + + /// Extracts a queued inotify event (without removing). + /** + * The extracted event stays in the queue. + * + * \param[in,out] rEvt event object + * + * \throw InotifyException thrown only in very anomalous cases + */ + bool PeekEvent(InotifyEvent& rEvt) throw (InotifyException) + { + return PeekEvent(&rEvt); + } + + /// Searches for a watch by a watch descriptor. + /** + * It tries to find a watch by the given descriptor. + * + * \param[in] iDescriptor watch descriptor + * \return pointer to a watch; NULL if no such watch exists + */ + InotifyWatch* FindWatch(int iDescriptor); + + /// Searches for a watch by a filesystem path. + /** + * It tries to find a watch by the given filesystem path. + * + * \param[in] rPath filesystem path + * \return pointer to a watch; NULL if no such watch exists + * + * \attention The path must be exactly identical to the one + * used for the searched watch. Be careful about + * absolute/relative and case-insensitive paths. + */ + InotifyWatch* FindWatch(const std::string& rPath); + + /// Returns the file descriptor. + /** + * The descriptor can be used in standard low-level file + * functions (poll(), select(), fcntl() etc.). + * + * \return valid file descriptor or -1 for inactive object + * + * \sa SetNonBlock() + */ + inline int GetDescriptor() const + { + return m_fd; + } + + /// Enables/disables non-blocking mode. + /** + * Use this mode if you want to monitor the descriptor + * (acquired thru GetDescriptor()) in functions such as + * poll(), select() etc. + * + * Non-blocking mode is disabled by default. + * + * \param[in] fNonBlock enable/disable non-blocking mode + * + * \throw InotifyException thrown if setting mode failed + * + * \sa GetDescriptor(), SetCloseOnExec() + */ + void SetNonBlock(bool fNonBlock) throw (InotifyException); + + /// Enables/disables closing on exec. + /** + * Enable this if you want to close the descriptor when + * executing another program. Otherwise, the descriptor + * will be inherited. + * + * Closing on exec is disabled by default. + * + * \param[in] fClOnEx enable/disable closing on exec + * + * \throw InotifyException thrown if setting failed + * + * \sa GetDescriptor(), SetNonBlock() + */ + void SetCloseOnExec(bool fClOnEx) throw (InotifyException); + + /// Acquires a particular inotify capability/limit. + /** + * \param[in] cap capability/limit identifier + * \return capability/limit value + * \throw InotifyException thrown if the given value cannot be acquired + */ + static uint32_t GetCapability(InotifyCapability_t cap) throw (InotifyException); + + /// Modifies a particular inotify capability/limit. + /** + * \param[in] cap capability/limit identifier + * \param[in] val new capability/limit value + * \throw InotifyException thrown if the given value cannot be set + * \attention Using this function requires root privileges. + * Beware of setting extensive values - it may seriously + * affect system performance and/or stability. + */ + static void SetCapability(InotifyCapability_t cap, uint32_t val) throw (InotifyException); + + /// Returns the maximum number of events in the kernel queue. + /** + * \return maximum number of events in the kernel queue + * \throw InotifyException thrown if the given value cannot be acquired + */ + inline static uint32_t GetMaxEvents() throw (InotifyException) + { + return GetCapability(IN_MAX_EVENTS); + } + + /// Sets the maximum number of events in the kernel queue. + /** + * \param[in] val new value + * \throw InotifyException thrown if the given value cannot be set + * \attention Using this function requires root privileges. + * Beware of setting extensive values - the greater value + * is set here the more physical memory may be used for the inotify + * infrastructure. + */ + inline static void SetMaxEvents(uint32_t val) throw (InotifyException) + { + SetCapability(IN_MAX_EVENTS, val); + } + + /// Returns the maximum number of inotify instances per process. + /** + * It means the maximum number of open inotify file descriptors + * per running process. + * + * \return maximum number of inotify instances + * \throw InotifyException thrown if the given value cannot be acquired + */ + inline static uint32_t GetMaxInstances() throw (InotifyException) + { + return GetCapability(IN_MAX_INSTANCES); + } + + /// Sets the maximum number of inotify instances per process. + /** + * \param[in] val new value + * \throw InotifyException thrown if the given value cannot be set + * \attention Using this function requires root privileges. + * Beware of setting extensive values - the greater value + * is set here the more physical memory may be used for the inotify + * infrastructure. + */ + inline static void SetMaxInstances(uint32_t val) throw (InotifyException) + { + SetCapability(IN_MAX_INSTANCES, val); + } + + /// Returns the maximum number of inotify watches per instance. + /** + * It means the maximum number of inotify watches per inotify + * file descriptor. + * + * \return maximum number of inotify watches + * \throw InotifyException thrown if the given value cannot be acquired + */ + inline static uint32_t GetMaxWatches() throw (InotifyException) + { + return GetCapability(IN_MAX_WATCHES); + } + + /// Sets the maximum number of inotify watches per instance. + /** + * \param[in] val new value + * \throw InotifyException thrown if the given value cannot be set + * \attention Using this function requires root privileges. + * Beware of setting extensive values - the greater value + * is set here the more physical memory may be used for the inotify + * infrastructure. + */ + inline static void SetMaxWatches(uint32_t val) throw (InotifyException) + { + SetCapability(IN_MAX_WATCHES, val); + } + +private: + int m_fd; ///< file descriptor + IN_WATCH_MAP m_watches; ///< watches (by descriptors) + IN_WP_MAP m_paths; ///< watches (by paths) + unsigned char m_buf[INOTIFY_BUFLEN]; ///< buffer for events + std::deque<InotifyEvent> m_events; ///< event queue + + IN_LOCK_DECL + + friend class InotifyWatch; + + static std::string GetCapabilityPath(InotifyCapability_t cap) throw (InotifyException); +}; + + +#endif //_INOTIFYCXX_H_ + diff --git a/shared/localization.cpp b/shared/localization.cpp new file mode 100644 index 00000000..56afd20d --- /dev/null +++ b/shared/localization.cpp @@ -0,0 +1,405 @@ +#include "localization.h" +#include <wx/msgdlg.h> +#include "../shared/standardPaths.h" +#include "../shared/globalFunctions.h" +#include <fstream> +#include <map> +#include <wx/ffile.h> + +using FreeFileSync::CustomLocale; +using FreeFileSync::LocalizationInfo; + +//_("Browse") <- dummy string for wxDirPickerCtrl to be recognized by automatic text extraction! + + +//these two global variables are language-dependent => cannot be set constant! See CustomLocale +const wxChar* FreeFileSync::THOUSANDS_SEPARATOR = wxEmptyString; +const wxChar* FreeFileSync::DECIMAL_POINT = wxEmptyString; + + +const std::vector<FreeFileSync::LocInfoLine>& LocalizationInfo::getMapping() +{ + static LocalizationInfo instance; + return instance.locMapping; +} + + +LocalizationInfo::LocalizationInfo() +{ + FreeFileSync::LocInfoLine newEntry; + + newEntry.languageID = wxLANGUAGE_CZECH; + newEntry.languageName = wxT("ÄŒeÅ¡tina"); + newEntry.languageFile = wxT("czech.lng"); + newEntry.translatorName = wxT("ViCi"); + newEntry.languageFlag = wxT("czechRep.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_GERMAN; + newEntry.languageName = wxT("Deutsch"); + newEntry.languageFile = wxT("german.lng"); + newEntry.translatorName = wxT("ZenJu"); + newEntry.languageFlag = wxT("germany.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_ENGLISH; + newEntry.languageName = wxT("English"); + newEntry.languageFile = wxT(""); + newEntry.translatorName = wxT("ZenJu"); + newEntry.languageFlag = wxT("england.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_SPANISH; + newEntry.languageName = wxT("Español"); + newEntry.languageFile = wxT("spanish.lng"); + newEntry.translatorName = wxT("David RodrÃguez"); + newEntry.languageFlag = wxT("spain.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_FRENCH; + newEntry.languageName = wxT("Français"); + newEntry.languageFile = wxT("french.lng"); + newEntry.translatorName = wxT("Jean-François Hartmann"); + newEntry.languageFlag = wxT("france.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_ITALIAN; + newEntry.languageName = wxT("Italiano"); + newEntry.languageFile = wxT("italian.lng"); + newEntry.translatorName = wxT("Emmo"); + newEntry.languageFlag = wxT("italy.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_HUNGARIAN; + newEntry.languageName = wxT("Magyar"); + newEntry.languageFile = wxT("hungarian.lng"); + newEntry.translatorName = wxT("Demon"); + newEntry.languageFlag = wxT("hungary.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_DUTCH; + newEntry.languageName = wxT("Nederlands"); + newEntry.languageFile = wxT("dutch.lng"); + newEntry.translatorName = wxT("M.D. Vrakking"); + newEntry.languageFlag = wxT("holland.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_RUSSIAN; + newEntry.languageName = wxT("PуÑÑкий"); + newEntry.languageFile = wxT("russian.lng"); + newEntry.translatorName = wxT("Fayullin T.N. aka Svobodniy"); + newEntry.languageFlag = wxT("russia.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_POLISH; + newEntry.languageName = wxT("Polski"); + newEntry.languageFile = wxT("polish.lng"); + newEntry.translatorName = wxT("Wojtek Pietruszewski"); + newEntry.languageFlag = wxT("poland.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_PORTUGUESE; + newEntry.languageName = wxT("Português"); + newEntry.languageFile = wxT("portuguese.lng"); + newEntry.translatorName = wxT("QuestMark"); + newEntry.languageFlag = wxT("portugal.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_PORTUGUESE_BRAZILIAN; + newEntry.languageName = wxT("Português do Brasil"); + newEntry.languageFile = wxT("portuguese_br.lng"); + newEntry.translatorName = wxT("Edison Aranha"); + newEntry.languageFlag = wxT("brazil.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_SLOVENIAN; + newEntry.languageName = wxT("SlovenÅ¡Äina"); + newEntry.languageFile = wxT("slovenian.lng"); + newEntry.translatorName = wxT("Matej Badalic"); + newEntry.languageFlag = wxT("slovakia.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_JAPANESE; + newEntry.languageName = wxT("日本語"); + newEntry.languageFile = wxT("japanese.lng"); + newEntry.translatorName = wxT("Tilt"); + newEntry.languageFlag = wxT("japan.png"); + locMapping.push_back(newEntry); + + newEntry.languageID = wxLANGUAGE_CHINESE_SIMPLIFIED; + newEntry.languageName = wxT("简体ä¸æ–‡"); + newEntry.languageFile = wxT("chinese_simple.lng"); + newEntry.translatorName = wxT("CyberCowBoy"); + newEntry.languageFlag = wxT("china.png"); + locMapping.push_back(newEntry); +} + + +int mapLanguageDialect(const int language) +{ + switch (language) //map language dialects + { + //variants of wxLANGUAGE_GERMAN + case wxLANGUAGE_GERMAN_AUSTRIAN: + case wxLANGUAGE_GERMAN_BELGIUM: + case wxLANGUAGE_GERMAN_LIECHTENSTEIN: + case wxLANGUAGE_GERMAN_LUXEMBOURG: + case wxLANGUAGE_GERMAN_SWISS: + return wxLANGUAGE_GERMAN; + + //variants of wxLANGUAGE_FRENCH + case wxLANGUAGE_FRENCH_BELGIAN: + case wxLANGUAGE_FRENCH_CANADIAN: + case wxLANGUAGE_FRENCH_LUXEMBOURG: + case wxLANGUAGE_FRENCH_MONACO: + case wxLANGUAGE_FRENCH_SWISS: + return wxLANGUAGE_FRENCH; + + //variants of wxLANGUAGE_DUTCH + case wxLANGUAGE_DUTCH_BELGIAN: + return wxLANGUAGE_DUTCH; + + //variants of wxLANGUAGE_ITALIAN + case wxLANGUAGE_ITALIAN_SWISS: + return wxLANGUAGE_ITALIAN; + + //variants of wxLANGUAGE_CHINESE_SIMPLIFIED + case wxLANGUAGE_CHINESE: + case wxLANGUAGE_CHINESE_TRADITIONAL: + case wxLANGUAGE_CHINESE_HONGKONG: + case wxLANGUAGE_CHINESE_MACAU: + case wxLANGUAGE_CHINESE_SINGAPORE: + case wxLANGUAGE_CHINESE_TAIWAN: + return wxLANGUAGE_CHINESE_SIMPLIFIED; + + //variants of wxLANGUAGE_RUSSIAN + case wxLANGUAGE_RUSSIAN_UKRAINE: + return wxLANGUAGE_RUSSIAN; + + //variants of wxLANGUAGE_SPANISH + case wxLANGUAGE_SPANISH_ARGENTINA: + case wxLANGUAGE_SPANISH_BOLIVIA: + case wxLANGUAGE_SPANISH_CHILE: + case wxLANGUAGE_SPANISH_COLOMBIA: + case wxLANGUAGE_SPANISH_COSTA_RICA: + case wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC: + case wxLANGUAGE_SPANISH_ECUADOR: + case wxLANGUAGE_SPANISH_EL_SALVADOR: + case wxLANGUAGE_SPANISH_GUATEMALA: + case wxLANGUAGE_SPANISH_HONDURAS: + case wxLANGUAGE_SPANISH_MEXICAN: + case wxLANGUAGE_SPANISH_MODERN: + case wxLANGUAGE_SPANISH_NICARAGUA: + case wxLANGUAGE_SPANISH_PANAMA: + case wxLANGUAGE_SPANISH_PARAGUAY: + case wxLANGUAGE_SPANISH_PERU: + case wxLANGUAGE_SPANISH_PUERTO_RICO: + case wxLANGUAGE_SPANISH_URUGUAY: + case wxLANGUAGE_SPANISH_US: + case wxLANGUAGE_SPANISH_VENEZUELA: + return wxLANGUAGE_SPANISH; + + //case wxLANGUAGE_CZECH: + //case wxLANGUAGE_JAPANESE: + //case wxLANGUAGE_POLISH: + //case wxLANGUAGE_SLOVENIAN: + //case wxLANGUAGE_HUNGARIAN: + //case wxLANGUAGE_PORTUGUESE: + //case wxLANGUAGE_PORTUGUESE_BRAZILIAN: + + default: + return language; + } +} + + +typedef wxString TextOriginal; +typedef wxString TextTranslation; + +class Translation : public std::map<TextOriginal, TextTranslation> {}; + + +CustomLocale& CustomLocale::getInstance() +{ + static CustomLocale instance; + return instance; +} + + +CustomLocale::CustomLocale() : + wxLocale(wxLocale::GetSystemLanguage()), //wxLocale is a static object too => can be initialized just once + translationDB(new Translation), + currentLanguage(wxLANGUAGE_ENGLISH) {} + + +inline +void exchangeEscapeChars(wxString& data) +{ + wxString output; + + const wxChar* input = data.c_str(); + + wxChar value; + while ((value = *input) != wxChar(0)) + { + //read backslash + if (value == wxChar('\\')) + { + //read next character + ++input; + if ((value = *input) == wxChar(0)) + break; + + switch (value) + { + case wxChar('\\'): + output += wxChar('\\'); + break; + case wxChar('n'): + output += wxChar('\n'); + break; + case wxChar('t'): + output += wxChar('\t'); + break; + case wxChar('\"'): + output += wxChar('\"'); + break; + default: + output += value; + } + } + else + output += value; + + ++input; + } + data = output; +} + + +class UnicodeFileReader +{ +public: + UnicodeFileReader(const wxString& filename) : + inputFile(NULL) + { + //workaround to get a FILE* from a unicode filename + wxFFile dummyFile(filename, wxT("rb")); + if (dummyFile.IsOpened()) + { + inputFile = dummyFile.fp(); + dummyFile.Detach(); + } + } + + ~UnicodeFileReader() + { + if (inputFile != NULL) + fclose(inputFile); + } + + bool isOkay() + { + return inputFile != NULL; + } + + bool getNextLine(wxString& line) + { + std::string output; + + while (true) + { + const int c = fgetc(inputFile); + if (c == EOF) + return false; + else if (c == 0xD) + { + //Delimiter: + //---------- + //Linux: 0xA \n + //Mac: 0xD \r + //Win: 0xD 0xA \r\n <- language files are in Windows format + + fgetc(inputFile); //discard the 0xA character + + line = wxString::FromUTF8(output.c_str(), output.length()); + return true; + } + output += static_cast<char>(c); + } + } + +private: + FILE* inputFile; +}; + + +void CustomLocale::setLanguage(const int language) +{ + currentLanguage = language; + + //default: english + wxString languageFile; + + //(try to) retrieve language filename + const int mappedLanguage = mapLanguageDialect(language); + for (std::vector<LocInfoLine>::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) + if (i->languageID == mappedLanguage) + { + languageFile = i->languageFile; + break; + } + + //load language file into buffer + translationDB->clear(); + if (!languageFile.empty()) + { + UnicodeFileReader langFile(FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + + wxT("Languages") + globalFunctions::FILE_NAME_SEPARATOR + languageFile); + if (langFile.isOkay()) + { + int rowNumber = 0; + wxString original; + wxString tmpString; + while (langFile.getNextLine(tmpString)) + { + exchangeEscapeChars(tmpString); + + if (rowNumber % 2 == 0) + original = tmpString; + else + { + const wxString& translation = tmpString; + + if (!translation.empty()) + translationDB->insert(std::pair<TextOriginal, TextTranslation>(original, translation)); + } + + ++rowNumber; + } + } + else + wxMessageBox(wxString(_("Error reading file:")) + wxT(" \"") + languageFile + wxT("\""), _("Error"), wxOK | wxICON_ERROR); + } + else + ; //if languageFile is empty texts will be english per default + + //these global variables (logical const) need to be redetermined on language selection + FreeFileSync::THOUSANDS_SEPARATOR = _(","); + FreeFileSync::DECIMAL_POINT = _("."); + + //static const wxString dummy1 = std::use_facet<std::numpunct<wchar_t> >(std::locale("")).decimal_point(); + //static const wxString dummy2 = std::use_facet<std::numpunct<wchar_t> >(std::locale("")).thousands_sep(); +} + + +const wxChar* CustomLocale::GetString(const wxChar* szOrigString, const wxChar* szDomain) const +{ + //look for translation in buffer table + const Translation::const_iterator i = translationDB->find(szOrigString); + if (i != translationDB->end()) + return i->second.c_str(); + + //fallback + return szOrigString; +} diff --git a/shared/localization.h b/shared/localization.h new file mode 100644 index 00000000..2a5ee80d --- /dev/null +++ b/shared/localization.h @@ -0,0 +1,62 @@ +#ifndef MISC_H_INCLUDED +#define MISC_H_INCLUDED + +#include <wx/intl.h> +#include <vector> +#include <memory> + +class Translation; + + +namespace FreeFileSync +{ + //language dependent global variables: need to be initialized by CustomLocale on program startup and language switch + + extern const wxChar* THOUSANDS_SEPARATOR; + extern const wxChar* DECIMAL_POINT; + + + struct LocInfoLine + { + int languageID; + wxString languageName; + wxString languageFile; + wxString translatorName; + wxString languageFlag; + }; + + class LocalizationInfo + { + public: + static const std::vector<LocInfoLine>& getMapping(); + + private: + LocalizationInfo(); + + std::vector<LocInfoLine> locMapping; + }; + + + class CustomLocale : public wxLocale + { + public: + static CustomLocale& getInstance(); + + void setLanguage(const int language); + + int getLanguage() const + { + return currentLanguage; + } + + virtual const wxChar* GetString(const wxChar* szOrigString, const wxChar* szDomain = NULL) const; + + private: + CustomLocale(); + + std::auto_ptr<Translation> translationDB; + int currentLanguage; + }; +} + +#endif // MISC_H_INCLUDED diff --git a/shared/shadow.cpp b/shared/shadow.cpp new file mode 100644 index 00000000..abdca1a9 --- /dev/null +++ b/shared/shadow.cpp @@ -0,0 +1,158 @@ +#include "shadow.h" +#include <wx/msw/wrapwin.h> //includes "windows.h" +#include <wx/intl.h> +#include "globalfunctions.h" + +using FreeFileSync::ShadowCopy; + + +class ShadowlDllHandler //dynamically load windows API functions +{ + typedef bool (*CreateShadowCopyFct)( //volumeName must end with "\", while shadowVolName does not end with "\" + const wchar_t* volumeName, + wchar_t* shadowVolName, + unsigned int shadowBufferLen, + void** backupHandle, + wchar_t* errorMessage, + unsigned int errorBufferLen); + + typedef void (*ReleaseShadowCopyFct)(void* backupHandle); + +public: + static const ShadowlDllHandler& getInstance() + { + static ShadowlDllHandler instance; + return instance; + } + + CreateShadowCopyFct createShadowCopy; + ReleaseShadowCopyFct releaseShadowCopy; + +private: + ShadowlDllHandler() : + createShadowCopy(NULL), + releaseShadowCopy(NULL), + hShadow(NULL) + { + //get a handle to the DLL module containing the required functionality + hShadow = ::LoadLibrary(L"Shadow.dll"); + if (hShadow) + { + createShadowCopy = reinterpret_cast<CreateShadowCopyFct>(::GetProcAddress(hShadow, "createShadowCopy")); + releaseShadowCopy = reinterpret_cast<ReleaseShadowCopyFct>(::GetProcAddress(hShadow, "releaseShadowCopy")); + } + } + + ~ShadowlDllHandler() + { + if (hShadow) ::FreeLibrary(hShadow); + } + + HINSTANCE hShadow; +}; + + +ShadowCopy::ShadowCopy() : + backupHandle(NULL) {} + + +ShadowCopy::~ShadowCopy() +{ + if (backupHandle != NULL) + ShadowlDllHandler::getInstance().releaseShadowCopy(backupHandle); +} + + +bool ShadowCopy::isOkay() +{ + //check that all functions could be loaded + return ShadowlDllHandler::getInstance().createShadowCopy != NULL && + ShadowlDllHandler::getInstance().releaseShadowCopy != NULL; +} + + +Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile) +{ + //check if shadow copy dll was loaded correctly + if (!isOkay()) + { + wxString errorMsg = _("Error copying locked file %x!"); + errorMsg.Replace(wxT("%x"), wxString(wxT("\"")) + inputFile.c_str() + wxT("\"")); + throw FileError(errorMsg + wxT("\n\n") + _("Error starting Volume Shadow Copy Service!") + wxT("\n") + + _("Please copy the appropriate \"Shadow.dll\" (located in \"Shadow.zip\" archive) into the FreeFileSync installation directory to enable this feature.")); + } + + + wchar_t volumeNameRaw[1000]; + + if (!GetVolumePathName(inputFile.c_str(), //__in LPCTSTR lpszFileName, + volumeNameRaw, //__out LPTSTR lpszVolumePathName, + 1000)) //__in DWORD cchBufferLength + { + wxString errorMsg = _("Error copying locked file %x!"); + errorMsg.Replace(wxT("%x"), wxString(wxT("\"")) + inputFile.c_str() + wxT("\"")); + throw FileError(errorMsg + wxT("\n\n") + _("Could not determine volume name for file:") + wxT("\n\"") + inputFile.c_str() + wxT("\"")); + } + + Zstring volumeNameFormatted = volumeNameRaw; + if (!volumeNameFormatted.EndsWith(globalFunctions::FILE_NAME_SEPARATOR)) + volumeNameFormatted += globalFunctions::FILE_NAME_SEPARATOR; + + if (volumeNameFormatted != realVolumeLast) + { + //release old shadow copy + if (backupHandle != NULL) + { + ShadowlDllHandler::getInstance().releaseShadowCopy(backupHandle); + backupHandle = NULL; + } + realVolumeLast.clear(); //...if next call fails... + shadowVolumeLast.clear(); //...if next call fails... + + //start shadow volume copy service: + wchar_t shadowVolName[1000]; + void* backupHandleTmp = NULL; + wchar_t errorMessage[1000]; + + if (!ShadowlDllHandler::getInstance().createShadowCopy( + volumeNameFormatted.c_str(), + shadowVolName, + 1000, + &backupHandleTmp, + errorMessage, + 1000)) + { + wxString errorMsg = _("Error copying locked file %x!"); + errorMsg.Replace(wxT("%x"), Zstring(wxT("\"")) + inputFile + wxT("\"")); + throw FileError(errorMsg + wxT("\n\n") + _("Error starting Volume Shadow Copy Service!") + wxT("\n") + + wxT("(") + errorMessage + wxT(")")); + } + + realVolumeLast = volumeNameFormatted; + shadowVolumeLast = Zstring(shadowVolName) + globalFunctions::FILE_NAME_SEPARATOR; //shadowVolName NEVER has a trailing backslash + backupHandle = backupHandleTmp; + } + + const size_t pos = inputFile.find(volumeNameFormatted); + if (pos == Zstring::npos) + { + wxString errorMsg = _("Error copying locked file %x!"); + errorMsg.Replace(wxT("%x"), Zstring(wxT("\"")) + inputFile + wxT("\"")); + + wxString msg = _("Volume name %x not part of filename %y!"); + msg.Replace(wxT("%x"), wxString(wxT("\"")) + volumeNameFormatted.c_str() + wxT("\""), false); + msg.Replace(wxT("%y"), wxString(wxT("\"")) + inputFile.c_str() + wxT("\""), false); + throw FileError(errorMsg + wxT("\n\n") + msg); + } + //return filename alias on shadow copy volume + return shadowVolumeLast + Zstring(inputFile.c_str() + pos + volumeNameFormatted.length()); +} + + + + + + + + + diff --git a/shared/shadow.h b/shared/shadow.h new file mode 100644 index 00000000..15fd4d9d --- /dev/null +++ b/shared/shadow.h @@ -0,0 +1,31 @@ +#ifndef SHADOW_H_INCLUDED +#define SHADOW_H_INCLUDED + +#ifndef FFS_WIN +header should be used in the windows build only! +#endif + +#include "zstring.h" +#include "fileError.h" + + +namespace FreeFileSync +{ + class ShadowCopy //buffer access to Windows Volume Shadow Copy Service + { + public: + ShadowCopy(); + ~ShadowCopy(); + + Zstring makeShadowCopy(const Zstring& inputFile); //throw(FileError); returns filename on shadow copy + + private: + bool isOkay(); + + Zstring realVolumeLast; //buffer last volume name + Zstring shadowVolumeLast; //buffer last created shadow volume + void* backupHandle; + }; +} + +#endif // SHADOW_H_INCLUDED diff --git a/shared/standardPaths.cpp b/shared/standardPaths.cpp new file mode 100644 index 00000000..0c333598 --- /dev/null +++ b/shared/standardPaths.cpp @@ -0,0 +1,60 @@ +#include "standardPaths.h" +#include <wx/stdpaths.h> +#include "globalFunctions.h" +#include <wx/filename.h> + + +wxString assembleFileForUserData(const wxString fileName) +{ + static const bool isPortableVersion = !wxFileExists(FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("uninstall.exe")); //this check is a bit lame... + + if (isPortableVersion) //use same directory as executable + return FreeFileSync::getInstallationDir() + globalFunctions::FILE_NAME_SEPARATOR + fileName; + else //usen OS' standard paths + { + wxString userDirectory = wxStandardPathsBase::Get().GetUserDataDir(); + + if (!userDirectory.EndsWith(wxString(globalFunctions::FILE_NAME_SEPARATOR))) + userDirectory += globalFunctions::FILE_NAME_SEPARATOR; + + if (!wxDirExists(userDirectory)) + ::wxMkdir(userDirectory); //only top directory needs to be created: no recursion necessary + + return userDirectory + fileName; + } +} + + +const wxString& FreeFileSync::getGlobalConfigFile() +{ + static wxString instance = assembleFileForUserData(wxT("GlobalSettings.xml")); + return instance; +} + + +const wxString& FreeFileSync::getDefaultLogDirectory() +{ + static wxString instance = assembleFileForUserData(wxT("Logs")); + return instance; +} + + +const wxString& FreeFileSync::getLastErrorTxtFile() +{ + static wxString instance = assembleFileForUserData(wxT("LastError.txt")); + return instance; +} + + +const wxString& FreeFileSync::getInstallationDir() +{ + static wxString instance = wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath(); + return instance; +} + + +const wxString& FreeFileSync::getConfigDir() +{ + static wxString instance = assembleFileForUserData(wxEmptyString); + return instance; +} diff --git a/shared/standardPaths.h b/shared/standardPaths.h new file mode 100644 index 00000000..64811246 --- /dev/null +++ b/shared/standardPaths.h @@ -0,0 +1,20 @@ +#ifndef STANDARDPATHS_H_INCLUDED +#define STANDARDPATHS_H_INCLUDED + +#include <wx/string.h> + + +namespace FreeFileSync +{ +//------------------------------------------------------------------------------ +//global functions +//------------------------------------------------------------------------------ + const wxString& getGlobalConfigFile(); + const wxString& getDefaultLogDirectory(); + const wxString& getLastErrorTxtFile(); + const wxString& getInstallationDir(); //FreeFileSync installation directory without path separator + const wxString& getConfigDir(); +//------------------------------------------------------------------------------ +} + +#endif // STANDARDPATHS_H_INCLUDED diff --git a/shared/staticAssert.h b/shared/staticAssert.h new file mode 100644 index 00000000..2be4cd58 --- /dev/null +++ b/shared/staticAssert.h @@ -0,0 +1,18 @@ +#ifndef STATICASSERT_H_INCLUDED +#define STATICASSERT_H_INCLUDED + +//Reference: Compile-Time Assertions, C/C++ Users Journal November, 2004 (http://pera-software.com/articles/compile-time-assertions.pdf) + +#ifdef NDEBUG +//If not debugging, assert does nothing. +#define assert_static(x) ((void)0) + +#else /* debugging enabled */ + +#define assert_static(e) \ +do { \ +enum { assert_static__ = 1/(e) }; \ +} while (0) +#endif + +#endif // STATICASSERT_H_INCLUDED diff --git a/shared/systemFunctions.cpp b/shared/systemFunctions.cpp new file mode 100644 index 00000000..4fd17fc1 --- /dev/null +++ b/shared/systemFunctions.cpp @@ -0,0 +1,37 @@ +#include "systemFunctions.h" + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" + +#elif defined FFS_LINUX +#include <string.h> +#include <errno.h> +#endif + + + +#ifdef FFS_WIN +wxString FreeFileSync::getLastErrorFormatted(const unsigned long lastError) //try to get additional Windows error information +{ + //determine error code if none was specified + const unsigned long lastErrorCode = lastError == 0 ? ::GetLastError() : lastError; + + wxString output = wxString(wxT("Windows Error Code ")) + wxString::Format(wxT("%u"), lastErrorCode); + + WCHAR buffer[1001]; + if (::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK, 0, lastErrorCode, 0, buffer, 1001, NULL) != 0) + output += wxString(wxT(": ")) + buffer; + return output; +} + +#elif defined FFS_LINUX +wxString FreeFileSync::getLastErrorFormatted(const int lastError) //try to get additional Linux error information +{ + //determine error code if none was specified + const int lastErrorCode = lastError == 0 ? errno : lastError; + + wxString output = wxString(wxT("Linux Error Code ")) + wxString::Format(wxT("%i"), lastErrorCode); + output += wxString(wxT(": ")) + ::strerror(lastErrorCode); + return output; +} +#endif diff --git a/shared/systemFunctions.h b/shared/systemFunctions.h new file mode 100644 index 00000000..b449d8d2 --- /dev/null +++ b/shared/systemFunctions.h @@ -0,0 +1,18 @@ +#ifndef SYSTEMFUNCTIONS_H_INCLUDED +#define SYSTEMFUNCTIONS_H_INCLUDED + +#include <wx/string.h> + + +namespace FreeFileSync +{ + +#ifdef FFS_WIN + wxString getLastErrorFormatted(const unsigned long lastError = 0); //try to get additional Windows error information +#elif defined FFS_LINUX + wxString getLastErrorFormatted(const int lastError = 0); //try to get additional Linux error information +#endif +} + + +#endif // SYSTEMFUNCTIONS_H_INCLUDED diff --git a/shared/tinyxml/Makefile b/shared/tinyxml/Makefile new file mode 100644 index 00000000..fb8982a2 --- /dev/null +++ b/shared/tinyxml/Makefile @@ -0,0 +1,130 @@ +#**************************************************************************** +# +# Makefile for TinyXml test. +# Lee Thomason +# www.grinninglizard.com +# +# This is a GNU make (gmake) makefile +#**************************************************************************** + +# DEBUG can be set to YES to include debugging info, or NO otherwise +DEBUG := YES + +# PROFILE can be set to YES to include profiling info, or NO otherwise +PROFILE := NO + +# TINYXML_USE_STL can be used to turn on STL support. NO, then STL +# will not be used. YES will include the STL files. +TINYXML_USE_STL := YES + +#**************************************************************************** + +CC := gcc +CXX := g++ +LD := g++ +AR := ar rc +RANLIB := ranlib + +DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG +RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 + +LIBS := + +DEBUG_CXXFLAGS := ${DEBUG_CFLAGS} +RELEASE_CXXFLAGS := ${RELEASE_CFLAGS} + +DEBUG_LDFLAGS := -g +RELEASE_LDFLAGS := + +ifeq (YES, ${DEBUG}) + CFLAGS := ${DEBUG_CFLAGS} + CXXFLAGS := ${DEBUG_CXXFLAGS} + LDFLAGS := ${DEBUG_LDFLAGS} +else + CFLAGS := ${RELEASE_CFLAGS} + CXXFLAGS := ${RELEASE_CXXFLAGS} + LDFLAGS := ${RELEASE_LDFLAGS} +endif + +ifeq (YES, ${PROFILE}) + CFLAGS := ${CFLAGS} -pg -O3 + CXXFLAGS := ${CXXFLAGS} -pg -O3 + LDFLAGS := ${LDFLAGS} -pg +endif + +#**************************************************************************** +# Preprocessor directives +#**************************************************************************** + +ifeq (YES, ${TINYXML_USE_STL}) + DEFS := -DTIXML_USE_STL +else + DEFS := +endif + +#**************************************************************************** +# Include paths +#**************************************************************************** + +#INCS := -I/usr/include/g++-2 -I/usr/local/include +INCS := + + +#**************************************************************************** +# Makefile code common to all platforms +#**************************************************************************** + +CFLAGS := ${CFLAGS} ${DEFS} +CXXFLAGS := ${CXXFLAGS} ${DEFS} + +#**************************************************************************** +# Targets of the build +#**************************************************************************** + +OUTPUT := xmltest + +all: ${OUTPUT} + + +#**************************************************************************** +# Source files +#**************************************************************************** + +SRCS := tinyxml.cpp tinyxmlparser.cpp xmltest.cpp tinyxmlerror.cpp tinystr.cpp + +# Add on the sources for libraries +SRCS := ${SRCS} + +OBJS := $(addsuffix .o,$(basename ${SRCS})) + +#**************************************************************************** +# Output +#**************************************************************************** + +${OUTPUT}: ${OBJS} + ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS} + +#**************************************************************************** +# common rules +#**************************************************************************** + +# Rules for compiling source files to object files +%.o : %.cpp + ${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@ + +%.o : %.c + ${CC} -c ${CFLAGS} ${INCS} $< -o $@ + +dist: + bash makedistlinux + +clean: + -rm -f core ${OBJS} ${OUTPUT} + +depend: + #makedepend ${INCS} ${SRCS} + +tinyxml.o: tinyxml.h tinystr.h +tinyxmlparser.o: tinyxml.h tinystr.h +xmltest.o: tinyxml.h tinystr.h +tinyxmlerror.o: tinyxml.h tinystr.h diff --git a/shared/tinyxml/changes.txt b/shared/tinyxml/changes.txt new file mode 100644 index 00000000..4075fd62 --- /dev/null +++ b/shared/tinyxml/changes.txt @@ -0,0 +1,269 @@ +Changes in version 1.0.1: +- Fixed comment tags which were outputing as '<?--' instead of + the correct '<!--'. +- Implemented the Next and Prev methods of the TiXmlAttribute class. +- Renamed 'LastAttribtute' to 'LastAttribute' +- Fixed bad pointer to 'isspace' that could occur while parsing text. +- Errors finding beginning and end of tags no longer throw it into an + infinite loop. (Hopefully.) + +Changes in version 1.0.2 +- Minor documentation fixes. + +Changes in version 1.0.3 +- After nodes are added to a document, they return a pointer + to the new node instead of a bool for success. +- Elements can be constructed with a value, which is the + element name. Every element must have a value or it will be + invalid, but the code changes to enforce this are not fully + in place. + +Changes in version 1.1.0 +- Added the TiXmlAttributeSet class to pull the attributes into + a seperate container. +- Moved the doubly liked list out of XmlBase. Now XmlBase only + requires the Print() function and defines some utility functions. +- Moved errors into a seperate file. (With the idea of internationalization + to the other latin-1 languages.) +- Added the "NodeType" +- Fixed white space parsing in text to conform with the standard. + Basically, all white space becomes just one space. +- Added the TiXmlDeclaration class to read xml declarations. + +Changes in version 1.2.0 +- Removed the factory. The factory was not really in the spirit + of small and simple, confused the code, and was of limited value. +- Added FirstChildElement and NextSiblingElement, because they + are such common functions. +- Re-wrote the example to test and demonstrate more functionality. + +Changes in version 1.2.1 +- Fixed a bug where comments couldn't be inside elements. +- Loading now clears out existing XML rather than appending. +- Added the "Clear" method on a node to delete all its children. + +Changes in version 1.2.2 +- Fixed TiXmlAttribute::Previous actually returning "next." Thanks + to Rickard Troedsson for the bug fix. + +Changes in version 1.2.3 +- Added the TIXML prefix to the error strings to resolve conflicts + with #defines in OS headers. Thanks to Steve Lhomme. +- Fixed a delete buf that should be a delete [] buf. + Thanks to Ephi Sinowitz. + +Changes in version 1.2.4 +- ReplaceChild() was almost guarenteed to fail. Should be fixed, + thanks to Joe Smith. Joe also pointed out that the Print() functions + should take stream references: I agree, and would like to overload + the Print() method to take either format, but I don't want to do + this in a dot release. +- Some compilers seem to need an extra <ctype.h> include. Thanks + to Steve Lhomme for that. + +Changes in version 2.0.0 BETA +- Made the ToXXX() casts safe if 'this' is null. + When "LoadFile" is called with a filename, the value will correctly get set. + Thanks to Brian Yoder. +- Fixed bug where isalpha() and isalnum() would get called with a negative value for + high ascii numbers. Thanks to Alesky Aksenov. +- Fixed some errors codes that were not getting set. +- Made methods "const" that were not. +- Added a switch to enable or disable the ignoring of white space. ( TiXmlDocument::SetIgnoreWhiteSpace() ) +- Greater standardization and code re-use in the parser. +- Added a stream out operator. +- Added a stream in operator. +- Entity support, of predefined entites. &#x entities are untouched by input or output. +- Improved text out formatting. +- Fixed ReplaceChild bug, thanks to Tao Chen. + +Changes in version 2.0.1 +- Fixed hanging on loading a 0 length file. Thanks to Jeff Scozzafava. +- Fixed crashing on InsertBeforeChild and InsertAfterChild. Also possibility of bad links being + created by same function. Thanks to Frank De prins. +- Added missing licence text. Thanks to Lars Willemsens. +- Added <ctype.h> include, at the suggestion of Steve Walters. + +Changes in version 2.1.0 +- Yves Berquin brings us the STL switch. The forum on SourceForge, and various emails to + me, have long debated all out STL vs. no STL at all. And now you can have it both ways. + TinyXml will compile either way. + +Changes in version 2.1.1 +- Compilation warnings. + +Changes in version 2.1.2 +- Uneeded code is not compiled in the STL case. +- Changed headers so that STL can be turned on or off in tinyxml.h + +Changes in version 2.1.3 +- Fixed non-const reference in API; now uses a pointer. +- Copy constructor of TiXmlString not checking for assignment to self. +- Nimrod Cohen found a truly evil bug in the STL implementation that occurs + when a string is converted to a c_str and then assigned to self. Search for + STL_STRING_BUG for a full description. I'm asserting this is a Microsoft STL + bug, since &string and string.c_str() should never be the same. Nevertheless, + the code works around it. +- Urivan Saaib pointed out a compiler conflict, where the C headers define + the isblank macro, which was wiping out the TiXmlString::isblank() method. + The method was unused and has been removed. + +Changes in version 2.1.4 +- Reworked the entity code. Entities were not correctly surving round trip input and output. + Will now automatically create entities for high ascii in output. + +Changes in version 2.1.5 +- Bug fix by kylotan : infinite loop on some input (tinyxmlparser.cpp rev 1.27) +- Contributed by Ivica Aracic (bytelord) : 1 new VC++ project to compile versions as static libraries (tinyxml_lib.dsp), + and an example usage in xmltest.dsp + (Patch request ID 678605) +- A suggestion by Ronald Fenner Jr (dormlock) to add #include <istream> and <ostream> for Apple's Project Builder + (Patch request ID 697642) +- A patch from ohommes that allows to parse correctly dots in element names and attribute names + (Patch request 602600 and kylotan 701728) +- A patch from hermitgeek ( James ) and wasteland for improper error reporting +- Reviewed by Lee, with the following changes: + - Got sick of fighting the STL/non-STL thing in the windows build. Broke + them out as seperate projects. + - I have too long not included the dsw. Added. + - TinyXmlText had a protected Print. Odd. + - Made LinkEndChild public, with docs and appropriate warnings. + - Updated the docs. + +2.2.0 +- Fixed an uninitialized pointer in the TiXmlAttributes +- Fixed STL compilation problem in MinGW (and gcc 3?) - thanks Brian Yoder for finding this one +- Fixed a syntax error in TiXmlDeclaration - thanks Brian Yoder +- Fletcher Dunn proposed and submitted new error handling that tracked the row and column. Lee + modified it to not have performance impact. +- General cleanup suggestions from Fletcher Dunn. +- In error handling, general errors will no longer clear the error state of specific ones. +- Fix error in documentation : comments starting with "<?--" instead of "<!--" (thanks ion_pulse) +- Added the TiXmlHandle. An easy, safe way to browse XML DOMs with less code. +- Added QueryAttribute calls which have better error messaging. (Proposed by Fletcher Dunn) +- Nodes and attributes can now print themselves to strings. (Yves suggestion) +- Fixed bug where entities with one character would confuse parser. (Thanks Roman) + +2.2.1 +- Additional testing (no more bugs found to be fixed in this release) +- Significant performance improvement to the cursor code. + +2.3.0 +- User Data are now defined in TiXmlBase instead of TiXmlNode +- Character Entities are now UCS-2 +- Character Entities can be decimal or hexadecimal +- UTF-8 conversion. +- Fixed many, many bugs. + +2.3.1 +- Fixed bug in handling nulls embedded in the input. +- Make UTF-8 parser tolerant of bad text encoding. +- Added encoding detection. +- Many fixes and input from John-Philip Leonard Johansson (JP) and Ellers, + including UTF-8 feedback, bug reports, and patches. Thanks! +- Added version # constants - a suggestion from JP and Ellers. +- [ 979180 ] Missing ; in entity reference, fix from Rob Laveaux. +- Copy constructors and assignment have been a long time coming. Thanks to + Fokke and JP. + +2.3.2 +- Made the IsAlpha and IsAlphaNum much more tolerant of non-UTF-8 encodings. Thanks + Volker Boerchers for finding the issue. +- Ran the program though the magnificent Valgrind - http://valgrind.kde.org - to check + for memory errors. Fixed some minor issues. + +2.3.3 +- Fixed crash when test program was run from incorrect directory. +- Fixed bug 1070717 - empty document not returned correctly - thanks Katsuhisa Yuasa. +- Bug 1079301 resolved - deprecated stdlib calls. Thanks Adrian Boeing. +- Bug 1035218 fixed - documentation errors. Xunji Luo +- Other bug fixes have accumulated and been fixed on the way as well; my apologies to + authors not credited! +- Big fix / addition is to correctly return const values. TinyXml could basically + remove const in a method like this: TiXmlElement* Foo() const, where the returned element + was a pointer to internal data. That is now: const TiXmlElement* Foo() const and + TiXmlElement* Foo(). + +2.3.4 +- Fixed additional const errors, thanks Kent Gibson. +- Correctly re-enable warnings after tinyxml header. Thanks Cory Nelson. +- Variety of type cleanup and warning fixes. Thanks Warren Stevens. +- Cleaned up unneeded constructor calls in TinyString - thanks to Geoff Carlton and + the discussion group on sourceforge. + +2.4.0 +- Improved string class, thanks Tyge Lovset (whose name gets mangled in English - sorry) +- Type cast compiler warning, thanks Rob van den Bogaard +- Added GetText() convenience function. Thanks Ilya Parniuk & Andrew Ellers for input. +- Many thanks to marlonism for finding an infinite loop in bad xml. +- A patch to cleanup warnings from Robert Gebis. +- Added ValueStr() to get the value of a node as a string. +- TiXmlText can now parse and output as CDATA +- Additional string improvement from James (z2895) +- Removed extraneous 'const', thanks David Aldrich +- First pass at switching to the "safe" stdlib functions. Many people have suggested and + pushed on this, but Warren Stevens put together the first proposal. +- TinyXml now will do EOL normalization before parsing, consistent with the W3C XML spec. +- Documents loaded with the UTF-8 BOM will now save with the UTF-8 BOM. Good suggestion + from 'instructor_' +- Ellers submitted his very popular tutorials, which have been added to the distribution. + +2.4.1 +- Fixed CDATA output formatting +- Fixed memory allocators in TinyString to work with overloaded new/delete + +2.4.2 +- solosnake pointed out that TIXML_LOG causes problems on an XBOX. The definition in the header + was superflous and was moved inside of DEBUG_PARSING + +2.4.3 +- Fixed a test bug that caused a crash in 'xmltest'. TinyXML was fine, but it isn't good + to ship with a broken test suite. +- Started converting some functions to not cast between std::string and const char* + quite as often. +- Added FILE* versions of the document loads - good suggestion from Wade Brainerd +- Empty documents might not always return the errors they should. [1398915] Thanks to igor v. +- Added some asserts for multiply adding a node, regardng bug [1391937] suggested by Paco Arjonilla. + +2.4.4 +- Bug find thanks to andre-gross found a memory leak that occured when a document failed to load. +- Bug find (and good analysis) by VirtualJim who found a case where attribute parsing + should be throwing an error and wasn't. +- Steve Hyatt suggested the QueryValueAttribute method, which is now implemented. +- DavidA identified a chunk of dead code. +- Andrew Baxter sent in some compiler warnings that were good clean up points. + +2.5 +- Added the Visit() API. Many thanks to both Andrew Ellerton and John-Philip for all their + work, code, suggestion, and just general pushing that it should be done. +- Removed existing streaming code and use TiXmlPrinter instead. +- [ tinyxml-Bugs-1527079 ] Compile error in tinystr.cpp fixed, thanks to Paul Suggs +- [ tinyxml-Bugs-1522890 ] SaveFile has no error checks fixed, thanks to Ivan Dobrokotov +- Ivan Dobrokotov also reported redundant memory allocation in the Attribute() method, which + upon investigation was a mess. The attribute should now be fixed for both const char* and + std::string, and the return types match the input parameters. +- Feature [ 1511105 ] Make TiXmlComment constructor accept a string / char*, implemented. + Thanks to Karl Itschen for the feedback. +- [ 1480108 ] Stream parsing fails when CDATA contains tags was found by Tobias Grimm, who also + submitted a test case and patch. A significant bug in CDATA streaming (operator>>) has now + been fixed. + +2.5.2 +- Lieven, and others, pointed out a missing const-cast that upset the Open Watcom compiler. + Should now be fixed. +- ErrorRow and ErrorCol should have been const, and weren't. Fixed thanks to Dmitry Polutov. + +2.5.3 +- zloe_zlo identified a missing string specialization for QueryValueAttribute() [ 1695429 ]. Worked + on this bug, but not sure how to fix it in a safe, cross-compiler way. +- increased warning level to 4 and turned on detect 64 bit portability issues for VC2005. + May address [ 1677737 ] VS2005: /Wp64 warnings +- grosheck identified several problems with the Document copy. Many thanks for [ 1660367 ] +- Nice catch, and suggested fix, be Gilad Novik on the Printer dropping entities. + "[ 1600650 ] Bug when printing xml text" is now fixed. +- A subtle fix from Nicos Gollan in the tinystring initializer: + [ 1581449 ] Fix initialiser of TiXmlString::nullrep_ +- Great catch, although there isn't a submitter for the bug. [ 1475201 ] TinyXML parses entities in comments. + Comments should not, in fact, parse entities. Fixed the code path and added tests. +- We were not catching all the returns from ftell. Thanks to Bernard for catching that. + diff --git a/shared/tinyxml/docs/annotated.html b/shared/tinyxml/docs/annotated.html new file mode 100644 index 00000000..79534783 --- /dev/null +++ b/shared/tinyxml/docs/annotated.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TinyXml Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table> + <tr><td class="indexkey"><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td class="indexvalue">An attribute is a name-value pair </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td class="indexvalue"><a class="el" href="classTiXmlBase.html">TiXmlBase</a> is a base class for every class in TinyXml </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td class="indexvalue">An XML comment </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td class="indexvalue">In correct XML the declaration is the first entry in the file </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td class="indexvalue">Always the top level node </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td class="indexvalue">The element is a container class </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td class="indexvalue">A <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td class="indexvalue">The parent class for everything in the Document Object Model </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td class="indexvalue">Print to memory functionality </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td class="indexvalue">XML text </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td class="indexvalue">Any tag that tinyXml doesn't recognize is saved as an unknown </td></tr> + <tr><td class="indexkey"><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td class="indexvalue">If you call the Accept() method, it requires being passed a <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> class to handle callbacks </td></tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlAttribute-members.html b/shared/tinyxml/docs/classTiXmlAttribute-members.html new file mode 100644 index 00000000..b3c0fc67 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlAttribute-members.html @@ -0,0 +1,54 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlAttribute Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#2880ddef53fc7522c99535273954d230">DoubleValue</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">IntValue</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">Name</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">Next</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#c87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a>(double *_value) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">QueryIntValue</a>(int *_value) const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#0316da31373496c4368ad549bf711394">SetDoubleValue</a>(double _value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a>(int _value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#b7fa3d21ff8d7c5764cf9af15b667a99">SetName</a>(const char *_name)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#b296ff0c9a8c701055cd257a8a976e57">SetName</a>(const std::string &_name)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#2dae44178f668b3cb48101be4f2236a0">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#b43f67a0cc3ec1d80e62606500f0925f">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>()</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#052213522caac3979960e0714063861d">TiXmlAttribute</a>(const std::string &_name, const std::string &_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a>(const char *_name, const char *_value)</td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">Value</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a>() const </td><td><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlAttribute.html b/shared/tinyxml/docs/classTiXmlAttribute.html new file mode 100644 index 00000000..9cdc9a9b --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlAttribute.html @@ -0,0 +1,181 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlAttribute Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlAttribute Class Reference</h1><!-- doxytag: class="TiXmlAttribute" --><!-- doxytag: inherits="TiXmlBase" -->An attribute is a name-value pair. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlAttribute: +<p><center><img src="classTiXmlAttribute.png" usemap="#TiXmlAttribute_map" border="0" alt=""></center> +<map name="TiXmlAttribute_map"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,90,24"> +</map> +<a href="classTiXmlAttribute-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9cfa3c8179873fd485d83003b114f8e1"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="9cfa3c8179873fd485d83003b114f8e1" args="()" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an empty attribute. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="052213522caac3979960e0714063861d"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="052213522caac3979960e0714063861d" args="(const std::string &_name, const std::string &_value)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#052213522caac3979960e0714063861d">TiXmlAttribute</a> (const std::string &_name, const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">std::string constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="759d0b76fb8fcf765ecab243bc14f05e"></a><!-- doxytag: member="TiXmlAttribute::TiXmlAttribute" ref="759d0b76fb8fcf765ecab243bc14f05e" args="(const char *_name, const char *_value)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a> (const char *_name, const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an attribute with a name and value. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="298a57287d305904ba6bd96ae6f78d3d"></a><!-- doxytag: member="TiXmlAttribute::Name" ref="298a57287d305904ba6bd96ae6f78d3d" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">Name</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the name of this attribute. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0f874490eac8ca00ee0070765d0e97e3"></a><!-- doxytag: member="TiXmlAttribute::Value" ref="0f874490eac8ca00ee0070765d0e97e3" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">Value</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="87705c3ccf9ee9417beb4f7cbacd4d33"></a><!-- doxytag: member="TiXmlAttribute::ValueStr" ref="87705c3ccf9ee9417beb4f7cbacd4d33" args="() const " --> +const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1a20ad59dc7e89a0ab265396360d50f"></a><!-- doxytag: member="TiXmlAttribute::IntValue" ref="a1a20ad59dc7e89a0ab265396360d50f" args="() const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">IntValue</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute, converted to an integer. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2880ddef53fc7522c99535273954d230"></a><!-- doxytag: member="TiXmlAttribute::DoubleValue" ref="2880ddef53fc7522c99535273954d230" args="() const " --> +double </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#2880ddef53fc7522c99535273954d230">DoubleValue</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the value of this attribute, converted to a double. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">QueryIntValue</a> (int *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryIntValue examines the value string. <a href="#d6c93088ee21af41a107931223339344"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c87b2a8489906a5d7aa2875f20be3513"></a><!-- doxytag: member="TiXmlAttribute::QueryDoubleValue" ref="c87b2a8489906a5d7aa2875f20be3513" args="(double *_value) const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#c87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a> (double *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryDoubleValue examines the value string. See <a class="el" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">QueryIntValue()</a>. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b7fa3d21ff8d7c5764cf9af15b667a99"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="b7fa3d21ff8d7c5764cf9af15b667a99" args="(const char *_name)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#b7fa3d21ff8d7c5764cf9af15b667a99">SetName</a> (const char *_name)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the name of this attribute. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2dae44178f668b3cb48101be4f2236a0"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="2dae44178f668b3cb48101be4f2236a0" args="(const char *_value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#2dae44178f668b3cb48101be4f2236a0">SetValue</a> (const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7e065df640116a62ea4f4b7da5449cc8"></a><!-- doxytag: member="TiXmlAttribute::SetIntValue" ref="7e065df640116a62ea4f4b7da5449cc8" args="(int _value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a> (int _value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value from an integer. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0316da31373496c4368ad549bf711394"></a><!-- doxytag: member="TiXmlAttribute::SetDoubleValue" ref="0316da31373496c4368ad549bf711394" args="(double _value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#0316da31373496c4368ad549bf711394">SetDoubleValue</a> (double _value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the value from a double. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b296ff0c9a8c701055cd257a8a976e57"></a><!-- doxytag: member="TiXmlAttribute::SetName" ref="b296ff0c9a8c701055cd257a8a976e57" args="(const std::string &_name)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#b296ff0c9a8c701055cd257a8a976e57">SetName</a> (const std::string &_name)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b43f67a0cc3ec1d80e62606500f0925f"></a><!-- doxytag: member="TiXmlAttribute::SetValue" ref="b43f67a0cc3ec1d80e62606500f0925f" args="(const std::string &_value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#b43f67a0cc3ec1d80e62606500f0925f">SetValue</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c78e92e223a40843f644ba48ef69f67"></a><!-- doxytag: member="TiXmlAttribute::Next" ref="1c78e92e223a40843f644ba48ef69f67" args="() const " --> +const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">Next</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the next sibling attribute in the DOM. Returns null at end. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6ebbfe333fe76cd834bd6cbcca3130cf"></a><!-- doxytag: member="TiXmlAttribute::Previous" ref="6ebbfe333fe76cd834bd6cbcca3130cf" args="() const " --> +const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the previous sibling attribute in the DOM. Returns null at beginning. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#cc04956c1d5c4c31fe74f7a7528d109a"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +An attribute is a name-value pair. +<p> +Elements have an arbitrary number of attributes, each with a unique name.<p> +<dl compact><dt><b>Note:</b></dt><dd>The attributes are not TiXmlNodes, since they are not part of the tinyXML document object model. There are other suggested ways to look at this problem. </dd></dl> + +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="cc04956c1d5c4c31fe74f7a7528d109a"></a><!-- doxytag: member="TiXmlAttribute::Print" ref="cc04956c1d5c4c31fe74f7a7528d109a" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlAttribute::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [inline, virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<a class="anchor" name="d6c93088ee21af41a107931223339344"></a><!-- doxytag: member="TiXmlAttribute::QueryIntValue" ref="d6c93088ee21af41a107931223339344" args="(int *_value) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlAttribute::QueryIntValue </td> + <td>(</td> + <td class="paramtype">int * </td> + <td class="paramname"> <em>_value</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +QueryIntValue examines the value string. +<p> +It is an alternative to the <a class="el" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">IntValue()</a> method with richer error checking. If the value is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE.<p> +A specialized but useful call. Note that for success it returns 0, which is the opposite of almost all other TinyXml calls. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlAttribute.png b/shared/tinyxml/docs/classTiXmlAttribute.png Binary files differnew file mode 100644 index 00000000..ebac5ca9 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlAttribute.png diff --git a/shared/tinyxml/docs/classTiXmlBase-members.html b/shared/tinyxml/docs/classTiXmlBase-members.html new file mode 100644 index 00000000..352900e8 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlBase-members.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlBase Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlBase.html">TiXmlBase</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">Print</a>(FILE *cfile, int depth) const =0</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [pure virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlBase.html b/shared/tinyxml/docs/classTiXmlBase.html new file mode 100644 index 00000000..bdb63893 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlBase.html @@ -0,0 +1,230 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlBase Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlBase Class Reference</h1><!-- doxytag: class="TiXmlBase" --><a class="el" href="classTiXmlBase.html">TiXmlBase</a> is a base class for every class in TinyXml. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlBase: +<p><center><img src="classTiXmlBase.png" usemap="#TiXmlBase_map" border="0" alt=""></center> +<map name="TiXmlBase_map"> +<area href="classTiXmlAttribute.html" alt="TiXmlAttribute" shape="rect" coords="0,56,108,80"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="295,56,403,80"> +<area href="classTiXmlComment.html" alt="TiXmlComment" shape="rect" coords="0,112,108,136"> +<area href="classTiXmlDeclaration.html" alt="TiXmlDeclaration" shape="rect" coords="118,112,226,136"> +<area href="classTiXmlDocument.html" alt="TiXmlDocument" shape="rect" coords="236,112,344,136"> +<area href="classTiXmlElement.html" alt="TiXmlElement" shape="rect" coords="354,112,462,136"> +<area href="classTiXmlText.html" alt="TiXmlText" shape="rect" coords="472,112,580,136"> +<area href="classTiXmlUnknown.html" alt="TiXmlUnknown" shape="rect" coords="590,112,698,136"> +</map> +<a href="classTiXmlBase-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">Print</a> (FILE *cfile, int depth) const =0</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#0de56b3f2ef14c65091a3b916437b512"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the position, in the original source file, of this node or attribute. <a href="#024bceb070188df92c2a8d8852dd0853"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b54bfb9b70fe6dd276e7b279cab7f003"></a><!-- doxytag: member="TiXmlBase::Column" ref="b54bfb9b70fe6dd276e7b279cab7f003" args="() const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">See <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row()</a>. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c6b3e0f790930d4970ec30764e937b5d"></a><!-- doxytag: member="TiXmlBase::SetUserData" ref="c6b3e0f790930d4970ec30764e937b5d" args="(void *user)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a> (void *user)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a pointer to arbitrary user data. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6559a530ca6763fc301a14d77ed28c17"></a><!-- doxytag: member="TiXmlBase::GetUserData" ref="6559a530ca6763fc301a14d77ed28c17" args="()" --> +void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to arbitrary user data. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d0120210e4680ef2088601753ce0ede4"></a><!-- doxytag: member="TiXmlBase::GetUserData" ref="d0120210e4680ef2088601753ce0ede4" args="() const " --> +const void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to arbitrary user data. <br></td></tr> +<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a> (bool condense)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The world does not agree on whether white space should be kept or not. <a href="#0f799ec645bfb8d8a969e83478f379c1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d4b1472531c647a25b1840a87ae42438"></a><!-- doxytag: member="TiXmlBase::IsWhiteSpaceCondensed" ref="d4b1472531c647a25b1840a87ae42438" args="()" --> +static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the current white space setting. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a> (const TIXML_STRING &str, TIXML_STRING *out)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Expands entities in a string. <a href="#6bd8c315c1acb09e34107b8736505948"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b242c01590191f644569fa89a080d97c"></a><!-- doxytag: member="TiXmlBase::userData" ref="b242c01590191f644569fa89a080d97c" args="" --> +void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Field containing a generic user pointer. <br></td></tr> +<tr><td colspan="2"><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="218872a0d985ae30e78c55adc4bdb196"></a><!-- doxytag: member="TiXmlBase::TiXmlNode" ref="218872a0d985ae30e78c55adc4bdb196" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#218872a0d985ae30e78c55adc4bdb196">TiXmlNode</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlBase::TiXmlElement" ref="b6592e32cb9132be517cc12a70564c4b" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#b6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="173617f6dfe902cf484ce5552b950475"></a><!-- doxytag: member="TiXmlBase::TiXmlDocument" ref="173617f6dfe902cf484ce5552b950475" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlBase.html#173617f6dfe902cf484ce5552b950475">TiXmlDocument</a></td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +<a class="el" href="classTiXmlBase.html">TiXmlBase</a> is a base class for every class in TinyXml. +<p> +It does little except to establish that TinyXml classes can be printed and provide some utility functions.<p> +In XML, the document and elements can contain other elements and other types of nodes.<p> +<div class="fragment"><pre class="fragment"> A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + A Decleration contains: Attributes (not on tree) + </pre></div> +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="6bd8c315c1acb09e34107b8736505948"></a><!-- doxytag: member="TiXmlBase::EncodeString" ref="6bd8c315c1acb09e34107b8736505948" args="(const TIXML_STRING &str, TIXML_STRING *out)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static void TiXmlBase::EncodeString </td> + <td>(</td> + <td class="paramtype">const TIXML_STRING & </td> + <td class="paramname"> <em>str</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">TIXML_STRING * </td> + <td class="paramname"> <em>out</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Expands entities in a string. +<p> +Note this should not contian the tag's '<', '>', etc, or they will be transformed into entities! +</div> +</div><p> +<a class="anchor" name="0de56b3f2ef14c65091a3b916437b512"></a><!-- doxytag: member="TiXmlBase::Print" ref="0de56b3f2ef14c65091a3b916437b512" args="(FILE *cfile, int depth) const =0" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlBase::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [pure virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implemented in <a class="el" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>, <a class="el" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>. +</div> +</div><p> +<a class="anchor" name="024bceb070188df92c2a8d8852dd0853"></a><!-- doxytag: member="TiXmlBase::Row" ref="024bceb070188df92c2a8d8852dd0853" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlBase::Row </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return the position, in the original source file, of this node or attribute. +<p> +The row and column are 1-based. (That is the first row and first column is 1,1). If the returns values are 0 or less, then the parser does not have a row and column value.<p> +Generally, the row and column value will be set when the TiXmlDocument::Load(), <a class="el" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">TiXmlDocument::LoadFile()</a>, or any TiXmlNode::Parse() is called. It will NOT be set when the DOM was created from operator>>.<p> +The values reflect the initial load. Once the DOM is modified programmatically (by adding or changing nodes and attributes) the new values will NOT update to reflect changes in the document.<p> +There is a minor performance cost to computing the row and column. Computation can be disabled if <a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument::SetTabSize()</a> is called with 0 as the value.<p> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument::SetTabSize()</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="0f799ec645bfb8d8a969e83478f379c1"></a><!-- doxytag: member="TiXmlBase::SetCondenseWhiteSpace" ref="0f799ec645bfb8d8a969e83478f379c1" args="(bool condense)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">static void TiXmlBase::SetCondenseWhiteSpace </td> + <td>(</td> + <td class="paramtype">bool </td> + <td class="paramname"> <em>condense</em> </td> + <td> ) </td> + <td width="100%"><code> [inline, static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +The world does not agree on whether white space should be kept or not. +<p> +In order to make everyone happy, these global, static functions are provided to set whether or not TinyXml will condense all white space into a single space or not. The default is to condense. Note changing this value is not thread safe. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlBase.png b/shared/tinyxml/docs/classTiXmlBase.png Binary files differnew file mode 100644 index 00000000..085db6e5 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlBase.png diff --git a/shared/tinyxml/docs/classTiXmlComment-members.html b/shared/tinyxml/docs/classTiXmlComment-members.html new file mode 100644 index 00000000..9b2c4ec0 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlComment-members.html @@ -0,0 +1,100 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlComment Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlComment.html">TiXmlComment</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">Clone</a>() const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>()</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a>(const char *_value)</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a>() const </td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlComment.html#cc7c7e07e13c23f17797d642981511df">ToComment</a>()</td><td><a class="el" href="classTiXmlComment.html">TiXmlComment</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlComment.html b/shared/tinyxml/docs/classTiXmlComment.html new file mode 100644 index 00000000..65ea2709 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlComment.html @@ -0,0 +1,108 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlComment Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlComment Class Reference</h1><!-- doxytag: class="TiXmlComment" --><!-- doxytag: inherits="TiXmlNode" -->An XML comment. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlComment: +<p><center><img src="classTiXmlComment.png" usemap="#TiXmlComment_map" border="0" alt=""></center> +<map name="TiXmlComment_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,94,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,94,24"> +</map> +<a href="classTiXmlComment-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aa3252031d3e8bd3a2bf51a1c61201b7"></a><!-- doxytag: member="TiXmlComment::TiXmlComment" ref="aa3252031d3e8bd3a2bf51a1c61201b7" args="()" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs an empty comment. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="37e7802ef17bc03ebe5ae79bf0713d47"></a><!-- doxytag: member="TiXmlComment::TiXmlComment" ref="37e7802ef17bc03ebe5ae79bf0713d47" args="(const char *_value)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a> (const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct a comment from text. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0d6662bdc52488b9e12b3c7a0453d028"></a><!-- doxytag: member="TiXmlComment::Clone" ref="0d6662bdc52488b9e12b3c7a0453d028" args="() const " --> +virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a copy of this Comment. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#6b316527aaa8da0370cd68c22a5a0f5f"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="00fb4215c20a2399ea05ac9b9e7e68a0"></a><!-- doxytag: member="TiXmlComment::ToComment" ref="00fb4215c20a2399ea05ac9b9e7e68a0" args="() const " --> +virtual const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cc7c7e07e13c23f17797d642981511df"></a><!-- doxytag: member="TiXmlComment::ToComment" ref="cc7c7e07e13c23f17797d642981511df" args="()" --> +virtual <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#cc7c7e07e13c23f17797d642981511df">ToComment</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f3ac1b99fbbe9ea4fb6e14146156e43e"></a><!-- doxytag: member="TiXmlComment::Accept" ref="f3ac1b99fbbe9ea4fb6e14146156e43e" args="(TiXmlVisitor *visitor) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +An XML comment. +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="6b316527aaa8da0370cd68c22a5a0f5f"></a><!-- doxytag: member="TiXmlComment::Print" ref="6b316527aaa8da0370cd68c22a5a0f5f" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlComment::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlComment.png b/shared/tinyxml/docs/classTiXmlComment.png Binary files differnew file mode 100644 index 00000000..e33d7425 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlComment.png diff --git a/shared/tinyxml/docs/classTiXmlDeclaration-members.html b/shared/tinyxml/docs/classTiXmlDeclaration-members.html new file mode 100644 index 00000000..147bb966 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDeclaration-members.html @@ -0,0 +1,104 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlDeclaration Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">Clone</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">Encoding</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">Standalone</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a>()</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#cd5556007c3c72209465081de39d9836">TiXmlDeclaration</a>(const std::string &_version, const std::string &_encoding, const std::string &_standalone)</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a>(const char *_version, const char *_encoding, const char *_standalone)</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#6bd3d1daddcaeb9543c24bfd090969ce">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">Version</a>() const </td><td><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlDeclaration.html b/shared/tinyxml/docs/classTiXmlDeclaration.html new file mode 100644 index 00000000..5ae9a0f3 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDeclaration.html @@ -0,0 +1,129 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlDeclaration Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlDeclaration Class Reference</h1><!-- doxytag: class="TiXmlDeclaration" --><!-- doxytag: inherits="TiXmlNode" -->In correct XML the declaration is the first entry in the file. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlDeclaration: +<p><center><img src="classTiXmlDeclaration.png" usemap="#TiXmlDeclaration_map" border="0" alt=""></center> +<map name="TiXmlDeclaration_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,108,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,108,24"> +</map> +<a href="classTiXmlDeclaration-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0484d059bea0ea1acb47c9094382d79"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="a0484d059bea0ea1acb47c9094382d79" args="()" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an empty declaration. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cd5556007c3c72209465081de39d9836"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="cd5556007c3c72209465081de39d9836" args="(const std::string &_version, const std::string &_encoding, const std::string &_standalone)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#cd5556007c3c72209465081de39d9836">TiXmlDeclaration</a> (const std::string &_version, const std::string &_encoding, const std::string &_standalone)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3b618d1c30c25e4b7a71f31a595ee298"></a><!-- doxytag: member="TiXmlDeclaration::TiXmlDeclaration" ref="3b618d1c30c25e4b7a71f31a595ee298" args="(const char *_version, const char *_encoding, const char *_standalone)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a> (const char *_version, const char *_encoding, const char *_standalone)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="02ee557b1a4545c3219ed377c103ec76"></a><!-- doxytag: member="TiXmlDeclaration::Version" ref="02ee557b1a4545c3219ed377c103ec76" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">Version</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Version. Will return an empty string if none was found. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5d974231f9e9a2f0542f15f3a46cdb76"></a><!-- doxytag: member="TiXmlDeclaration::Encoding" ref="5d974231f9e9a2f0542f15f3a46cdb76" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">Encoding</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Encoding. Will return an empty string if none was found. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ff06afc033d7ef730ec7c6825b97ad9"></a><!-- doxytag: member="TiXmlDeclaration::Standalone" ref="9ff06afc033d7ef730ec7c6825b97ad9" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">Standalone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Is this a standalone document? <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7cf459186040141cda7a180a6585ce2e"></a><!-- doxytag: member="TiXmlDeclaration::Clone" ref="7cf459186040141cda7a180a6585ce2e" args="() const " --> +virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a copy of this Declaration and returns it. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#bf6303db4bd05b5be554036817ff1cb4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1e085d3fefd1dbf5ccdbff729931a967"></a><!-- doxytag: member="TiXmlDeclaration::ToDeclaration" ref="1e085d3fefd1dbf5ccdbff729931a967" args="() const " --> +virtual const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6bd3d1daddcaeb9543c24bfd090969ce"></a><!-- doxytag: member="TiXmlDeclaration::ToDeclaration" ref="6bd3d1daddcaeb9543c24bfd090969ce" args="()" --> +virtual <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#6bd3d1daddcaeb9543c24bfd090969ce">ToDeclaration</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="22315a535983b86535cdba3458669e3e"></a><!-- doxytag: member="TiXmlDeclaration::Accept" ref="22315a535983b86535cdba3458669e3e" args="(TiXmlVisitor *visitor) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +In correct XML the declaration is the first entry in the file. +<p> +<div class="fragment"><pre class="fragment"> <?xml version="1.0" standalone="yes"?> + </pre></div><p> +TinyXml will happily read or write files without a declaration, however. There are 3 possible attributes to the declaration: version, encoding, and standalone.<p> +Note: In this version of the code, the attributes are handled as special cases, not generic attributes, simply because there can only be at most 3 and they are always the same. +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="bf6303db4bd05b5be554036817ff1cb4"></a><!-- doxytag: member="TiXmlDeclaration::Print" ref="bf6303db4bd05b5be554036817ff1cb4" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlDeclaration::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [inline, virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlDeclaration.png b/shared/tinyxml/docs/classTiXmlDeclaration.png Binary files differnew file mode 100644 index 00000000..c10912b7 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDeclaration.png diff --git a/shared/tinyxml/docs/classTiXmlDocument-members.html b/shared/tinyxml/docs/classTiXmlDocument-members.html new file mode 100644 index 00000000..df6132a0 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDocument-members.html @@ -0,0 +1,119 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlDocument Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">ClearError</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">Clone</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [protected, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#879cdf5e981b8b2d2ef82f2546dd28fb">LoadFile</a>(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#41f6fe7200864d1dca663d230caf8db6">LoadFile</a>(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#18ae6ed34fed7991ebc220862dfac884">LoadFile</a>(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">Parse</a>(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">Print</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#8701fda1fa31b25abbc9c0df42da10e8">Print</a>(FILE *cfile, int depth=0) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">RootElement</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#e869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a>(const char *filename) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#cf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a>(FILE *) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a>(const std::string &filename) const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a>(int _tabsize)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#e4508b452d0c3061db085f3db27b8396">TiXmlDocument</a>(const char *documentName)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a>(const std::string &documentName)</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a>() const </td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlDocument.html#1025d942a1f328fd742d545e37efdd42">ToDocument</a>()</td><td><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlDocument.html b/shared/tinyxml/docs/classTiXmlDocument.html new file mode 100644 index 00000000..9779d3cc --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDocument.html @@ -0,0 +1,430 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlDocument Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlDocument Class Reference</h1><!-- doxytag: class="TiXmlDocument" --><!-- doxytag: inherits="TiXmlNode" -->Always the top level node. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlDocument: +<p><center><img src="classTiXmlDocument.png" usemap="#TiXmlDocument_map" border="0" alt=""></center> +<map name="TiXmlDocument_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,99,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,99,24"> +</map> +<a href="classTiXmlDocument-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f5e84335708fde98400230f9f12659c"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="9f5e84335708fde98400230f9f12659c" args="()" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#9f5e84335708fde98400230f9f12659c">TiXmlDocument</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an empty document, that has no name. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e4508b452d0c3061db085f3db27b8396"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="e4508b452d0c3061db085f3db27b8396" args="(const char *documentName)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#e4508b452d0c3061db085f3db27b8396">TiXmlDocument</a> (const char *documentName)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a document with a name. The name of the document is also the filename of the xml. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2c6e58fb99bfa76cc613f16840022225"></a><!-- doxytag: member="TiXmlDocument::TiXmlDocument" ref="2c6e58fb99bfa76cc613f16840022225" args="(const std::string &documentName)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a> (const std::string &documentName)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a> (TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the current document value. <a href="#4c852a889c02cf251117fd1d9fe1845f"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="21c0aeb0d0a720169ad4ac89523ebe93"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="21c0aeb0d0a720169ad4ac89523ebe93" args="() const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the current document value. Returns true if successful. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="879cdf5e981b8b2d2ef82f2546dd28fb"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="879cdf5e981b8b2d2ef82f2546dd28fb" args="(const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#879cdf5e981b8b2d2ef82f2546dd28fb">LoadFile</a> (const char *filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given filename. Returns true if successful. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e869f5ebf7fc54c4a1d737fb4689fd44"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="e869f5ebf7fc54c4a1d737fb4689fd44" args="(const char *filename) const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#e869f5ebf7fc54c4a1d737fb4689fd44">SaveFile</a> (const char *filename) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given filename. Returns true if successful. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#41f6fe7200864d1dca663d230caf8db6">LoadFile</a> (FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Load a file using the given FILE*. <a href="#41f6fe7200864d1dca663d230caf8db6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cf1672b4538c6d1d441f9f108aea2bf4"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="cf1672b4538c6d1d441f9f108aea2bf4" args="(FILE *) const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#cf1672b4538c6d1d441f9f108aea2bf4">SaveFile</a> (FILE *) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Save a file using the given FILE*. Returns true if successful. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#18ae6ed34fed7991ebc220862dfac884">LoadFile</a> (const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3d4fae0463f3f03679ba0b7cf6f2df52"></a><!-- doxytag: member="TiXmlDocument::SaveFile" ref="3d4fae0463f3f03679ba0b7cf6f2df52" args="(const std::string &filename) const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#3d4fae0463f3f03679ba0b7cf6f2df52">SaveFile</a> (const std::string &filename) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">< STL std::string version. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">Parse</a> (const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the given null terminated block of xml data. <a href="#17ebabe36926ef398e78dec0d0ad0378"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">RootElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the root element -- the only top level element -- of the document. <a href="#d09d17927f908f40efb406af2fb873be"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If an error occurs, Error will be set to true. <a href="#6dfc01a6e5d58e56acd537dfd3bdeb29"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9d0f689f6e09ea494ea547be8d79c25e"></a><!-- doxytag: member="TiXmlDocument::ErrorDesc" ref="9d0f689f6e09ea494ea547be8d79c25e" args="() const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Contains a textual (english) description of the error if one occurs. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc()</a> ). <a href="#f96fc2f3f9ec6422782bfe916c9e778f"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the location (if known) of the error. <a href="#f30efc75e804aa2e92fb8be3a8cb676e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a90bc630ee5203c6109ca5fad3323649"></a><!-- doxytag: member="TiXmlDocument::ErrorCol" ref="a90bc630ee5203c6109ca5fad3323649" args="() const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The column where the error occured. See <a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow()</a>. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a> (int _tabsize)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol()</a>) to report the correct values for row and column. <a href="#51dac56316f89b35bdb7d0d433ba988e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">ClearError</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">If you have handled the error, it can be reset with this call. <a href="#c66b8c28db86363315712a3574e87c35"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f08389ec70ee9b2de7f800e206a18510"></a><!-- doxytag: member="TiXmlDocument::Print" ref="f08389ec70ee9b2de7f800e206a18510" args="() const " --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">Print</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Write the document to standard out using formatted printing ("pretty print"). <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8701fda1fa31b25abbc9c0df42da10e8"></a><!-- doxytag: member="TiXmlDocument::Print" ref="8701fda1fa31b25abbc9c0df42da10e8" args="(FILE *cfile, int depth=0) const " --> +virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#8701fda1fa31b25abbc9c0df42da10e8">Print</a> (FILE *cfile, int depth=0) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Print this Document to a FILE stream. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1dc977bde3e4fe85a8eb9d88a35ef5a4"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="1dc977bde3e4fe85a8eb9d88a35ef5a4" args="() const " --> +virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1025d942a1f328fd742d545e37efdd42"></a><!-- doxytag: member="TiXmlDocument::ToDocument" ref="1025d942a1f328fd742d545e37efdd42" args="()" --> +virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#1025d942a1f328fd742d545e37efdd42">ToDocument</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a545aae325d9752ad64120bc4ecf939a"></a><!-- doxytag: member="TiXmlDocument::Accept" ref="a545aae325d9752ad64120bc4ecf939a" args="(TiXmlVisitor *content) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an exact duplicate of this node and return it. <a href="#4968661cab4a1f44a23329c6f8db1907"></a><br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Always the top level node. +<p> +A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="c66b8c28db86363315712a3574e87c35"></a><!-- doxytag: member="TiXmlDocument::ClearError" ref="c66b8c28db86363315712a3574e87c35" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlDocument::ClearError </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +If you have handled the error, it can be reset with this call. +<p> +The error state is automatically cleared if you Parse a new XML block. +</div> +</div><p> +<a class="anchor" name="4968661cab4a1f44a23329c6f8db1907"></a><!-- doxytag: member="TiXmlDocument::Clone" ref="4968661cab4a1f44a23329c6f8db1907" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlDocument::Clone </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [protected, virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Create an exact duplicate of this node and return it. +<p> +The memory must be deleted by the caller. +<p> +Implements <a class="el" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a>. +</div> +</div><p> +<a class="anchor" name="6dfc01a6e5d58e56acd537dfd3bdeb29"></a><!-- doxytag: member="TiXmlDocument::Error" ref="6dfc01a6e5d58e56acd537dfd3bdeb29" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool TiXmlDocument::Error </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +If an error occurs, Error will be set to true. +<p> +Also,<ul> +<li>The <a class="el" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">ErrorId()</a> will contain the integer identifier of the error (not generally useful)</li><li>The <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc()</a> method will return the name of the error. (very useful)</li><li>The <a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol()</a> will return the location of the error (if known) </li></ul> + +</div> +</div><p> +<a class="anchor" name="f96fc2f3f9ec6422782bfe916c9e778f"></a><!-- doxytag: member="TiXmlDocument::ErrorId" ref="f96fc2f3f9ec6422782bfe916c9e778f" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlDocument::ErrorId </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Generally, you probably want the error string ( <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc()</a> ). +<p> +But if you prefer the ErrorId, this function will fetch it. +</div> +</div><p> +<a class="anchor" name="f30efc75e804aa2e92fb8be3a8cb676e"></a><!-- doxytag: member="TiXmlDocument::ErrorRow" ref="f30efc75e804aa2e92fb8be3a8cb676e" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlDocument::ErrorRow </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Returns the location (if known) of the error. +<p> +The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)<p> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a>, <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>, <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="18ae6ed34fed7991ebc220862dfac884"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="18ae6ed34fed7991ebc220862dfac884" args="(const std::string &filename, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool TiXmlDocument::LoadFile </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>filename</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">TiXmlEncoding </td> + <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<dl compact><dt><b>Parameters: </b></dt><dd> +<table border="0" cellspacing="2" cellpadding="0"> +<tr><td valign="top"><em>encoding</em> </td><td> +STL std::string version. </td></tr> +</table> +</dl> +</div> +</div><p> +<a class="anchor" name="41f6fe7200864d1dca663d230caf8db6"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="41f6fe7200864d1dca663d230caf8db6" args="(FILE *, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool TiXmlDocument::LoadFile </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname">, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">TiXmlEncoding </td> + <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Load a file using the given FILE*. +<p> +Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE* will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. +</div> +</div><p> +<a class="anchor" name="4c852a889c02cf251117fd1d9fe1845f"></a><!-- doxytag: member="TiXmlDocument::LoadFile" ref="4c852a889c02cf251117fd1d9fe1845f" args="(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">bool TiXmlDocument::LoadFile </td> + <td>(</td> + <td class="paramtype">TiXmlEncoding </td> + <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Load a file using the current document value. +<p> +Returns true if successful. Will delete any existing document data before loading. +</div> +</div><p> +<a class="anchor" name="17ebabe36926ef398e78dec0d0ad0378"></a><!-- doxytag: member="TiXmlDocument::Parse" ref="17ebabe36926ef398e78dec0d0ad0378" args="(const char *p, TiXmlParsingData *data=0, TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual const char* TiXmlDocument::Parse </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>p</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">TiXmlParsingData * </td> + <td class="paramname"> <em>data</em> = <code>0</code>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">TiXmlEncoding </td> + <td class="paramname"> <em>encoding</em> = <code>TIXML_DEFAULT_ENCODING</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Parse the given null terminated block of xml data. +<p> +Passing in an encoding to this method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. +<p> +Implements <a class="el" href="classTiXmlBase.html">TiXmlBase</a>. +</div> +</div><p> +<a class="anchor" name="d09d17927f908f40efb406af2fb873be"></a><!-- doxytag: member="TiXmlDocument::RootElement" ref="d09d17927f908f40efb406af2fb873be" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlDocument::RootElement </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Get the root element -- the only top level element -- of the document. +<p> +In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. +</div> +</div><p> +<a class="anchor" name="51dac56316f89b35bdb7d0d433ba988e"></a><!-- doxytag: member="TiXmlDocument::SetTabSize" ref="51dac56316f89b35bdb7d0d433ba988e" args="(int _tabsize)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlDocument::SetTabSize </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>_tabsize</em> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize()</a> allows the error reporting functions (<a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow()</a> and <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol()</a>) to report the correct values for row and column. +<p> +It does not change the output or input in any way.<p> +By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.<p> +The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.<p> +Note that row and column tracking is not supported when using operator>>.<p> +The tab size needs to be enabled before the parse or load. Correct usage: <div class="fragment"><pre class="fragment"> TiXmlDocument doc; + doc.SetTabSize( 8 ); + doc.Load( "myfile.xml" ); + </pre></div><p> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>, <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a> </dd></dl> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlDocument.png b/shared/tinyxml/docs/classTiXmlDocument.png Binary files differnew file mode 100644 index 00000000..32fd267e --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlDocument.png diff --git a/shared/tinyxml/docs/classTiXmlElement-members.html b/shared/tinyxml/docs/classTiXmlElement-members.html new file mode 100644 index 00000000..ece5255d --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlElement-members.html @@ -0,0 +1,116 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlElement Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlElement.html">TiXmlElement</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">Accept</a>(TiXmlVisitor *visitor) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>(const char *name) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#0ed8348fdc56b72a6b4900ce5bac1849">Attribute</a>(const char *name, int *i) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#eaff99d4f0ea5b34f7aee202aad457ba">Attribute</a>(const char *name, double *d) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">Clone</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">LastAttribute</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a>(const char *name, double *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a>(const char *name, float *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a>(const char *name, int *_value) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a>(const std::string &name, T *outValue) const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#56979767deca794376b1dfa69a525b2a">RemoveAttribute</a>(const char *name)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#1afa6aea716511326a608e4c05df4f3a">RemoveAttribute</a>(const std::string &name)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>(const char *name, const char *_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#80ed65b1d194c71c6c9986ae42337d7d">SetAttribute</a>(const std::string &name, const std::string &_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#ce6f4be75e373726d4774073d666d1a7">SetAttribute</a>(const char *name, int value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a>(const char *name, double value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a>(const char *in_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#c5b8d0e25fa23fd9acbb6d146082901c">ToElement</a>() const </td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlElement.html#9def86337ea7a755eb41cac980f60c7a">ToElement</a>()</td><td><a class="el" href="classTiXmlElement.html">TiXmlElement</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlElement.html b/shared/tinyxml/docs/classTiXmlElement.html new file mode 100644 index 00000000..dcbd2515 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlElement.html @@ -0,0 +1,420 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlElement Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlElement Class Reference</h1><!-- doxytag: class="TiXmlElement" --><!-- doxytag: inherits="TiXmlNode" -->The element is a container class. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlElement: +<p><center><img src="classTiXmlElement.png" usemap="#TiXmlElement_map" border="0" alt=""></center> +<map name="TiXmlElement_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,87,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,87,24"> +</map> +<a href="classTiXmlElement-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="01bc3ab372d35da08efcbbe65ad90c60"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="01bc3ab372d35da08efcbbe65ad90c60" args="(const char *in_value)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a> (const char *in_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Construct an element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="40fc2e3c1a955e2f78e1a32350d180e7"></a><!-- doxytag: member="TiXmlElement::TiXmlElement" ref="40fc2e3c1a955e2f78e1a32350d180e7" args="(const std::string &_value)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">std::string constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e419a442a9701a62b0c3d8fd1cbdd12d"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="e419a442a9701a62b0c3d8fd1cbdd12d" args="(const char *name) const " --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a> (const char *name) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#0ed8348fdc56b72a6b4900ce5bac1849">Attribute</a> (const char *name, int *i) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <a href="#0ed8348fdc56b72a6b4900ce5bac1849"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#eaff99d4f0ea5b34f7aee202aad457ba">Attribute</a> (const char *name, double *d) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Given an attribute name, <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> returns the value for the attribute of that name, or null if none exists. <a href="#eaff99d4f0ea5b34f7aee202aad457ba"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a> (const char *name, int *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> method with richer error checking. <a href="#ea0bfe471380f281c5945770ddbf52b9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="898d7730ecc341f0bffc7a9dadbf1ce7"></a><!-- doxytag: member="TiXmlElement::QueryDoubleAttribute" ref="898d7730ecc341f0bffc7a9dadbf1ce7" args="(const char *name, double *_value) const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a> (const char *name, double *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryDoubleAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute()</a>. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a04d3af11601ef5a5f88295203a843be"></a><!-- doxytag: member="TiXmlElement::QueryFloatAttribute" ref="a04d3af11601ef5a5f88295203a843be" args="(const char *name, float *_value) const " --> +int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a> (const char *name, float *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">QueryFloatAttribute examines the attribute - see <a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute()</a>. <br></td></tr> +<tr><td class="memTemplParams" nowrap colspan="2">template<typename T> </td></tr> +<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">int </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a> (const std::string &name, T *outValue) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Template form of the attribute query which will try to read the attribute into the specified type. <a href="#e3b9a03b0a56663a40801c7256683576"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a> (const char *name, const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#bf0b3bd7f0e4c746a89ec6e7f101fc32"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="80ed65b1d194c71c6c9986ae42337d7d"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="80ed65b1d194c71c6c9986ae42337d7d" args="(const std::string &name, const std::string &_value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#80ed65b1d194c71c6c9986ae42337d7d">SetAttribute</a> (const std::string &name, const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#ce6f4be75e373726d4774073d666d1a7">SetAttribute</a> (const char *name, int value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#ce6f4be75e373726d4774073d666d1a7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a> (const char *name, double value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets an attribute of name to a given value. <a href="#0d1dd975d75496778177e35abfe0ec0b"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="56979767deca794376b1dfa69a525b2a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="56979767deca794376b1dfa69a525b2a" args="(const char *name)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#56979767deca794376b1dfa69a525b2a">RemoveAttribute</a> (const char *name)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes an attribute with the given name. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1afa6aea716511326a608e4c05df4f3a"></a><!-- doxytag: member="TiXmlElement::RemoveAttribute" ref="1afa6aea716511326a608e4c05df4f3a" args="(const std::string &name)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#1afa6aea716511326a608e4c05df4f3a">RemoveAttribute</a> (const std::string &name)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="516054c9073647d6cb29b6abe9fa0592"></a><!-- doxytag: member="TiXmlElement::FirstAttribute" ref="516054c9073647d6cb29b6abe9fa0592" args="() const " --> +const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Access the first attribute in this element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="86191b49f9177be132b85b14655f1381"></a><!-- doxytag: member="TiXmlElement::LastAttribute" ref="86191b49f9177be132b85b14655f1381" args="() const " --> +const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">LastAttribute</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Access the last attribute in this element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function for easy access to the text inside an element. <a href="#f3282294986cdb216646ea1f67af2c87"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a464535ea1994db337cb6a8ce4b588b5"></a><!-- doxytag: member="TiXmlElement::Clone" ref="a464535ea1994db337cb6a8ce4b588b5" args="() const " --> +virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new Element and returns it - the returned element is a copy. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#fbf52736e70fc91ec9d760721d6f4fd2"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c5b8d0e25fa23fd9acbb6d146082901c"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="c5b8d0e25fa23fd9acbb6d146082901c" args="() const " --> +virtual const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#c5b8d0e25fa23fd9acbb6d146082901c">ToElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9def86337ea7a755eb41cac980f60c7a"></a><!-- doxytag: member="TiXmlElement::ToElement" ref="9def86337ea7a755eb41cac980f60c7a" args="()" --> +virtual <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#9def86337ea7a755eb41cac980f60c7a">ToElement</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="71a81b2afb0d42be1543d1c404dee6f5"></a><!-- doxytag: member="TiXmlElement::Accept" ref="71a81b2afb0d42be1543d1c404dee6f5" args="(TiXmlVisitor *visitor) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +The element is a container class. +<p> +It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes. +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="eaff99d4f0ea5b34f7aee202aad457ba"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="eaff99d4f0ea5b34f7aee202aad457ba" args="(const char *name, double *d) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const char* TiXmlElement::Attribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double * </td> + <td class="paramname"> <em>d</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Given an attribute name, <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> returns the value for the attribute of that name, or null if none exists. +<p> +If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null. +</div> +</div><p> +<a class="anchor" name="0ed8348fdc56b72a6b4900ce5bac1849"></a><!-- doxytag: member="TiXmlElement::Attribute" ref="0ed8348fdc56b72a6b4900ce5bac1849" args="(const char *name, int *i) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const char* TiXmlElement::Attribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int * </td> + <td class="paramname"> <em>i</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Given an attribute name, <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> returns the value for the attribute of that name, or null if none exists. +<p> +If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null. +</div> +</div><p> +<a class="anchor" name="f3282294986cdb216646ea1f67af2c87"></a><!-- doxytag: member="TiXmlElement::GetText" ref="f3282294986cdb216646ea1f67af2c87" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const char* TiXmlElement::GetText </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Convenience function for easy access to the text inside an element. +<p> +Although easy and concise, <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText()</a> is limited compared to getting the <a class="el" href="classTiXmlText.html">TiXmlText</a> child and accessing it directly.<p> +If the first child of 'this' is a <a class="el" href="classTiXmlText.html">TiXmlText</a>, the <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText()</a> returns the character string of the Text node, else null is returned.<p> +This is a convenient method for getting the text of simple contained text: <div class="fragment"><pre class="fragment"> <foo>This is text</foo> + const char* str = fooElement->GetText(); + </pre></div><p> +'str' will be a pointer to "This is text".<p> +Note that this function can be misleading. If the element foo was created from this XML: <div class="fragment"><pre class="fragment"> <foo><b>This is text</b></foo> + </pre></div><p> +then the value of str would be null. The first child node isn't a text node, it is another element. From this XML: <div class="fragment"><pre class="fragment"> <foo>This is <b>text</b></foo> + </pre></div> <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText()</a> will return "This is ".<p> +WARNING: <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText()</a> accesses a child node - don't become confused with the similarly named <a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">TiXmlHandle::Text()</a> and <a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">TiXmlNode::ToText()</a> which are safe type casts on the referenced node. +</div> +</div><p> +<a class="anchor" name="fbf52736e70fc91ec9d760721d6f4fd2"></a><!-- doxytag: member="TiXmlElement::Print" ref="fbf52736e70fc91ec9d760721d6f4fd2" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlElement::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<a class="anchor" name="ea0bfe471380f281c5945770ddbf52b9"></a><!-- doxytag: member="TiXmlElement::QueryIntAttribute" ref="ea0bfe471380f281c5945770ddbf52b9" args="(const char *name, int *_value) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlElement::QueryIntAttribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int * </td> + <td class="paramname"> <em>_value</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +QueryIntAttribute examines the attribute - it is an alternative to the <a class="el" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute()</a> method with richer error checking. +<p> +If the attribute is an integer, it is stored in 'value' and the call returns TIXML_SUCCESS. If it is not an integer, it returns TIXML_WRONG_TYPE. If the attribute does not exist, then TIXML_NO_ATTRIBUTE is returned. +</div> +</div><p> +<a class="anchor" name="e3b9a03b0a56663a40801c7256683576"></a><!-- doxytag: member="TiXmlElement::QueryValueAttribute" ref="e3b9a03b0a56663a40801c7256683576" args="(const std::string &name, T *outValue) const " --> +<div class="memitem"> +<div class="memproto"> +<div class="memtemplate"> +template<typename T> </div> + <table class="memname"> + <tr> + <td class="memname">int TiXmlElement::QueryValueAttribute </td> + <td>(</td> + <td class="paramtype">const std::string & </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">T * </td> + <td class="paramname"> <em>outValue</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Template form of the attribute query which will try to read the attribute into the specified type. +<p> +Very easy, very powerful, but be careful to make sure to call this with the correct type.<p> +NOTE: This method doesn't work correctly for 'string' types.<p> +<dl compact><dt><b>Returns:</b></dt><dd>TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE </dd></dl> + +</div> +</div><p> +<a class="anchor" name="ce6f4be75e373726d4774073d666d1a7"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="ce6f4be75e373726d4774073d666d1a7" args="(const char *name, int value)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlElement::SetAttribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>value</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets an attribute of name to a given value. +<p> +The attribute will be created if it does not exist, or changed if it does. +</div> +</div><p> +<a class="anchor" name="bf0b3bd7f0e4c746a89ec6e7f101fc32"></a><!-- doxytag: member="TiXmlElement::SetAttribute" ref="bf0b3bd7f0e4c746a89ec6e7f101fc32" args="(const char *name, const char *_value)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlElement::SetAttribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>_value</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets an attribute of name to a given value. +<p> +The attribute will be created if it does not exist, or changed if it does. +</div> +</div><p> +<a class="anchor" name="0d1dd975d75496778177e35abfe0ec0b"></a><!-- doxytag: member="TiXmlElement::SetDoubleAttribute" ref="0d1dd975d75496778177e35abfe0ec0b" args="(const char *name, double value)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlElement::SetDoubleAttribute </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"> <em>value</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Sets an attribute of name to a given value. +<p> +The attribute will be created if it does not exist, or changed if it does. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlElement.png b/shared/tinyxml/docs/classTiXmlElement.png Binary files differnew file mode 100644 index 00000000..5acc21bd --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlElement.png diff --git a/shared/tinyxml/docs/classTiXmlHandle-members.html b/shared/tinyxml/docs/classTiXmlHandle-members.html new file mode 100644 index 00000000..77ed5bab --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlHandle-members.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlHandle Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a>(const char *value, int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#f9cf6a7d08a5da94a8924425ad0cd5ac">Child</a>(int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a>(const char *value, int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#8786475b9d1f1518492e3a46704c7ef0">ChildElement</a>(int index) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">Element</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#8c61f64ae9365d89c264f289085541f8">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#f0aea751320f5e430fac6f8fff3b8dd4">FirstChildElement</a>(const char *value) const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">Node</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">Text</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#ba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a>(TiXmlNode *_node)</td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a>(const TiXmlHandle &ref)</td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">ToNode</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">ToText</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">Unknown</a>() const </td><td><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlHandle.html b/shared/tinyxml/docs/classTiXmlHandle.html new file mode 100644 index 00000000..3808e66f --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlHandle.html @@ -0,0 +1,419 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlHandle Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlHandle Class Reference</h1><!-- doxytag: class="TiXmlHandle" -->A <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<a href="classTiXmlHandle-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ba18fd7bdefb942ecdea4bf4b8e29ec8"></a><!-- doxytag: member="TiXmlHandle::TiXmlHandle" ref="ba18fd7bdefb942ecdea4bf4b8e29ec8" args="(TiXmlNode *_node)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#ba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *_node)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from any node (at any depth of the tree.) This can be a null pointer. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="236d7855e1e56ccc7b980630c48c7fd7"></a><!-- doxytag: member="TiXmlHandle::TiXmlHandle" ref="236d7855e1e56ccc7b980630c48c7fd7" args="(const TiXmlHandle &ref)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a> (const <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> &ref)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cdb1faaf88a700b40ca2c8d9aee21139"></a><!-- doxytag: member="TiXmlHandle::FirstChild" ref="cdb1faaf88a700b40ca2c8d9aee21139" args="() const " --> +<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8c61f64ae9365d89c264f289085541f8"></a><!-- doxytag: member="TiXmlHandle::FirstChild" ref="8c61f64ae9365d89c264f289085541f8" args="(const char *value) const " --> +<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#8c61f64ae9365d89c264f289085541f8">FirstChild</a> (const char *value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child node with the given name. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="24d1112e995e937e4dddb202d4113d4a"></a><!-- doxytag: member="TiXmlHandle::FirstChildElement" ref="24d1112e995e937e4dddb202d4113d4a" args="() const " --> +<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f0aea751320f5e430fac6f8fff3b8dd4"></a><!-- doxytag: member="TiXmlHandle::FirstChildElement" ref="f0aea751320f5e430fac6f8fff3b8dd4" args="(const char *value) const " --> +<a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#f0aea751320f5e430fac6f8fff3b8dd4">FirstChildElement</a> (const char *value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the first child element with the given name. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a> (const char *value, int index) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child with the given name. <a href="#072492b4be1acdb0db2d03cd8f71ccc4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#f9cf6a7d08a5da94a8924425ad0cd5ac">Child</a> (int index) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child. <a href="#f9cf6a7d08a5da94a8924425ad0cd5ac"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a> (const char *value, int index) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child element with the given name. <a href="#979a3f850984a176ee884e394c7eed2d"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#8786475b9d1f1518492e3a46704c7ef0">ChildElement</a> (int index) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a handle to the "index" child element. <a href="#8786475b9d1f1518492e3a46704c7ef0"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">ToNode</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. <a href="#f678e5088e83be67baf76f699756f2c3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlElement.html">TiXmlElement</a>. <a href="#bc6e7ed383a5fe1e52b0c0004b457b9e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">ToText</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlText.html">TiXmlText</a>. <a href="#4ac53a652296203a5b5e13854d923586"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">ToUnknown</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the handle as a <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>. <a href="#1381c17507a130767b1e23afc93b3674"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">Node</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">Element</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">Text</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">Unknown</a> () const </td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> is a class that wraps a node pointer with null checks; this is an incredibly useful thing. +<p> +Note that <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> is not part of the TinyXml DOM structure. It is a separate utility class.<p> +Take an example: <div class="fragment"><pre class="fragment"> <Document> + <Element attributeA = "valueA"> + <Child attributeB = "value1" /> + <Child attributeB = "value2" /> + </Element> + <Document> + </pre></div><p> +Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very easy to write a *lot* of code that looks like:<p> +<div class="fragment"><pre class="fragment"> TiXmlElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + </pre></div><p> +And that doesn't even cover "else" cases. <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> addresses the verbosity of such code. A <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> checks for null pointers so it is perfectly safe and correct to use:<p> +<div class="fragment"><pre class="fragment"> TiXmlHandle docHandle( &document ); + TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); + if ( child2 ) + { + // do something useful + </pre></div><p> +Which is MUCH more concise and useful.<p> +It is also safe to copy handles - internally they are nothing more than node pointers. <div class="fragment"><pre class="fragment"> TiXmlHandle handleCopy = handle; + </pre></div><p> +What they should not be used for is iteration:<p> +<div class="fragment"><pre class="fragment"> int i=0; + while ( true ) + { + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); + if ( !child ) + break; + // do something + ++i; + } + </pre></div><p> +It seems reasonable, but it is in fact two embedded while loops. The Child method is a linear walk to find the element, so this code would iterate much more than it needs to. Instead, prefer:<p> +<div class="fragment"><pre class="fragment"> TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); + + for( child; child; child=child->NextSiblingElement() ) + { + // do something + } + </pre></div> +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="f9cf6a7d08a5da94a8924425ad0cd5ac"></a><!-- doxytag: member="TiXmlHandle::Child" ref="f9cf6a7d08a5da94a8924425ad0cd5ac" args="(int index) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::Child </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>index</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return a handle to the "index" child. +<p> +The first child is 0, the second 1, etc. +</div> +</div><p> +<a class="anchor" name="072492b4be1acdb0db2d03cd8f71ccc4"></a><!-- doxytag: member="TiXmlHandle::Child" ref="072492b4be1acdb0db2d03cd8f71ccc4" args="(const char *value, int index) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::Child </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>index</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return a handle to the "index" child with the given name. +<p> +The first child is 0, the second 1, etc. +</div> +</div><p> +<a class="anchor" name="8786475b9d1f1518492e3a46704c7ef0"></a><!-- doxytag: member="TiXmlHandle::ChildElement" ref="8786475b9d1f1518492e3a46704c7ef0" args="(int index) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::ChildElement </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>index</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return a handle to the "index" child element. +<p> +The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. +</div> +</div><p> +<a class="anchor" name="979a3f850984a176ee884e394c7eed2d"></a><!-- doxytag: member="TiXmlHandle::ChildElement" ref="979a3f850984a176ee884e394c7eed2d" args="(const char *value, int index) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> TiXmlHandle::ChildElement </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>index</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return a handle to the "index" child element with the given name. +<p> +The first child element is 0, the second 1, etc. Note that only TiXmlElements are indexed: other types are not counted. +</div> +</div><p> +<a class="anchor" name="cb5fe8388a526289ea65e817a51e05e7"></a><!-- doxytag: member="TiXmlHandle::Element" ref="cb5fe8388a526289ea65e817a51e05e7" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlHandle::Element </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>use ToElement. Return the handle as a <a class="el" href="classTiXmlElement.html">TiXmlElement</a>. This may return null. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="b44b723a8dc9af72838a303c079d0376"></a><!-- doxytag: member="TiXmlHandle::Node" ref="b44b723a8dc9af72838a303c079d0376" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlHandle::Node </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>use ToNode. Return the handle as a <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. This may return null. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="9fc739c8a18d160006f82572fc143d13"></a><!-- doxytag: member="TiXmlHandle::Text" ref="9fc739c8a18d160006f82572fc143d13" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlText.html">TiXmlText</a>* TiXmlHandle::Text </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>use <a class="el" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">ToText()</a> Return the handle as a <a class="el" href="classTiXmlText.html">TiXmlText</a>. This may return null. </dd></dl> + +</div> +</div><p> +<a class="anchor" name="bc6e7ed383a5fe1e52b0c0004b457b9e"></a><!-- doxytag: member="TiXmlHandle::ToElement" ref="bc6e7ed383a5fe1e52b0c0004b457b9e" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlHandle::ToElement </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return the handle as a <a class="el" href="classTiXmlElement.html">TiXmlElement</a>. +<p> +This may return null. +</div> +</div><p> +<a class="anchor" name="f678e5088e83be67baf76f699756f2c3"></a><!-- doxytag: member="TiXmlHandle::ToNode" ref="f678e5088e83be67baf76f699756f2c3" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlHandle::ToNode </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return the handle as a <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. +<p> +This may return null. +</div> +</div><p> +<a class="anchor" name="4ac53a652296203a5b5e13854d923586"></a><!-- doxytag: member="TiXmlHandle::ToText" ref="4ac53a652296203a5b5e13854d923586" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlText.html">TiXmlText</a>* TiXmlHandle::ToText </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return the handle as a <a class="el" href="classTiXmlText.html">TiXmlText</a>. +<p> +This may return null. +</div> +</div><p> +<a class="anchor" name="1381c17507a130767b1e23afc93b3674"></a><!-- doxytag: member="TiXmlHandle::ToUnknown" ref="1381c17507a130767b1e23afc93b3674" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>* TiXmlHandle::ToUnknown </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return the handle as a <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>. +<p> +This may return null. +</div> +</div><p> +<a class="anchor" name="49675b74357ba2aae124657a9a1ef465"></a><!-- doxytag: member="TiXmlHandle::Unknown" ref="49675b74357ba2aae124657a9a1ef465" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>* TiXmlHandle::Unknown </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>use <a class="el" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">ToUnknown()</a> Return the handle as a <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>. This may return null. </dd></dl> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlNode-members.html b/shared/tinyxml/docs/classTiXmlNode-members.html new file mode 100644 index 00000000..b7c9ecf5 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlNode-members.html @@ -0,0 +1,98 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlNode Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlNode.html">TiXmlNode</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">Accept</a>(TiXmlVisitor *visitor) const =0</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [pure virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">Clone</a>() const =0</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [pure virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">Print</a>(FILE *cfile, int depth) const =0</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [pure virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlNode.html b/shared/tinyxml/docs/classTiXmlNode.html new file mode 100644 index 00000000..b64a0d60 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlNode.html @@ -0,0 +1,780 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlNode Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlNode Class Reference</h1><!-- doxytag: class="TiXmlNode" --><!-- doxytag: inherits="TiXmlBase" -->The parent class for everything in the Document Object Model. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlNode: +<p><center><img src="classTiXmlNode.png" usemap="#TiXmlNode_map" border="0" alt=""></center> +<map name="TiXmlNode_map"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="295,0,403,24"> +<area href="classTiXmlComment.html" alt="TiXmlComment" shape="rect" coords="0,112,108,136"> +<area href="classTiXmlDeclaration.html" alt="TiXmlDeclaration" shape="rect" coords="118,112,226,136"> +<area href="classTiXmlDocument.html" alt="TiXmlDocument" shape="rect" coords="236,112,344,136"> +<area href="classTiXmlElement.html" alt="TiXmlElement" shape="rect" coords="354,112,462,136"> +<area href="classTiXmlText.html" alt="TiXmlText" shape="rect" coords="472,112,580,136"> +<area href="classTiXmlUnknown.html" alt="TiXmlUnknown" shape="rect" coords="590,112,698,136"> +</map> +<a href="classTiXmlNode-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The types of XML nodes supported by TinyXml. <a href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">More...</a><br></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The meaning of 'value' changes for the specific type of <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. <a href="#77943eb90d12c2892b1337a9f5918b41"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return <a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value()</a> as a std::string. <a href="#6d9e505619d39bf50bfd9609c9169ea5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a> (const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Changes the value of the node. <a href="#2a38329ca5d3f28f98ce932b8299ae90"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2598d5f448042c1abbeae4503dd45ff2"></a><!-- doxytag: member="TiXmlNode::SetValue" ref="2598d5f448042c1abbeae4503dd45ff2" args="(const std::string &_value)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="708e7f953df61d4d2d12f73171550a4b"></a><!-- doxytag: member="TiXmlNode::Clear" ref="708e7f953df61d4d2d12f73171550a4b" args="()" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete all the children of this node. Does not affect 'this'. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b643043132ffd794f8602685d34a982e"></a><!-- doxytag: member="TiXmlNode::Parent" ref="b643043132ffd794f8602685d34a982e" args="()" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">One step up the DOM. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="44c8eee26bbe2d1b2762038df9dde2f0"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="44c8eee26bbe2d1b2762038df9dde2f0" args="() const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node. Will be null if there are no children. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a> (const char *value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node with the matching 'value'. <a href="#1f05828d023150706eeb16d6fb3f6355"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bc8bf32be6419ec453a731868de19554"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="bc8bf32be6419ec453a731868de19554" args="(const char *_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a> (const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The first child of this node with the matching 'value'. Will be null if none found. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6432d2b2495f6caf9cb4278df706a031"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="6432d2b2495f6caf9cb4278df706a031" args="()" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The last child of this node. Will be null if there are no children. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bad5bf1059c48127b958711ef89e8e5d"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="bad5bf1059c48127b958711ef89e8e5d" args="(const char *_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a> (const char *_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The last child of this node matching 'value'. Will be null if there are no children. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07f6200a5956c723c5b52d70f29c46f6"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="07f6200a5956c723c5b52d70f29c46f6" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="10d2669ccb5e29e02fcb0e4408685ef6"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="10d2669ccb5e29e02fcb0e4408685ef6" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="256d0cdbfcfeccae83f3a1c9747a8b63"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="256d0cdbfcfeccae83f3a1c9747a8b63" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="69772c9202f70553f940b15c06b07be3"></a><!-- doxytag: member="TiXmlNode::LastChild" ref="69772c9202f70553f940b15c06b07be3" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a> (const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">An alternate way to walk the children of a node. <a href="#8621196ba3705fa226bef4a761cc51b6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dfaef35a076b9343adc1420757376c39"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="dfaef35a076b9343adc1420757376c39" args="(const char *value, const TiXmlNode *previous) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a> (const char *value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This flavor of IterateChildren searches for children with a particular 'value'. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1cbaaf8e82c09ad763d52616d75724df"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="1cbaaf8e82c09ad763d52616d75724df" args="(const std::string &_value, const TiXmlNode *previous) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a> (const std::string &_value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="16e9ad53e2f5445b14bf325c90aa862c"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="16e9ad53e2f5445b14bf325c90aa862c" args="(const std::string &_value, const TiXmlNode *previous)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a> (const std::string &_value, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> *previous)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a> (const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this. <a href="#d7d4630e1a2a916edda16be22448a8ba"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *addThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this. <a href="#5d29442ae46de6d0168429156197bfc6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *beforeThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this. <a href="#0c146fa2fff0157b681594102f48cbc7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *afterThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &addThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Add a new node related to this. <a href="#d9b75e54ec19301c8b4d5ff583d0b3d5"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *replaceThis, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &withThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Replace a child of this node. <a href="#0c49e739a17b9938050c22cd89617fbd"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e19d8510efc90596552f4feeac9a8fbf"></a><!-- doxytag: member="TiXmlNode::RemoveChild" ref="e19d8510efc90596552f4feeac9a8fbf" args="(TiXmlNode *removeThis)" --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a> (<a class="el" href="classTiXmlNode.html">TiXmlNode</a> *removeThis)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a child of this node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c2cd892768726270e511b2ab32de4d10"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="c2cd892768726270e511b2ab32de4d10" args="() const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5bdd49327eec1e609b7d22af706b8316"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="5bdd49327eec1e609b7d22af706b8316" args="(const char *) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a> (const char *) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="658276f57d35d5d4256d1dc1a2c398ab"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="658276f57d35d5d4256d1dc1a2c398ab" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cc8a0434c7f401d4a3b6dee77c1a5912"></a><!-- doxytag: member="TiXmlNode::PreviousSibling" ref="cc8a0434c7f401d4a3b6dee77c1a5912" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1b94d2f7fa7ab25a5a8e8d4340c449c9"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="1b94d2f7fa7ab25a5a8e8d4340c449c9" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1757c1f4d01e8c9596ffdbd561c76aea"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="1757c1f4d01e8c9596ffdbd561c76aea" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f854baeba384f5fe9859f5aee03b548e"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="f854baeba384f5fe9859f5aee03b548e" args="() const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2e61c0b89a77e36a0e8c60490003cb46"></a><!-- doxytag: member="TiXmlNode::NextSibling" ref="2e61c0b89a77e36a0e8c60490003cb46" args="(const char *) const " --> +const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a> (const char *) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Navigate to a sibling node with the given 'value'. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <a href="#73acf929d49d10bd0e5fb3d31b0372d1"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a> (const char *) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <a href="#071ba77fd7ab79402fa84b7e9b8607b3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7572d0af9d1e696ee3f05d8bb5ebb463"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="7572d0af9d1e696ee3f05d8bb5ebb463" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="506958e34406729a4e4c5326ea39d081"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="506958e34406729a4e4c5326ea39d081" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f4fb652f6bd79ae0d5ce7d0f7d3c0fba"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="f4fb652f6bd79ae0d5ce7d0f7d3c0fba" args="() const " --> +const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ccda2c6b45c25bb5a6f9c3407a644e61"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="ccda2c6b45c25bb5a6f9c3407a644e61" args="(const char *_value) const " --> +const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a> (const char *_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convenience function to get through elements. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="327ad4bbd90073c5dfc931b07314f5f7"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="327ad4bbd90073c5dfc931b07314f5f7" args="(const std::string &_value) const " --> +const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a> (const std::string &_value) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7f1d7291880534c1e5cdeb392d8c1f45"></a><!-- doxytag: member="TiXmlNode::FirstChildElement" ref="7f1d7291880534c1e5cdeb392d8c1f45" args="(const std::string &_value)" --> +<a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a> (const std::string &_value)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">STL std::string form. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the type (as an enumerated value, above) of this node. <a href="#57b99d5c97d67a42b9752f5210a1ba5e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return a pointer to the Document this node lives in. <a href="#80e397fa973cf5323e33b07154b024f3"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="eed21ad30630ef6e7faf096127edc9f3"></a><!-- doxytag: member="TiXmlNode::NoChildren" ref="eed21ad30630ef6e7faf096127edc9f3" args="() const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if this node has no children. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8a4cda4b15c29f64cff419309aebed08"></a><!-- doxytag: member="TiXmlNode::ToDocument" ref="8a4cda4b15c29f64cff419309aebed08" args="() const " --> +virtual const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="72abed96dc9667ab9e0a2a275301bb1c"></a><!-- doxytag: member="TiXmlNode::ToElement" ref="72abed96dc9667ab9e0a2a275301bb1c" args="() const " --> +virtual const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0a5086f9eaee910bbfdc7f975e26574"></a><!-- doxytag: member="TiXmlNode::ToComment" ref="a0a5086f9eaee910bbfdc7f975e26574" args="() const " --> +virtual const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fd7205cf31d7a376929f8a36930627a2"></a><!-- doxytag: member="TiXmlNode::ToUnknown" ref="fd7205cf31d7a376929f8a36930627a2" args="() const " --> +virtual const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="95a46a52c525992d6b4ee08beb14cd69"></a><!-- doxytag: member="TiXmlNode::ToText" ref="95a46a52c525992d6b4ee08beb14cd69" args="() const " --> +virtual const <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9f43e6984fc7d4afd6eb32714c6b7b72"></a><!-- doxytag: member="TiXmlNode::ToDeclaration" ref="9f43e6984fc7d4afd6eb32714c6b7b72" args="() const " --> +virtual const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6a4c8ac28ee7a745d059db6691e03bae"></a><!-- doxytag: member="TiXmlNode::ToDocument" ref="6a4c8ac28ee7a745d059db6691e03bae" args="()" --> +virtual <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a65d000223187d22a4dcebd7479e9ebc"></a><!-- doxytag: member="TiXmlNode::ToElement" ref="a65d000223187d22a4dcebd7479e9ebc" args="()" --> +virtual <a class="el" href="classTiXmlElement.html">TiXmlElement</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="383e06a0787f7063953934867990f849"></a><!-- doxytag: member="TiXmlNode::ToComment" ref="383e06a0787f7063953934867990f849" args="()" --> +virtual <a class="el" href="classTiXmlComment.html">TiXmlComment</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="06de5af852668c7e4af0d09c205f0b0d"></a><!-- doxytag: member="TiXmlNode::ToUnknown" ref="06de5af852668c7e4af0d09c205f0b0d" args="()" --> +virtual <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3ddfbcac78fbea041fad57e5c6d60a03"></a><!-- doxytag: member="TiXmlNode::ToText" ref="3ddfbcac78fbea041fad57e5c6d60a03" args="()" --> +virtual <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4027136ca820ff4a636b607231b6a6df"></a><!-- doxytag: member="TiXmlNode::ToDeclaration" ref="4027136ca820ff4a636b607231b6a6df" args="()" --> +virtual <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null if not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">Clone</a> () const =0</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an exact duplicate of this node and return it. <a href="#4508cc3a2d7a98e96a54cc09c37a78a4"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *visitor) const =0</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Accept a hierchical visit the nodes in the TinyXML DOM. <a href="#cc0f88b7462c6cb73809d410a4f5bb86"></a><br></td></tr> +<tr><td colspan="2"><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="173617f6dfe902cf484ce5552b950475"></a><!-- doxytag: member="TiXmlNode::TiXmlDocument" ref="173617f6dfe902cf484ce5552b950475" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#173617f6dfe902cf484ce5552b950475">TiXmlDocument</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlNode::TiXmlElement" ref="b6592e32cb9132be517cc12a70564c4b" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#b6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">std::istream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a> (std::istream &in, <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">An input stream operator, for every class. <a href="#b57bd426563c926844f65a78412e18b9"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">std::ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a> (std::ostream &out, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">An output stream operator, for every class. <a href="#86cd49cfb17a844c0010b3136ac966c7"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="52ef17e7080df2490cf87bde380685ab"></a><!-- doxytag: member="TiXmlNode::operator<<" ref="52ef17e7080df2490cf87bde380685ab" args="(std::string &out, const TiXmlNode &base)" --> +std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a> (std::string &out, const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> &base)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Appends the XML node or attribute to a std::string. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +The parent class for everything in the Document Object Model. +<p> +(Except for attributes). Nodes have siblings, a parent, and children. A node can be in a document, or stand on its own. The type of a <a class="el" href="classTiXmlNode.html">TiXmlNode</a> can be queried, and it can be cast to its more defined type. +<p> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="836eded4920ab9e9ef28496f48cd95a2"></a><!-- doxytag: member="TiXmlNode::NodeType" ref="836eded4920ab9e9ef28496f48cd95a2" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">enum <a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">TiXmlNode::NodeType</a> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +The types of XML nodes supported by TinyXml. +<p> +(All the unsupported types are picked up by UNKNOWN.) +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="cc0f88b7462c6cb73809d410a4f5bb86"></a><!-- doxytag: member="TiXmlNode::Accept" ref="cc0f88b7462c6cb73809d410a4f5bb86" args="(TiXmlVisitor *visitor) const =0" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual bool TiXmlNode::Accept </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> * </td> + <td class="paramname"> <em>visitor</em> </td> + <td> ) </td> + <td width="100%"> const<code> [pure virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Accept a hierchical visit the nodes in the TinyXML DOM. +<p> +Every node in the XML tree will be conditionally visited and the host will be called back via the <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> interface.<p> +This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse the XML for the callbacks, so the performance of TinyXML is unchanged by using this interface versus any other.)<p> +The interface has been based on ideas from:<p> +<ul> +<li><a href="http://www.saxproject.org/">http://www.saxproject.org/</a></li><li><a href="http://c2.com/cgi/wiki?HierarchicalVisitorPattern">http://c2.com/cgi/wiki?HierarchicalVisitorPattern</a></li></ul> +<p> +Which are both good references for "visiting".<p> +An example of using <a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">Accept()</a>: <div class="fragment"><pre class="fragment"> TiXmlPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + </pre></div> +<p> +Implemented in <a class="el" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>. +</div> +</div><p> +<a class="anchor" name="4508cc3a2d7a98e96a54cc09c37a78a4"></a><!-- doxytag: member="TiXmlNode::Clone" ref="4508cc3a2d7a98e96a54cc09c37a78a4" args="() const =0" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::Clone </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [pure virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Create an exact duplicate of this node and return it. +<p> +The memory must be deleted by the caller. +<p> +Implemented in <a class="el" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>, <a class="el" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>, <a class="el" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">TiXmlText</a>, <a class="el" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>, and <a class="el" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>. +</div> +</div><p> +<a class="anchor" name="1f05828d023150706eeb16d6fb3f6355"></a><!-- doxytag: member="TiXmlNode::FirstChild" ref="1f05828d023150706eeb16d6fb3f6355" args="(const char *value) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::FirstChild </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>value</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +The first child of this node with the matching 'value'. +<p> +Will be null if none found. +</div> +</div><p> +<a class="anchor" name="80e397fa973cf5323e33b07154b024f3"></a><!-- doxytag: member="TiXmlNode::GetDocument" ref="80e397fa973cf5323e33b07154b024f3" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>* TiXmlNode::GetDocument </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return a pointer to the Document this node lives in. +<p> +Returns null if not in a document. +</div> +</div><p> +<a class="anchor" name="d9b75e54ec19301c8b4d5ff583d0b3d5"></a><!-- doxytag: member="TiXmlNode::InsertAfterChild" ref="d9b75e54ec19301c8b4d5ff583d0b3d5" args="(TiXmlNode *afterThis, const TiXmlNode &addThis)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertAfterChild </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td> + <td class="paramname"> <em>afterThis</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>addThis</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Add a new node related to this. +<p> +Adds a child after the specified child. Returns a pointer to the new object or NULL if an error occured. +</div> +</div><p> +<a class="anchor" name="0c146fa2fff0157b681594102f48cbc7"></a><!-- doxytag: member="TiXmlNode::InsertBeforeChild" ref="0c146fa2fff0157b681594102f48cbc7" args="(TiXmlNode *beforeThis, const TiXmlNode &addThis)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertBeforeChild </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td> + <td class="paramname"> <em>beforeThis</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>addThis</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Add a new node related to this. +<p> +Adds a child before the specified child. Returns a pointer to the new object or NULL if an error occured. +</div> +</div><p> +<a class="anchor" name="d7d4630e1a2a916edda16be22448a8ba"></a><!-- doxytag: member="TiXmlNode::InsertEndChild" ref="d7d4630e1a2a916edda16be22448a8ba" args="(const TiXmlNode &addThis)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::InsertEndChild </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>addThis</em> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Add a new node related to this. +<p> +Adds a child past the LastChild. Returns a pointer to the new object or NULL if an error occured. +</div> +</div><p> +<a class="anchor" name="8621196ba3705fa226bef4a761cc51b6"></a><!-- doxytag: member="TiXmlNode::IterateChildren" ref="8621196ba3705fa226bef4a761cc51b6" args="(const TiXmlNode *previous) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::IterateChildren </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td> + <td class="paramname"> <em>previous</em> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +An alternate way to walk the children of a node. +<p> +One way to iterate over nodes is: <div class="fragment"><pre class="fragment"> for( child = parent->FirstChild(); child; child = child->NextSibling() ) + </pre></div><p> +IterateChildren does the same thing with the syntax: <div class="fragment"><pre class="fragment"> child = 0; + while( child = parent->IterateChildren( child ) ) + </pre></div><p> +IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done. +</div> +</div><p> +<a class="anchor" name="5d29442ae46de6d0168429156197bfc6"></a><!-- doxytag: member="TiXmlNode::LinkEndChild" ref="5d29442ae46de6d0168429156197bfc6" args="(TiXmlNode *addThis)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::LinkEndChild </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td> + <td class="paramname"> <em>addThis</em> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Add a new node related to this. +<p> +Adds a child past the LastChild.<p> +NOTE: the node to be added is passed by pointer, and will be henceforth owned (and deleted) by tinyXml. This method is efficient and avoids an extra copy, but should be used with care as it uses a different memory model than the other insert functions.<p> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a> </dd></dl> + +</div> +</div><p> +<a class="anchor" name="071ba77fd7ab79402fa84b7e9b8607b3"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="071ba77fd7ab79402fa84b7e9b8607b3" args="(const char *) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlNode::NextSiblingElement </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Convenience function to get through elements. +<p> +Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. +</div> +</div><p> +<a class="anchor" name="73acf929d49d10bd0e5fb3d31b0372d1"></a><!-- doxytag: member="TiXmlNode::NextSiblingElement" ref="73acf929d49d10bd0e5fb3d31b0372d1" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const <a class="el" href="classTiXmlElement.html">TiXmlElement</a>* TiXmlNode::NextSiblingElement </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Convenience function to get through elements. +<p> +Calls NextSibling and ToElement. Will skip all non-Element nodes. Returns 0 if there is not another element. +</div> +</div><p> +<a class="anchor" name="0c49e739a17b9938050c22cd89617fbd"></a><!-- doxytag: member="TiXmlNode::ReplaceChild" ref="0c49e739a17b9938050c22cd89617fbd" args="(TiXmlNode *replaceThis, const TiXmlNode &withThis)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="classTiXmlNode.html">TiXmlNode</a>* TiXmlNode::ReplaceChild </td> + <td>(</td> + <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td> + <td class="paramname"> <em>replaceThis</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>withThis</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Replace a child of this node. +<p> +Returns a pointer to the new object or NULL if an error occured. +</div> +</div><p> +<a class="anchor" name="2a38329ca5d3f28f98ce932b8299ae90"></a><!-- doxytag: member="TiXmlNode::SetValue" ref="2a38329ca5d3f28f98ce932b8299ae90" args="(const char *_value)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlNode::SetValue </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>_value</em> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Changes the value of the node. +<p> +Defined as: <div class="fragment"><pre class="fragment"> Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + </pre></div> +</div> +</div><p> +<a class="anchor" name="57b99d5c97d67a42b9752f5210a1ba5e"></a><!-- doxytag: member="TiXmlNode::Type" ref="57b99d5c97d67a42b9752f5210a1ba5e" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int TiXmlNode::Type </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Query the type (as an enumerated value, above) of this node. +<p> +The possible types are: DOCUMENT, ELEMENT, COMMENT, UNKNOWN, TEXT, and DECLARATION. +</div> +</div><p> +<a class="anchor" name="77943eb90d12c2892b1337a9f5918b41"></a><!-- doxytag: member="TiXmlNode::Value" ref="77943eb90d12c2892b1337a9f5918b41" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const char* TiXmlNode::Value </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +The meaning of 'value' changes for the specific type of <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. +<p> +<div class="fragment"><pre class="fragment"> Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + </pre></div><p> +The subclasses will wrap this function. +</div> +</div><p> +<a class="anchor" name="6d9e505619d39bf50bfd9609c9169ea5"></a><!-- doxytag: member="TiXmlNode::ValueStr" ref="6d9e505619d39bf50bfd9609c9169ea5" args="() const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">const std::string& TiXmlNode::ValueStr </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> const<code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Return <a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value()</a> as a std::string. +<p> +If you only use STL, this is more efficient than calling <a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value()</a>. Only available in STL mode. +</div> +</div><p> +<hr><h2>Friends And Related Function Documentation</h2> +<a class="anchor" name="86cd49cfb17a844c0010b3136ac966c7"></a><!-- doxytag: member="TiXmlNode::operator<<" ref="86cd49cfb17a844c0010b3136ac966c7" args="(std::ostream &out, const TiXmlNode &base)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">std::ostream& operator<< </td> + <td>(</td> + <td class="paramtype">std::ostream & </td> + <td class="paramname"> <em>out</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const <a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>base</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [friend]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +An output stream operator, for every class. +<p> +Note that this outputs without any newlines or formatting, as opposed to <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">Print()</a>, which includes tabs and new lines.<p> +The operator<< and operator>> are not completely symmetric. Writing a node to a stream is very well defined. You'll get a nice stream of output, without any extra whitespace or newlines.<p> +But reading is not as well defined. (As it always is.) If you create a <a class="el" href="classTiXmlElement.html">TiXmlElement</a> (for example) and read that from an input stream, the text needs to define an element or junk will result. This is true of all input streams, but it's worth keeping in mind.<p> +A <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> will read nodes until it reads a root element, and all the children of that root element. +</div> +</div><p> +<a class="anchor" name="b57bd426563c926844f65a78412e18b9"></a><!-- doxytag: member="TiXmlNode::operator>>" ref="b57bd426563c926844f65a78412e18b9" args="(std::istream &in, TiXmlNode &base)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">std::istream& operator>> </td> + <td>(</td> + <td class="paramtype">std::istream & </td> + <td class="paramname"> <em>in</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="classTiXmlNode.html">TiXmlNode</a> & </td> + <td class="paramname"> <em>base</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [friend]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +An input stream operator, for every class. +<p> +Tolerant of newlines and formatting, but doesn't expect them. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlNode.png b/shared/tinyxml/docs/classTiXmlNode.png Binary files differnew file mode 100644 index 00000000..6a663cf6 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlNode.png diff --git a/shared/tinyxml/docs/classTiXmlPrinter-members.html b/shared/tinyxml/docs/classTiXmlPrinter-members.html new file mode 100644 index 00000000..bd011fe3 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlPrinter-members.html @@ -0,0 +1,42 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlPrinter Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">CStr</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">Indent</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">LineBreak</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">SetIndent</a>(const char *_indent)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a>(const char *_lineBreak)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">Size</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">Str</a>()</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a>(const TiXmlDeclaration &declaration)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#711e7d65d4af9ec70977568d2451fb1c">Visit</a>(const TiXmlText &text)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#83c13d6b980064b30f989f9a35498979">Visit</a>(const TiXmlComment &comment)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#d2dca6dd106e8982fd3c7db1f3330970">Visit</a>(const TiXmlUnknown &unknown)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a>(const TiXmlDocument &doc)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#0c5e7bf8622838417a0d0bfb8f433854">VisitEnter</a>(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#66b33edd76c538b462f789b797a4fdf2">VisitExit</a>(const TiXmlDocument &doc)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlPrinter.html#1853cf2f6e63ad4b4232b4835e0acaf0">VisitExit</a>(const TiXmlElement &element)</td><td><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a></td><td><code> [virtual]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlPrinter.html b/shared/tinyxml/docs/classTiXmlPrinter.html new file mode 100644 index 00000000..c33fdfb3 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlPrinter.html @@ -0,0 +1,184 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlPrinter Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlPrinter Class Reference</h1><!-- doxytag: class="TiXmlPrinter" --><!-- doxytag: inherits="TiXmlVisitor" -->Print to memory functionality. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlPrinter: +<p><center><img src="classTiXmlPrinter.png" usemap="#TiXmlPrinter_map" border="0" alt=""></center> +<map name="TiXmlPrinter_map"> +<area href="classTiXmlVisitor.html" alt="TiXmlVisitor" shape="rect" coords="0,0,81,24"> +</map> +<a href="classTiXmlPrinter-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="799f4f0388570cbb54c0d3c345fef7c1"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="799f4f0388570cbb54c0d3c345fef7c1" args="(const TiXmlDocument &doc)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &doc)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="66b33edd76c538b462f789b797a4fdf2"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="66b33edd76c538b462f789b797a4fdf2" args="(const TiXmlDocument &doc)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#66b33edd76c538b462f789b797a4fdf2">VisitExit</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &doc)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0c5e7bf8622838417a0d0bfb8f433854"></a><!-- doxytag: member="TiXmlPrinter::VisitEnter" ref="0c5e7bf8622838417a0d0bfb8f433854" args="(const TiXmlElement &element, const TiXmlAttribute *firstAttribute)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#0c5e7bf8622838417a0d0bfb8f433854">VisitEnter</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &element, const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *firstAttribute)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1853cf2f6e63ad4b4232b4835e0acaf0"></a><!-- doxytag: member="TiXmlPrinter::VisitExit" ref="1853cf2f6e63ad4b4232b4835e0acaf0" args="(const TiXmlElement &element)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#1853cf2f6e63ad4b4232b4835e0acaf0">VisitExit</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &element)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ce1b14d33eede2575c0743e2350f6a38"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="ce1b14d33eede2575c0743e2350f6a38" args="(const TiXmlDeclaration &declaration)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a> (const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> &declaration)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a declaration. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="711e7d65d4af9ec70977568d2451fb1c"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="711e7d65d4af9ec70977568d2451fb1c" args="(const TiXmlText &text)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#711e7d65d4af9ec70977568d2451fb1c">Visit</a> (const <a class="el" href="classTiXmlText.html">TiXmlText</a> &text)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a text node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="83c13d6b980064b30f989f9a35498979"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="83c13d6b980064b30f989f9a35498979" args="(const TiXmlComment &comment)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#83c13d6b980064b30f989f9a35498979">Visit</a> (const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> &comment)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a comment node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d2dca6dd106e8982fd3c7db1f3330970"></a><!-- doxytag: member="TiXmlPrinter::Visit" ref="d2dca6dd106e8982fd3c7db1f3330970" args="(const TiXmlUnknown &unknown)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#d2dca6dd106e8982fd3c7db1f3330970">Visit</a> (const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> &unknown)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an unknow node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">SetIndent</a> (const char *_indent)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the indent characters for printing. <a href="#213377a4070c7e625bae59716b089e5e"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bb33ec7d4bad6aaeb57f4304394b133d"></a><!-- doxytag: member="TiXmlPrinter::Indent" ref="bb33ec7d4bad6aaeb57f4304394b133d" args="()" --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">Indent</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the indention string. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a> (const char *_lineBreak)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the line breaking string. <a href="#4be1e37e69e3858c59635aa947174fe6"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="11f1b4804a460b175ec244eb5724d96d"></a><!-- doxytag: member="TiXmlPrinter::LineBreak" ref="11f1b4804a460b175ec244eb5724d96d" args="()" --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">LineBreak</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Query the current line breaking string. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Switch over to "stream printing" which is the most dense formatting without linebreaks. <a href="#b23a90629e374cb1cadca090468bbd19"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="859eede9597d3e0355b77757be48735e"></a><!-- doxytag: member="TiXmlPrinter::CStr" ref="859eede9597d3e0355b77757be48735e" args="()" --> +const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">CStr</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the result. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d01375ae9199bd2f48252eaddce3039d"></a><!-- doxytag: member="TiXmlPrinter::Size" ref="d01375ae9199bd2f48252eaddce3039d" args="()" --> +size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">Size</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the length of the result string. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3bd4daf44309b41f5813a833caa0d1c9"></a><!-- doxytag: member="TiXmlPrinter::Str" ref="3bd4daf44309b41f5813a833caa0d1c9" args="()" --> +const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">Str</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the result. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Print to memory functionality. +<p> +The <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> is useful when you need to:<p> +<ol type=1> +<li>Print to memory (especially in non-STL mode)</li><li>Control formatting (line endings, etc.)</li></ol> +<p> +When constructed, the <a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> is in its default "pretty printing" mode. Before calling Accept() you can call methods to control the printing of the XML document. After <a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode::Accept()</a> is called, the printed document can be accessed via the <a class="el" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">CStr()</a>, <a class="el" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">Str()</a>, and <a class="el" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">Size()</a> methods.<p> +<a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> uses the Visitor API. <div class="fragment"><pre class="fragment"> TiXmlPrinter printer; + printer.SetIndent( "\t" ); + + doc.Accept( &printer ); + fprintf( stdout, "%s", printer.CStr() ); + </pre></div> +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="213377a4070c7e625bae59716b089e5e"></a><!-- doxytag: member="TiXmlPrinter::SetIndent" ref="213377a4070c7e625bae59716b089e5e" args="(const char *_indent)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlPrinter::SetIndent </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>_indent</em> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Set the indent characters for printing. +<p> +By default 4 spaces but tab () is also useful, or null/empty string for no indentation. +</div> +</div><p> +<a class="anchor" name="4be1e37e69e3858c59635aa947174fe6"></a><!-- doxytag: member="TiXmlPrinter::SetLineBreak" ref="4be1e37e69e3858c59635aa947174fe6" args="(const char *_lineBreak)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlPrinter::SetLineBreak </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>_lineBreak</em> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Set the line breaking string. +<p> +By default set to newline (<br> +). Some operating systems prefer other characters, or can be set to the null/empty string for no indenation. +</div> +</div><p> +<a class="anchor" name="b23a90629e374cb1cadca090468bbd19"></a><!-- doxytag: member="TiXmlPrinter::SetStreamPrinting" ref="b23a90629e374cb1cadca090468bbd19" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void TiXmlPrinter::SetStreamPrinting </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Switch over to "stream printing" which is the most dense formatting without linebreaks. +<p> +Common when the XML is needed for network transmission. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlPrinter.png b/shared/tinyxml/docs/classTiXmlPrinter.png Binary files differnew file mode 100644 index 00000000..20887826 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlPrinter.png diff --git a/shared/tinyxml/docs/classTiXmlText-members.html b/shared/tinyxml/docs/classTiXmlText-members.html new file mode 100644 index 00000000..93a3b98f --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlText-members.html @@ -0,0 +1,102 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlText Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlText.html">TiXmlText</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">CDATA</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">Clone</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [protected, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">SetCDATA</a>(bool _cdata)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#f659e77c6b87d684827f35a8f4895960">TiXmlText</a>(const char *initValue)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a>(const std::string &initValue)</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#895bf34ffad17f7439ab2a52b9651648">ToText</a>() const </td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlText.html#e7c3a8fd3e4dbf6c0c4363a943d72f5b">ToText</a>()</td><td><a class="el" href="classTiXmlText.html">TiXmlText</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">ToUnknown</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlText.html b/shared/tinyxml/docs/classTiXmlText.html new file mode 100644 index 00000000..0dadfa95 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlText.html @@ -0,0 +1,145 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlText Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlText Class Reference</h1><!-- doxytag: class="TiXmlText" --><!-- doxytag: inherits="TiXmlNode" -->XML text. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlText: +<p><center><img src="classTiXmlText.png" usemap="#TiXmlText_map" border="0" alt=""></center> +<map name="TiXmlText_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,73,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,73,24"> +</map> +<a href="classTiXmlText-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#f659e77c6b87d684827f35a8f4895960">TiXmlText</a> (const char *initValue)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor for text element. <a href="#f659e77c6b87d684827f35a8f4895960"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="439792f6183a3d3fb6f2bc2b16fa5691"></a><!-- doxytag: member="TiXmlText::TiXmlText" ref="439792f6183a3d3fb6f2bc2b16fa5691" args="(const std::string &initValue)" --> + </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a> (const std::string &initValue)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#0cafbf6f236c7f02d12b2bffc2b7976b"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d1a6a6b83fa2271022dd97c072a2b586"></a><!-- doxytag: member="TiXmlText::CDATA" ref="d1a6a6b83fa2271022dd97c072a2b586" args="() const " --> +bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">CDATA</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Queries whether this represents text using a CDATA section. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cb17ff7c5d09b2c839393445a3de5ea9"></a><!-- doxytag: member="TiXmlText::SetCDATA" ref="cb17ff7c5d09b2c839393445a3de5ea9" args="(bool _cdata)" --> +void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">SetCDATA</a> (bool _cdata)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Turns on or off a CDATA representation of text. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="895bf34ffad17f7439ab2a52b9651648"></a><!-- doxytag: member="TiXmlText::ToText" ref="895bf34ffad17f7439ab2a52b9651648" args="() const " --> +virtual const <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#895bf34ffad17f7439ab2a52b9651648">ToText</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e7c3a8fd3e4dbf6c0c4363a943d72f5b"></a><!-- doxytag: member="TiXmlText::ToText" ref="e7c3a8fd3e4dbf6c0c4363a943d72f5b" args="()" --> +virtual <a class="el" href="classTiXmlText.html">TiXmlText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#e7c3a8fd3e4dbf6c0c4363a943d72f5b">ToText</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8483d4415ce9de6c4fa8f63d067d5de6"></a><!-- doxytag: member="TiXmlText::Accept" ref="8483d4415ce9de6c4fa8f63d067d5de6" args="(TiXmlVisitor *content) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0c411e93a27537369479d034cc82da3b"></a><!-- doxytag: member="TiXmlText::Clone" ref="0c411e93a27537369479d034cc82da3b" args="() const " --> +virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">[internal use] Creates a new Element and returns it. <br></td></tr> +<tr><td colspan="2"><br><h2>Friends</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b6592e32cb9132be517cc12a70564c4b"></a><!-- doxytag: member="TiXmlText::TiXmlElement" ref="b6592e32cb9132be517cc12a70564c4b" args="" --> +class </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlText.html#b6592e32cb9132be517cc12a70564c4b">TiXmlElement</a></td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +XML text. +<p> +A text node can have 2 ways to output the next. "normal" output and CDATA. It will default to the mode it was parsed from the XML file and you generally want to leave it alone, but you can change the output mode with <a class="el" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">SetCDATA()</a> and query it with <a class="el" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">CDATA()</a>. +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="f659e77c6b87d684827f35a8f4895960"></a><!-- doxytag: member="TiXmlText::TiXmlText" ref="f659e77c6b87d684827f35a8f4895960" args="(const char *initValue)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">TiXmlText::TiXmlText </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"> <em>initValue</em> </td> + <td> ) </td> + <td width="100%"><code> [inline]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Constructor for text element. +<p> +By default, it is treated as normal, encoded text. If you want it be output as a CDATA text element, set the parameter _cdata to 'true' +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="0cafbf6f236c7f02d12b2bffc2b7976b"></a><!-- doxytag: member="TiXmlText::Print" ref="0cafbf6f236c7f02d12b2bffc2b7976b" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlText::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlText.png b/shared/tinyxml/docs/classTiXmlText.png Binary files differnew file mode 100644 index 00000000..c9e71d43 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlText.png diff --git a/shared/tinyxml/docs/classTiXmlUnknown-members.html b/shared/tinyxml/docs/classTiXmlUnknown-members.html new file mode 100644 index 00000000..31e24973 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlUnknown-members.html @@ -0,0 +1,98 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlUnknown Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">Accept</a>(TiXmlVisitor *content) const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">Clone</a>() const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>(const TIXML_STRING &str, TIXML_STRING *out)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1f05828d023150706eeb16d6fb3f6355">FirstChild</a>(const char *value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">FirstChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">FirstChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">FirstChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#ccda2c6b45c25bb5a6f9c3407a644e61">FirstChildElement</a>(const char *_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">FirstChildElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">FirstChildElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">GetUserData</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>(TiXmlNode *afterThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>(TiXmlNode *beforeThis, const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>(const TiXmlNode &addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>()</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>(const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#dfaef35a076b9343adc1420757376c39">IterateChildren</a>(const char *value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">IterateChildren</a>(const std::string &_value, const TiXmlNode *previous)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">LastChild</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">LastChild</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">LastChild</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">LastChild</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>(TiXmlNode *addThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">NextSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">NextSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">NextSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#071ba77fd7ab79402fa84b7e9b8607b3">NextSiblingElement</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">NextSiblingElement</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">NextSiblingElement</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> enum name</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<<</a>(std::ostream &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">operator<<</a>(std::string &out, const TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator>></a>(std::istream &in, TiXmlNode &base)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [friend]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#5bdd49327eec1e609b7d22af706b8316">PreviousSibling</a>(const char *) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">PreviousSibling</a>(const std::string &_value) const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">PreviousSibling</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">Print</a>(FILE *cfile, int depth) const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>(TiXmlNode *removeThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>(TiXmlNode *replaceThis, const TiXmlNode &withThis)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>() const </td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>(bool condense)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline, static]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>(void *user)</td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(const char *_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">SetValue</a>(const std::string &_value)</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">ToComment</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">ToDeclaration</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">ToDocument</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">ToElement</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">ToText</a>()</td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#b0313e5fe77987d746ac1a97a254419d">ToUnknown</a>() const </td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlUnknown.html#67c9fd22940e8c47f706a72cdd2e332c">ToUnknown</a>()</td><td><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a></td><td><a class="el" href="classTiXmlBase.html">TiXmlBase</a></td><td><code> [protected]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>() const </td><td><a class="el" href="classTiXmlNode.html">TiXmlNode</a></td><td><code> [inline]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlUnknown.html b/shared/tinyxml/docs/classTiXmlUnknown.html new file mode 100644 index 00000000..b1fa2187 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlUnknown.html @@ -0,0 +1,103 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlUnknown Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlUnknown Class Reference</h1><!-- doxytag: class="TiXmlUnknown" --><!-- doxytag: inherits="TiXmlNode" -->Any tag that tinyXml doesn't recognize is saved as an unknown. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlUnknown: +<p><center><img src="classTiXmlUnknown.png" usemap="#TiXmlUnknown_map" border="0" alt=""></center> +<map name="TiXmlUnknown_map"> +<area href="classTiXmlNode.html" alt="TiXmlNode" shape="rect" coords="0,56,94,80"> +<area href="classTiXmlBase.html" alt="TiXmlBase" shape="rect" coords="0,0,94,24"> +</map> +<a href="classTiXmlUnknown-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0960bb7428b3f341da46244229604d73"></a><!-- doxytag: member="TiXmlUnknown::Clone" ref="0960bb7428b3f341da46244229604d73" args="() const " --> +virtual <a class="el" href="classTiXmlNode.html">TiXmlNode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">Clone</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a copy of this Unknown and returns it. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">Print</a> (FILE *cfile, int depth) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. <a href="#31ba089a40fb5a1869750fce09b0bacb"></a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b0313e5fe77987d746ac1a97a254419d"></a><!-- doxytag: member="TiXmlUnknown::ToUnknown" ref="b0313e5fe77987d746ac1a97a254419d" args="() const " --> +virtual const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#b0313e5fe77987d746ac1a97a254419d">ToUnknown</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="67c9fd22940e8c47f706a72cdd2e332c"></a><!-- doxytag: member="TiXmlUnknown::ToUnknown" ref="67c9fd22940e8c47f706a72cdd2e332c" args="()" --> +virtual <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#67c9fd22940e8c47f706a72cdd2e332c">ToUnknown</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Cast to a more defined type. Will return null not of the requested type. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d7122e5135581b3c832a1a3217760a93"></a><!-- doxytag: member="TiXmlUnknown::Accept" ref="d7122e5135581b3c832a1a3217760a93" args="(TiXmlVisitor *content) const " --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">Accept</a> (<a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> *content) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Walk the XML tree visiting this node and all of its children. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Any tag that tinyXml doesn't recognize is saved as an unknown. +<p> +It is a tag of text, but should not be modified. It will be written back to the XML, unchanged, when the file is saved.<p> +DTD tags get thrown into TiXmlUnknowns. +<p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="31ba089a40fb5a1869750fce09b0bacb"></a><!-- doxytag: member="TiXmlUnknown::Print" ref="31ba089a40fb5a1869750fce09b0bacb" args="(FILE *cfile, int depth) const " --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">virtual void TiXmlUnknown::Print </td> + <td>(</td> + <td class="paramtype">FILE * </td> + <td class="paramname"> <em>cfile</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>depth</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> const<code> [virtual]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +All TinyXml classes can print themselves to a filestream or the string class (TiXmlString in non-STL mode, std::string in STL mode. +<p> +) Either or both cfile and str can be null.<p> +This is a formatted print, and will insert tabs and newlines.<p> +(For an unformatted stream, use the << operator.) +<p> +Implements <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a>. +</div> +</div><p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlUnknown.png b/shared/tinyxml/docs/classTiXmlUnknown.png Binary files differnew file mode 100644 index 00000000..338bfab7 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlUnknown.png diff --git a/shared/tinyxml/docs/classTiXmlVisitor-members.html b/shared/tinyxml/docs/classTiXmlVisitor-members.html new file mode 100644 index 00000000..f6cf1749 --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlVisitor-members.html @@ -0,0 +1,34 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Member List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlVisitor Member List</h1>This is the complete list of members for <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a>, including all inherited members.<p><table> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a>(const TiXmlDeclaration &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#399b8ebca5cd14664974a32d2ce029e5">Visit</a>(const TiXmlText &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#53a60e7a528627b31af3161972cc7fa2">Visit</a>(const TiXmlComment &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#7e284d607d275c51dac1adb58159ce28">Visit</a>(const TiXmlUnknown &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a>(const TiXmlDocument &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#f6c6178ffa517bbdba95d70490875fff">VisitEnter</a>(const TiXmlElement &, const TiXmlAttribute *)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#a0ade4f27087447e93974e975c3246ad">VisitExit</a>(const TiXmlDocument &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> + <tr class="memlist"><td><a class="el" href="classTiXmlVisitor.html#ec2b1f8116226d52f3a1b95dafd3a32c">VisitExit</a>(const TiXmlElement &)</td><td><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a></td><td><code> [inline, virtual]</code></td></tr> +</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlVisitor.html b/shared/tinyxml/docs/classTiXmlVisitor.html new file mode 100644 index 00000000..4698b85a --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlVisitor.html @@ -0,0 +1,84 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TiXmlVisitor Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TiXmlVisitor Class Reference</h1><!-- doxytag: class="TiXmlVisitor" -->If you call the Accept() method, it requires being passed a <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> class to handle callbacks. +<a href="#_details">More...</a> +<p> +<code>#include <<a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>></code> +<p> +<p>Inheritance diagram for TiXmlVisitor: +<p><center><img src="classTiXmlVisitor.png" usemap="#TiXmlVisitor_map" border="0" alt=""></center> +<map name="TiXmlVisitor_map"> +<area href="classTiXmlPrinter.html" alt="TiXmlPrinter" shape="rect" coords="0,56,81,80"> +</map> +<a href="classTiXmlVisitor-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="07baecb52dd7d8716ae2a48ad0956ee0"></a><!-- doxytag: member="TiXmlVisitor::VisitEnter" ref="07baecb52dd7d8716ae2a48ad0956ee0" args="(const TiXmlDocument &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0ade4f27087447e93974e975c3246ad"></a><!-- doxytag: member="TiXmlVisitor::VisitExit" ref="a0ade4f27087447e93974e975c3246ad" args="(const TiXmlDocument &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#a0ade4f27087447e93974e975c3246ad">VisitExit</a> (const <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a document. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f6c6178ffa517bbdba95d70490875fff"></a><!-- doxytag: member="TiXmlVisitor::VisitEnter" ref="f6c6178ffa517bbdba95d70490875fff" args="(const TiXmlElement &, const TiXmlAttribute *)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#f6c6178ffa517bbdba95d70490875fff">VisitEnter</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &, const <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> *)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec2b1f8116226d52f3a1b95dafd3a32c"></a><!-- doxytag: member="TiXmlVisitor::VisitExit" ref="ec2b1f8116226d52f3a1b95dafd3a32c" args="(const TiXmlElement &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#ec2b1f8116226d52f3a1b95dafd3a32c">VisitExit</a> (const <a class="el" href="classTiXmlElement.html">TiXmlElement</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an element. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fad71c71ce6473fb9b4b64cd92de4a19"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="fad71c71ce6473fb9b4b64cd92de4a19" args="(const TiXmlDeclaration &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a> (const <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a declaration. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="399b8ebca5cd14664974a32d2ce029e5"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="399b8ebca5cd14664974a32d2ce029e5" args="(const TiXmlText &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#399b8ebca5cd14664974a32d2ce029e5">Visit</a> (const <a class="el" href="classTiXmlText.html">TiXmlText</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a text node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="53a60e7a528627b31af3161972cc7fa2"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="53a60e7a528627b31af3161972cc7fa2" args="(const TiXmlComment &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#53a60e7a528627b31af3161972cc7fa2">Visit</a> (const <a class="el" href="classTiXmlComment.html">TiXmlComment</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit a comment node. <br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7e284d607d275c51dac1adb58159ce28"></a><!-- doxytag: member="TiXmlVisitor::Visit" ref="7e284d607d275c51dac1adb58159ce28" args="(const TiXmlUnknown &)" --> +virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classTiXmlVisitor.html#7e284d607d275c51dac1adb58159ce28">Visit</a> (const <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> &)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Visit an unknow node. <br></td></tr> +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +If you call the Accept() method, it requires being passed a <a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> class to handle callbacks. +<p> +For nodes that contain other nodes (Document, Element) you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves are simple called with <a class="el" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit()</a>.<p> +If you return 'true' from a Visit method, recursive parsing will continue. If you return false, <b>no children of this node or its sibilings</b> will be Visited.<p> +All flavors of Visit methods have a default implementation that returns 'true' (continue visiting). You need to only override methods that are interesting to you.<p> +Generally Accept() is called on the <a class="el" href="classTiXmlDocument.html">TiXmlDocument</a>, although all nodes suppert Visiting.<p> +You should never change the document from a callback.<p> +<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode::Accept()</a> </dd></dl> + +<p> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="tinyxml_8h-source.html">tinyxml.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/classTiXmlVisitor.png b/shared/tinyxml/docs/classTiXmlVisitor.png Binary files differnew file mode 100644 index 00000000..3e7daece --- /dev/null +++ b/shared/tinyxml/docs/classTiXmlVisitor.png diff --git a/shared/tinyxml/docs/deprecated.html b/shared/tinyxml/docs/deprecated.html new file mode 100644 index 00000000..ccfb3f69 --- /dev/null +++ b/shared/tinyxml/docs/deprecated.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Deprecated List</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1><a class="anchor" name="deprecated">Deprecated List</a></h1><a class="anchor" name="_deprecated000002"></a> <dl> +<dt>Member <a class="el" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">TiXmlHandle::Element</a> () const </dt> +<dd>use ToElement. Return the handle as a <a class="el" href="classTiXmlElement.html">TiXmlElement</a>. This may return null. </dd> +</dl> +<p> +<a class="anchor" name="_deprecated000001"></a> <dl> +<dt>Member <a class="el" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">TiXmlHandle::Node</a> () const </dt> +<dd>use ToNode. Return the handle as a <a class="el" href="classTiXmlNode.html">TiXmlNode</a>. This may return null. </dd> +</dl> +<p> +<a class="anchor" name="_deprecated000003"></a> <dl> +<dt>Member <a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">TiXmlHandle::Text</a> () const </dt> +<dd>use ToText() Return the handle as a <a class="el" href="classTiXmlText.html">TiXmlText</a>. This may return null. </dd> +</dl> +<p> +<a class="anchor" name="_deprecated000004"></a> <dl> +<dt>Member <a class="el" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">TiXmlHandle::Unknown</a> () const </dt> +<dd>use ToUnknown() Return the handle as a <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a>. This may return null. </dd> +</dl> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/doxygen.css b/shared/tinyxml/docs/doxygen.css new file mode 100644 index 00000000..5d583694 --- /dev/null +++ b/shared/tinyxml/docs/doxygen.css @@ -0,0 +1,358 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: monospace, fixed; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + +/* Style for detailed member documentation */ +.memtemplate { + font-size: 80%; + color: #606060; + font-weight: normal; +} +.memnav { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +.memitem { + padding: 4px; + background-color: #eef3f5; + border-width: 1px; + border-style: solid; + border-color: #dedeee; + -moz-border-radius: 8px 8px 8px 8px; +} +.memname { + white-space: nowrap; + font-weight: bold; +} +.memdoc{ + padding-left: 10px; +} +.memproto { + background-color: #d5e1e8; + width: 100%; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; +} +.paramkey { + text-align: right; +} +.paramtype { + white-space: nowrap; +} +.paramname { + color: #602020; + font-style: italic; +} +/* End Styling for detailed member documentation */ + +/* for the tree view */ +.ftvtree { + font-family: sans-serif; + margin:0.5em; +} +.directory { font-size: 9pt; font-weight: bold; } +.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } +.directory > h3 { margin-top: 0; } +.directory p { margin: 0px; white-space: nowrap; } +.directory div { display: none; margin: 0px; } +.directory img { vertical-align: -30%; } + diff --git a/shared/tinyxml/docs/doxygen.png b/shared/tinyxml/docs/doxygen.png Binary files differnew file mode 100644 index 00000000..f0a274bb --- /dev/null +++ b/shared/tinyxml/docs/doxygen.png diff --git a/shared/tinyxml/docs/files.html b/shared/tinyxml/docs/files.html new file mode 100644 index 00000000..23a447d2 --- /dev/null +++ b/shared/tinyxml/docs/files.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: File Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1>TinyXml File List</h1>Here is a list of all documented files with brief descriptions:<table> + <tr><td class="indexkey"><b>tinystr.h</b> <a href="tinystr_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> + <tr><td class="indexkey"><b>tinyxml.h</b> <a href="tinyxml_8h-source.html">[code]</a></td><td class="indexvalue"></td></tr> +</table> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/functions.html b/shared/tinyxml/docs/functions.html new file mode 100644 index 00000000..e1243226 --- /dev/null +++ b/shared/tinyxml/docs/functions.html @@ -0,0 +1,196 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class Members</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li id="current"><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_enum.html"><span>Enumerations</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> +<div class="tabs"> + <ul> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_e"><span>e</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_l"><span>l</span></a></li> + <li><a href="#index_n"><span>n</span></a></li> + <li><a href="#index_o"><span>o</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_q"><span>q</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_t"><span>t</span></a></li> + <li><a href="#index_u"><span>u</span></a></li> + <li><a href="#index_v"><span>v</span></a></li> + </ul> +</div> + +<p> +Here is a list of all documented class members with links to the class documentation for each member: +<p> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>Accept() +: <a class="el" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode</a><li>Attribute() +: <a class="el" href="classTiXmlElement.html#eaff99d4f0ea5b34f7aee202aad457ba">TiXmlElement</a></ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>CDATA() +: <a class="el" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">TiXmlText</a><li>Child() +: <a class="el" href="classTiXmlHandle.html#f9cf6a7d08a5da94a8924425ad0cd5ac">TiXmlHandle</a><li>ChildElement() +: <a class="el" href="classTiXmlHandle.html#8786475b9d1f1518492e3a46704c7ef0">TiXmlHandle</a><li>Clear() +: <a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">TiXmlNode</a><li>ClearError() +: <a class="el" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">TiXmlDocument</a><li>Clone() +: <a class="el" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a><li>Column() +: <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">TiXmlBase</a><li>CStr() +: <a class="el" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">TiXmlPrinter</a></ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>DoubleValue() +: <a class="el" href="classTiXmlAttribute.html#2880ddef53fc7522c99535273954d230">TiXmlAttribute</a></ul> +<h3><a class="anchor" name="index_e">- e -</a></h3><ul> +<li>Element() +: <a class="el" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">TiXmlHandle</a><li>EncodeString() +: <a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">TiXmlBase</a><li>Encoding() +: <a class="el" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">TiXmlDeclaration</a><li>Error() +: <a class="el" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">TiXmlDocument</a><li>ErrorCol() +: <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">TiXmlDocument</a><li>ErrorDesc() +: <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">TiXmlDocument</a><li>ErrorId() +: <a class="el" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">TiXmlDocument</a><li>ErrorRow() +: <a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">TiXmlDocument</a></ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FirstAttribute() +: <a class="el" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">TiXmlElement</a><li>FirstChild() +: <a class="el" href="classTiXmlHandle.html#8c61f64ae9365d89c264f289085541f8">TiXmlHandle</a>, <a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">TiXmlNode</a><li>FirstChildElement() +: <a class="el" href="classTiXmlHandle.html#f0aea751320f5e430fac6f8fff3b8dd4">TiXmlHandle</a>, <a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>GetDocument() +: <a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">TiXmlNode</a><li>GetText() +: <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">TiXmlElement</a><li>GetUserData() +: <a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>Indent() +: <a class="el" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">TiXmlPrinter</a><li>InsertAfterChild() +: <a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">TiXmlNode</a><li>InsertBeforeChild() +: <a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">TiXmlNode</a><li>InsertEndChild() +: <a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">TiXmlNode</a><li>IntValue() +: <a class="el" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">TiXmlAttribute</a><li>IsWhiteSpaceCondensed() +: <a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">TiXmlBase</a><li>IterateChildren() +: <a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_l">- l -</a></h3><ul> +<li>LastAttribute() +: <a class="el" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">TiXmlElement</a><li>LastChild() +: <a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">TiXmlNode</a><li>LineBreak() +: <a class="el" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">TiXmlPrinter</a><li>LinkEndChild() +: <a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">TiXmlNode</a><li>LoadFile() +: <a class="el" href="classTiXmlDocument.html#18ae6ed34fed7991ebc220862dfac884">TiXmlDocument</a></ul> +<h3><a class="anchor" name="index_n">- n -</a></h3><ul> +<li>Name() +: <a class="el" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">TiXmlAttribute</a><li>Next() +: <a class="el" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">TiXmlAttribute</a><li>NextSibling() +: <a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">TiXmlNode</a><li>NextSiblingElement() +: <a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">TiXmlNode</a><li>NoChildren() +: <a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">TiXmlNode</a><li>Node() +: <a class="el" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">TiXmlHandle</a><li>NodeType +: <a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_o">- o -</a></h3><ul> +<li>operator<< +: <a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">TiXmlNode</a><li>operator>> +: <a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>Parent() +: <a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">TiXmlNode</a><li>Parse() +: <a class="el" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">TiXmlDocument</a><li>Previous() +: <a class="el" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">TiXmlAttribute</a><li>PreviousSibling() +: <a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">TiXmlNode</a><li>Print() +: <a class="el" href="classTiXmlDocument.html#8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>, <a class="el" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>, <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_q">- q -</a></h3><ul> +<li>QueryDoubleAttribute() +: <a class="el" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">TiXmlElement</a><li>QueryDoubleValue() +: <a class="el" href="classTiXmlAttribute.html#c87b2a8489906a5d7aa2875f20be3513">TiXmlAttribute</a><li>QueryFloatAttribute() +: <a class="el" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">TiXmlElement</a><li>QueryIntAttribute() +: <a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">TiXmlElement</a><li>QueryIntValue() +: <a class="el" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">TiXmlAttribute</a><li>QueryValueAttribute() +: <a class="el" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">TiXmlElement</a></ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>RemoveAttribute() +: <a class="el" href="classTiXmlElement.html#1afa6aea716511326a608e4c05df4f3a">TiXmlElement</a><li>RemoveChild() +: <a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">TiXmlNode</a><li>ReplaceChild() +: <a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">TiXmlNode</a><li>RootElement() +: <a class="el" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">TiXmlDocument</a><li>Row() +: <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>SaveFile() +: <a class="el" href="classTiXmlDocument.html#3d4fae0463f3f03679ba0b7cf6f2df52">TiXmlDocument</a><li>SetAttribute() +: <a class="el" href="classTiXmlElement.html#ce6f4be75e373726d4774073d666d1a7">TiXmlElement</a><li>SetCDATA() +: <a class="el" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">TiXmlText</a><li>SetCondenseWhiteSpace() +: <a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">TiXmlBase</a><li>SetDoubleAttribute() +: <a class="el" href="classTiXmlElement.html#0d1dd975d75496778177e35abfe0ec0b">TiXmlElement</a><li>SetDoubleValue() +: <a class="el" href="classTiXmlAttribute.html#0316da31373496c4368ad549bf711394">TiXmlAttribute</a><li>SetIndent() +: <a class="el" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">TiXmlPrinter</a><li>SetIntValue() +: <a class="el" href="classTiXmlAttribute.html#7e065df640116a62ea4f4b7da5449cc8">TiXmlAttribute</a><li>SetLineBreak() +: <a class="el" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">TiXmlPrinter</a><li>SetName() +: <a class="el" href="classTiXmlAttribute.html#b296ff0c9a8c701055cd257a8a976e57">TiXmlAttribute</a><li>SetStreamPrinting() +: <a class="el" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">TiXmlPrinter</a><li>SetTabSize() +: <a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument</a><li>SetUserData() +: <a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">TiXmlBase</a><li>SetValue() +: <a class="el" href="classTiXmlAttribute.html#b43f67a0cc3ec1d80e62606500f0925f">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">TiXmlNode</a><li>Size() +: <a class="el" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">TiXmlPrinter</a><li>Standalone() +: <a class="el" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">TiXmlDeclaration</a><li>Str() +: <a class="el" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">TiXmlPrinter</a></ul> +<h3><a class="anchor" name="index_t">- t -</a></h3><ul> +<li>Text() +: <a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">TiXmlHandle</a><li>TiXmlAttribute() +: <a class="el" href="classTiXmlAttribute.html#759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a><li>TiXmlComment() +: <a class="el" href="classTiXmlComment.html#37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a><li>TiXmlDeclaration() +: <a class="el" href="classTiXmlDeclaration.html#3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a><li>TiXmlDocument() +: <a class="el" href="classTiXmlDocument.html#2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a><li>TiXmlElement() +: <a class="el" href="classTiXmlElement.html#40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a><li>TiXmlHandle() +: <a class="el" href="classTiXmlHandle.html#236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a><li>TiXmlText() +: <a class="el" href="classTiXmlText.html#439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a><li>ToComment() +: <a class="el" href="classTiXmlComment.html#cc7c7e07e13c23f17797d642981511df">TiXmlComment</a>, <a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">TiXmlNode</a><li>ToDeclaration() +: <a class="el" href="classTiXmlDeclaration.html#6bd3d1daddcaeb9543c24bfd090969ce">TiXmlDeclaration</a>, <a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">TiXmlNode</a><li>ToDocument() +: <a class="el" href="classTiXmlDocument.html#1025d942a1f328fd742d545e37efdd42">TiXmlDocument</a>, <a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">TiXmlNode</a><li>ToElement() +: <a class="el" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">TiXmlHandle</a>, <a class="el" href="classTiXmlElement.html#9def86337ea7a755eb41cac980f60c7a">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">TiXmlNode</a><li>ToNode() +: <a class="el" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">TiXmlHandle</a><li>ToText() +: <a class="el" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">TiXmlHandle</a>, <a class="el" href="classTiXmlText.html#e7c3a8fd3e4dbf6c0c4363a943d72f5b">TiXmlText</a>, <a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">TiXmlNode</a><li>ToUnknown() +: <a class="el" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">TiXmlHandle</a>, <a class="el" href="classTiXmlUnknown.html#67c9fd22940e8c47f706a72cdd2e332c">TiXmlUnknown</a>, <a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">TiXmlNode</a><li>Type() +: <a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_u">- u -</a></h3><ul> +<li>Unknown() +: <a class="el" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">TiXmlHandle</a><li>userData +: <a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_v">- v -</a></h3><ul> +<li>Value() +: <a class="el" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">TiXmlNode</a><li>ValueStr() +: <a class="el" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">TiXmlNode</a><li>Version() +: <a class="el" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">TiXmlDeclaration</a><li>Visit() +: <a class="el" href="classTiXmlPrinter.html#d2dca6dd106e8982fd3c7db1f3330970">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#7e284d607d275c51dac1adb58159ce28">TiXmlVisitor</a><li>VisitEnter() +: <a class="el" href="classTiXmlPrinter.html#0c5e7bf8622838417a0d0bfb8f433854">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#f6c6178ffa517bbdba95d70490875fff">TiXmlVisitor</a><li>VisitExit() +: <a class="el" href="classTiXmlPrinter.html#1853cf2f6e63ad4b4232b4835e0acaf0">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#ec2b1f8116226d52f3a1b95dafd3a32c">TiXmlVisitor</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/functions_enum.html b/shared/tinyxml/docs/functions_enum.html new file mode 100644 index 00000000..563709ba --- /dev/null +++ b/shared/tinyxml/docs/functions_enum.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class Members - Enumerations</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li id="current"><a href="functions_enum.html"><span>Enumerations</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>NodeType +: <a class="el" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">TiXmlNode</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/functions_func.html b/shared/tinyxml/docs/functions_func.html new file mode 100644 index 00000000..99bdfbd3 --- /dev/null +++ b/shared/tinyxml/docs/functions_func.html @@ -0,0 +1,189 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class Members - Functions</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li id="current"><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_enum.html"><span>Enumerations</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> +<div class="tabs"> + <ul> + <li><a href="#index_a"><span>a</span></a></li> + <li><a href="#index_c"><span>c</span></a></li> + <li><a href="#index_d"><span>d</span></a></li> + <li><a href="#index_e"><span>e</span></a></li> + <li><a href="#index_f"><span>f</span></a></li> + <li><a href="#index_g"><span>g</span></a></li> + <li><a href="#index_i"><span>i</span></a></li> + <li><a href="#index_l"><span>l</span></a></li> + <li><a href="#index_n"><span>n</span></a></li> + <li><a href="#index_p"><span>p</span></a></li> + <li><a href="#index_q"><span>q</span></a></li> + <li><a href="#index_r"><span>r</span></a></li> + <li><a href="#index_s"><span>s</span></a></li> + <li><a href="#index_t"><span>t</span></a></li> + <li><a href="#index_u"><span>u</span></a></li> + <li><a href="#index_v"><span>v</span></a></li> + </ul> +</div> + +<p> + +<p> +<h3><a class="anchor" name="index_a">- a -</a></h3><ul> +<li>Accept() +: <a class="el" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">TiXmlNode</a><li>Attribute() +: <a class="el" href="classTiXmlElement.html#eaff99d4f0ea5b34f7aee202aad457ba">TiXmlElement</a></ul> +<h3><a class="anchor" name="index_c">- c -</a></h3><ul> +<li>CDATA() +: <a class="el" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">TiXmlText</a><li>Child() +: <a class="el" href="classTiXmlHandle.html#f9cf6a7d08a5da94a8924425ad0cd5ac">TiXmlHandle</a><li>ChildElement() +: <a class="el" href="classTiXmlHandle.html#8786475b9d1f1518492e3a46704c7ef0">TiXmlHandle</a><li>Clear() +: <a class="el" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">TiXmlNode</a><li>ClearError() +: <a class="el" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">TiXmlDocument</a><li>Clone() +: <a class="el" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">TiXmlNode</a><li>Column() +: <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">TiXmlBase</a><li>CStr() +: <a class="el" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">TiXmlPrinter</a></ul> +<h3><a class="anchor" name="index_d">- d -</a></h3><ul> +<li>DoubleValue() +: <a class="el" href="classTiXmlAttribute.html#2880ddef53fc7522c99535273954d230">TiXmlAttribute</a></ul> +<h3><a class="anchor" name="index_e">- e -</a></h3><ul> +<li>Element() +: <a class="el" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">TiXmlHandle</a><li>EncodeString() +: <a class="el" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">TiXmlBase</a><li>Encoding() +: <a class="el" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">TiXmlDeclaration</a><li>Error() +: <a class="el" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">TiXmlDocument</a><li>ErrorCol() +: <a class="el" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">TiXmlDocument</a><li>ErrorDesc() +: <a class="el" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">TiXmlDocument</a><li>ErrorId() +: <a class="el" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">TiXmlDocument</a><li>ErrorRow() +: <a class="el" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">TiXmlDocument</a></ul> +<h3><a class="anchor" name="index_f">- f -</a></h3><ul> +<li>FirstAttribute() +: <a class="el" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">TiXmlElement</a><li>FirstChild() +: <a class="el" href="classTiXmlHandle.html#8c61f64ae9365d89c264f289085541f8">TiXmlHandle</a>, <a class="el" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">TiXmlNode</a><li>FirstChildElement() +: <a class="el" href="classTiXmlHandle.html#f0aea751320f5e430fac6f8fff3b8dd4">TiXmlHandle</a>, <a class="el" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_g">- g -</a></h3><ul> +<li>GetDocument() +: <a class="el" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">TiXmlNode</a><li>GetText() +: <a class="el" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">TiXmlElement</a><li>GetUserData() +: <a class="el" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_i">- i -</a></h3><ul> +<li>Indent() +: <a class="el" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">TiXmlPrinter</a><li>InsertAfterChild() +: <a class="el" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">TiXmlNode</a><li>InsertBeforeChild() +: <a class="el" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">TiXmlNode</a><li>InsertEndChild() +: <a class="el" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">TiXmlNode</a><li>IntValue() +: <a class="el" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">TiXmlAttribute</a><li>IsWhiteSpaceCondensed() +: <a class="el" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">TiXmlBase</a><li>IterateChildren() +: <a class="el" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_l">- l -</a></h3><ul> +<li>LastAttribute() +: <a class="el" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">TiXmlElement</a><li>LastChild() +: <a class="el" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">TiXmlNode</a><li>LineBreak() +: <a class="el" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">TiXmlPrinter</a><li>LinkEndChild() +: <a class="el" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">TiXmlNode</a><li>LoadFile() +: <a class="el" href="classTiXmlDocument.html#18ae6ed34fed7991ebc220862dfac884">TiXmlDocument</a></ul> +<h3><a class="anchor" name="index_n">- n -</a></h3><ul> +<li>Name() +: <a class="el" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">TiXmlAttribute</a><li>Next() +: <a class="el" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">TiXmlAttribute</a><li>NextSibling() +: <a class="el" href="classTiXmlNode.html#2e61c0b89a77e36a0e8c60490003cb46">TiXmlNode</a><li>NextSiblingElement() +: <a class="el" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">TiXmlNode</a><li>NoChildren() +: <a class="el" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">TiXmlNode</a><li>Node() +: <a class="el" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">TiXmlHandle</a></ul> +<h3><a class="anchor" name="index_p">- p -</a></h3><ul> +<li>Parent() +: <a class="el" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">TiXmlNode</a><li>Parse() +: <a class="el" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">TiXmlDocument</a><li>Previous() +: <a class="el" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">TiXmlAttribute</a><li>PreviousSibling() +: <a class="el" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">TiXmlNode</a><li>Print() +: <a class="el" href="classTiXmlDocument.html#8701fda1fa31b25abbc9c0df42da10e8">TiXmlDocument</a>, <a class="el" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">TiXmlUnknown</a>, <a class="el" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">TiXmlDeclaration</a>, <a class="el" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">TiXmlText</a>, <a class="el" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">TiXmlComment</a>, <a class="el" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">TiXmlElement</a>, <a class="el" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">TiXmlAttribute</a>, <a class="el" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_q">- q -</a></h3><ul> +<li>QueryDoubleAttribute() +: <a class="el" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">TiXmlElement</a><li>QueryDoubleValue() +: <a class="el" href="classTiXmlAttribute.html#c87b2a8489906a5d7aa2875f20be3513">TiXmlAttribute</a><li>QueryFloatAttribute() +: <a class="el" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">TiXmlElement</a><li>QueryIntAttribute() +: <a class="el" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">TiXmlElement</a><li>QueryIntValue() +: <a class="el" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">TiXmlAttribute</a><li>QueryValueAttribute() +: <a class="el" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">TiXmlElement</a></ul> +<h3><a class="anchor" name="index_r">- r -</a></h3><ul> +<li>RemoveAttribute() +: <a class="el" href="classTiXmlElement.html#1afa6aea716511326a608e4c05df4f3a">TiXmlElement</a><li>RemoveChild() +: <a class="el" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">TiXmlNode</a><li>ReplaceChild() +: <a class="el" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">TiXmlNode</a><li>RootElement() +: <a class="el" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">TiXmlDocument</a><li>Row() +: <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">TiXmlBase</a></ul> +<h3><a class="anchor" name="index_s">- s -</a></h3><ul> +<li>SaveFile() +: <a class="el" href="classTiXmlDocument.html#3d4fae0463f3f03679ba0b7cf6f2df52">TiXmlDocument</a><li>SetAttribute() +: <a class="el" href="classTiXmlElement.html#ce6f4be75e373726d4774073d666d1a7">TiXmlElement</a><li>SetCDATA() +: <a class="el" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">TiXmlText</a><li>SetCondenseWhiteSpace() +: <a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">TiXmlBase</a><li>SetDoubleAttribute() +: <a class="el" href="classTiXmlElement.html#0d1dd975d75496778177e35abfe0ec0b">TiXmlElement</a><li>SetDoubleValue() +: <a class="el" href="classTiXmlAttribute.html#0316da31373496c4368ad549bf711394">TiXmlAttribute</a><li>SetIndent() +: <a class="el" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">TiXmlPrinter</a><li>SetIntValue() +: <a class="el" href="classTiXmlAttribute.html#7e065df640116a62ea4f4b7da5449cc8">TiXmlAttribute</a><li>SetLineBreak() +: <a class="el" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">TiXmlPrinter</a><li>SetName() +: <a class="el" href="classTiXmlAttribute.html#b296ff0c9a8c701055cd257a8a976e57">TiXmlAttribute</a><li>SetStreamPrinting() +: <a class="el" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">TiXmlPrinter</a><li>SetTabSize() +: <a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument</a><li>SetUserData() +: <a class="el" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">TiXmlBase</a><li>SetValue() +: <a class="el" href="classTiXmlAttribute.html#b43f67a0cc3ec1d80e62606500f0925f">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">TiXmlNode</a><li>Size() +: <a class="el" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">TiXmlPrinter</a><li>Standalone() +: <a class="el" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">TiXmlDeclaration</a><li>Str() +: <a class="el" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">TiXmlPrinter</a></ul> +<h3><a class="anchor" name="index_t">- t -</a></h3><ul> +<li>Text() +: <a class="el" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">TiXmlHandle</a><li>TiXmlAttribute() +: <a class="el" href="classTiXmlAttribute.html#759d0b76fb8fcf765ecab243bc14f05e">TiXmlAttribute</a><li>TiXmlComment() +: <a class="el" href="classTiXmlComment.html#37e7802ef17bc03ebe5ae79bf0713d47">TiXmlComment</a><li>TiXmlDeclaration() +: <a class="el" href="classTiXmlDeclaration.html#3b618d1c30c25e4b7a71f31a595ee298">TiXmlDeclaration</a><li>TiXmlDocument() +: <a class="el" href="classTiXmlDocument.html#2c6e58fb99bfa76cc613f16840022225">TiXmlDocument</a><li>TiXmlElement() +: <a class="el" href="classTiXmlElement.html#40fc2e3c1a955e2f78e1a32350d180e7">TiXmlElement</a><li>TiXmlHandle() +: <a class="el" href="classTiXmlHandle.html#236d7855e1e56ccc7b980630c48c7fd7">TiXmlHandle</a><li>TiXmlText() +: <a class="el" href="classTiXmlText.html#439792f6183a3d3fb6f2bc2b16fa5691">TiXmlText</a><li>ToComment() +: <a class="el" href="classTiXmlComment.html#cc7c7e07e13c23f17797d642981511df">TiXmlComment</a>, <a class="el" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">TiXmlNode</a><li>ToDeclaration() +: <a class="el" href="classTiXmlDeclaration.html#6bd3d1daddcaeb9543c24bfd090969ce">TiXmlDeclaration</a>, <a class="el" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">TiXmlNode</a><li>ToDocument() +: <a class="el" href="classTiXmlDocument.html#1025d942a1f328fd742d545e37efdd42">TiXmlDocument</a>, <a class="el" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">TiXmlNode</a><li>ToElement() +: <a class="el" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">TiXmlHandle</a>, <a class="el" href="classTiXmlElement.html#9def86337ea7a755eb41cac980f60c7a">TiXmlElement</a>, <a class="el" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">TiXmlNode</a><li>ToNode() +: <a class="el" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">TiXmlHandle</a><li>ToText() +: <a class="el" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">TiXmlHandle</a>, <a class="el" href="classTiXmlText.html#e7c3a8fd3e4dbf6c0c4363a943d72f5b">TiXmlText</a>, <a class="el" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">TiXmlNode</a><li>ToUnknown() +: <a class="el" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">TiXmlHandle</a>, <a class="el" href="classTiXmlUnknown.html#67c9fd22940e8c47f706a72cdd2e332c">TiXmlUnknown</a>, <a class="el" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">TiXmlNode</a><li>Type() +: <a class="el" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">TiXmlNode</a></ul> +<h3><a class="anchor" name="index_u">- u -</a></h3><ul> +<li>Unknown() +: <a class="el" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">TiXmlHandle</a></ul> +<h3><a class="anchor" name="index_v">- v -</a></h3><ul> +<li>Value() +: <a class="el" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">TiXmlNode</a><li>ValueStr() +: <a class="el" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">TiXmlAttribute</a>, <a class="el" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">TiXmlNode</a><li>Version() +: <a class="el" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">TiXmlDeclaration</a><li>Visit() +: <a class="el" href="classTiXmlPrinter.html#d2dca6dd106e8982fd3c7db1f3330970">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#7e284d607d275c51dac1adb58159ce28">TiXmlVisitor</a><li>VisitEnter() +: <a class="el" href="classTiXmlPrinter.html#0c5e7bf8622838417a0d0bfb8f433854">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#f6c6178ffa517bbdba95d70490875fff">TiXmlVisitor</a><li>VisitExit() +: <a class="el" href="classTiXmlPrinter.html#1853cf2f6e63ad4b4232b4835e0acaf0">TiXmlPrinter</a>, <a class="el" href="classTiXmlVisitor.html#ec2b1f8116226d52f3a1b95dafd3a32c">TiXmlVisitor</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/functions_rela.html b/shared/tinyxml/docs/functions_rela.html new file mode 100644 index 00000000..fddd4338 --- /dev/null +++ b/shared/tinyxml/docs/functions_rela.html @@ -0,0 +1,40 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class Members - Related Functions</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_enum.html"><span>Enumerations</span></a></li> + <li id="current"><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>operator<< +: <a class="el" href="classTiXmlNode.html#52ef17e7080df2490cf87bde380685ab">TiXmlNode</a><li>operator>> +: <a class="el" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">TiXmlNode</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/functions_vars.html b/shared/tinyxml/docs/functions_vars.html new file mode 100644 index 00000000..52e814cb --- /dev/null +++ b/shared/tinyxml/docs/functions_vars.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Class Members - Variables</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li id="current"><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="functions.html"><span>All</span></a></li> + <li><a href="functions_func.html"><span>Functions</span></a></li> + <li id="current"><a href="functions_vars.html"><span>Variables</span></a></li> + <li><a href="functions_enum.html"><span>Enumerations</span></a></li> + <li><a href="functions_rela.html"><span>Related Functions</span></a></li> + </ul> +</div> + +<p> +<ul> +<li>userData +: <a class="el" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">TiXmlBase</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/hierarchy.html b/shared/tinyxml/docs/hierarchy.html new file mode 100644 index 00000000..0eb50b46 --- /dev/null +++ b/shared/tinyxml/docs/hierarchy.html @@ -0,0 +1,45 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Hierarchical Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li id="current"><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>TinyXml Class Hierarchy</h1>This inheritance list is sorted roughly, but not completely, alphabetically:<ul> +<li><a class="el" href="classTiXmlBase.html">TiXmlBase</a> +<ul> +<li><a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> +<li><a class="el" href="classTiXmlNode.html">TiXmlNode</a> +<ul> +<li><a class="el" href="classTiXmlComment.html">TiXmlComment</a> +<li><a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> +<li><a class="el" href="classTiXmlDocument.html">TiXmlDocument</a> +<li><a class="el" href="classTiXmlElement.html">TiXmlElement</a> +<li><a class="el" href="classTiXmlText.html">TiXmlText</a> +<li><a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> +</ul> +</ul> +<li><a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> +<li><a class="el" href="classTiXmlVisitor.html">TiXmlVisitor</a> +<ul> +<li><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a> +</ul> +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/index.html b/shared/tinyxml/docs/index.html new file mode 100644 index 00000000..01d51e78 --- /dev/null +++ b/shared/tinyxml/docs/index.html @@ -0,0 +1,275 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Main Page</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li id="current"><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1>TinyXml Documentation</h1> +<p> +<h3 align="center">2.5.3 </h3><h1>TinyXML </h1> +<p> +TinyXML is a simple, small, C++ XML parser that can be easily integrated into other programs.<p> +<h2>What it does. </h2> +<p> +In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved.<p> +XML stands for "eXtensible Markup Language." It allows you to create your own document markups. Where HTML does a very good job of marking documents for browsers, XML allows you to define any kind of document markup, for example a document that describes a "to do" list for an organizer application. XML is a very structured and convenient format. All those random file formats created to store application data can all be replaced with XML. One parser for everything.<p> +The best place for the complete, correct, and quite frankly hard to read spec is at <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">http://www.w3.org/TR/2004/REC-xml-20040204/</a>. An intro to XML (that I really like) can be found at <a href="http://skew.org/xml/tutorial/">http://skew.org/xml/tutorial</a>.<p> +There are different ways to access and interact with XML data. TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed into a C++ objects that can be browsed and manipulated, and then written to disk or another output stream. You can also construct an XML document from scratch with C++ objects and write this to disk or another output stream.<p> +TinyXML is designed to be easy and fast to learn. It is two headers and four cpp files. Simply add these to your project and off you go. There is an example file - xmltest.cpp - to get you started.<p> +TinyXML is released under the ZLib license, so you can use it in open source or commercial code. The details of the license are at the top of every source file.<p> +TinyXML attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML should compile on any reasonably C++ compliant system. It does not rely on exceptions or RTTI. It can be compiled with or without STL support. TinyXML fully supports the UTF-8 encoding, and the first 64k character entities.<p> +<h2>What it doesn't do. </h2> +<p> +TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there (check out www.sourceforge.org, search for XML) that are much more fully featured. But they are also much bigger, take longer to set up in your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML is not the parser for you.<p> +The following DTD syntax will not parse at this time in TinyXML:<p> +<div class="fragment"><pre class="fragment"> <!DOCTYPE Archiv [ + <!ELEMENT Comment (#PCDATA)> + ]> +</pre></div><p> +because TinyXML sees this as a !DOCTYPE node with an illegally embedded !ELEMENT node. This may be addressed in the future.<p> +<h2>Tutorials. </h2> +<p> +For the impatient, here is a tutorial to get you going. A great way to get started, but it is worth your time to read this (very short) manual completely.<p> +<ul> +<li><a class="el" href="tutorial0.html">TinyXML Tutorial</a></li></ul> +<p> +<h2>Code Status. </h2> +<p> +TinyXML is mature, tested code. It is very stable. If you find bugs, please file a bug report on the sourceforge web site (www.sourceforge.net/projects/tinyxml). We'll get them straightened out as soon as possible.<p> +There are some areas of improvement; please check sourceforge if you are interested in working on TinyXML.<p> +<h2>Related Projects </h2> +<p> +TinyXML projects you may find useful! (Descriptions provided by the projects.)<p> +<ul> +<li> +<b>TinyXPath</b> (<a href="http://tinyxpath.sourceforge.net">http://tinyxpath.sourceforge.net</a>). TinyXPath is a small footprint XPath syntax decoder, written in C++. </li> +<li> +<b>TinyXML++</b> (<a href="http://code.google.com/p/ticpp/">http://code.google.com/p/ticpp/</a>). TinyXML++ is a completely new interface to TinyXML that uses MANY of the C++ strengths. Templates, exceptions, and much better error handling. </li> +</ul> +<p> +<h2>Features </h2> +<p> +<h3>Using STL </h3> +<p> +TinyXML can be compiled to use or not use STL. When using STL, TinyXML uses the std::string class, and fully supports std::istream, std::ostream, operator<<, and operator>>. Many API methods have both 'const char*' and 'const std::string&' forms.<p> +When STL support is compiled out, no STL files are included whatsoever. All the string classes are implemented by TinyXML itself. API methods all use the 'const char*' form for input.<p> +Use the compile time define:<p> +TIXML_USE_STL<p> +to compile one version or the other. This can be passed by the compiler, or set as the first line of "tinyxml.h".<p> +Note: If compiling the test code in Linux, setting the environment variable TINYXML_USE_STL=YES/NO will control STL compilation. In the Windows project file, STL and non STL targets are provided. In your project, It's probably easiest to add the line "#define TIXML_USE_STL" as the first line of <a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>.<p> +<h3>UTF-8 </h3> +<p> +TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML also supports "legacy mode" - the encoding used before UTF-8 support and probably best described as "extended ascii".<p> +Normally, TinyXML will try to detect the correct encoding and use it. However, by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML can be forced to always use one encoding.<p> +TinyXML will assume Legacy Mode until one of the following occurs: <ol> +<li> +If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) begin the file or data stream, TinyXML will read it as UTF-8. </li> +<li> +If the declaration tag is read, and it has an encoding="UTF-8", then TinyXML will read it as UTF-8. </li> +<li> +If the declaration tag is read, and it has no encoding specified, then TinyXML will read it as UTF-8. </li> +<li> +If the declaration tag is read, and it has an encoding="something else", then TinyXML will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's not clear what that mode does exactly, but old content should keep working. </li> +<li> +Until one of the above criteria is met, TinyXML runs in Legacy Mode. </li> +</ol> +<p> +What happens if the encoding is incorrectly set or detected? TinyXML will try to read and pass through text seen as improperly encoded. You may get some strange results or mangled characters. You may want to force TinyXML to the correct mode.<p> +You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may force it to TIXML_ENCODING_UTF8 with the same technique.<p> +For English users, using English XML, UTF-8 is the same as low-ASCII. You don't need to be aware of UTF-8 or change your code in any way. You can think of UTF-8 as a "superset" of ASCII.<p> +UTF-8 is not a double byte format - but it is a standard encoding of Unicode! TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding of unicode. This is a source of confusion.<p> +For "high-ascii" languages - everything not English, pretty much - TinyXML can handle all languages, at the same time, as long as the XML is encoded in UTF-8. That can be a little tricky, older programs and operating systems tend to use the "default" or "traditional" code page. Many apps (and almost all modern ones) can output UTF-8, but older or stubborn (or just broken) ones still output text in the default code page.<p> +For example, Japanese systems traditionally use SHIFT-JIS encoding. Text encoded as SHIFT-JIS can not be read by TinyXML. A good text editor can import SHIFT-JIS and then save as UTF-8.<p> +The <a href="http://skew.org/xml/tutorial/">Skew.org link</a> does a great job covering the encoding issue.<p> +The test file "utf8test.xml" is an XML containing English, Spanish, Russian, and Simplified Chinese. (Hopefully they are translated correctly). The file "utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that if you don't have the correct fonts (Simplified Chinese or Russian) on your system, you won't see output that matches the GIF file even if you can parse it correctly. Also note that (at least on my Windows machine) console output is in a Western code page, so that Print() or printf() cannot correctly display the file. This is not a bug in TinyXML - just an OS issue. No data is lost or destroyed by TinyXML. The console just doesn't render UTF-8.<p> +<h3>Entities </h3> +<p> +TinyXML recognizes the pre-defined "character entities", meaning special characters. Namely:<p> +<div class="fragment"><pre class="fragment"> &amp; & + &lt; < + &gt; > + &quot; " + &apos; ' +</pre></div><p> +These are recognized when the XML document is read, and translated to there UTF-8 equivalents. For instance, text with the XML of:<p> +<div class="fragment"><pre class="fragment"> Far &amp; Away +</pre></div><p> +will have the Value() of "Far & Away" when queried from the <a class="el" href="classTiXmlText.html">TiXmlText</a> object, and will be written back to the XML stream/file as an ampersand. Older versions of TinyXML "preserved" character entities, but the newer versions will translate them into characters.<p> +Additionally, any character can be specified by its Unicode code point: The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher.<p> +<h3>Printing </h3> +<p> +TinyXML can print output in several different ways that all have strengths and limitations.<p> +<ul> +<li>Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout.<ul> +<li>"Pretty prints", but you don't have control over printing options.</li><li>The output is streamed directly to the FILE object, so there is no memory overhead in the TinyXML code.</li><li>used by Print() and SaveFile()</li></ul> +</li></ul> +<p> +<ul> +<li>operator<<. Output to a c++ stream.<ul> +<li>Integrates with standart C++ iostreams.</li><li>Outputs in "network printing" mode without line breaks. Good for network transmission and moving XML between C++ objects, but hard for a human to read.</li></ul> +</li></ul> +<p> +<ul> +<li><a class="el" href="classTiXmlPrinter.html">TiXmlPrinter</a>. Output to a std::string or memory buffer.<ul> +<li>API is less concise</li><li>Future printing options will be put here.</li><li>Printing may change slightly in future versions as it is refined and expanded.</li></ul> +</li></ul> +<p> +<h3>Streams </h3> +<p> +With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well as C (FILE*) streams. There are some differences that you may need to be aware of.<p> +C style output:<ul> +<li>based on FILE*</li><li>the Print() and SaveFile() methods</li></ul> +<p> +Generates formatted output, with plenty of white space, intended to be as human-readable as possible. They are very fast, and tolerant of ill formed XML documents. For example, an XML document that contains 2 root elements and 2 declarations, will still print.<p> +C style input:<ul> +<li>based on FILE*</li><li>the Parse() and LoadFile() methods</li></ul> +<p> +A fast, tolerant read. Use whenever you don't need the C++ streams.<p> +C++ style output:<ul> +<li>based on std::ostream</li><li>operator<<</li></ul> +<p> +Generates condensed output, intended for network transmission rather than readability. Depending on your system's implementation of the ostream class, these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: a document should contain the correct one root element. Additional root level elements will not be streamed out.<p> +C++ style input:<ul> +<li>based on std::istream</li><li>operator>></li></ul> +<p> +Reads XML from a stream, making it useful for network transmission. The tricky part is knowing when the XML document is complete, since there will almost certainly be other data in the stream. TinyXML will assume the XML data is complete after it reads the root element. Put another way, documents that are ill-constructed with more than one root element will not read correctly. Also note that operator>> is somewhat slower than Parse, due to both implementation of the STL and limitations of TinyXML.<p> +<h3>White space </h3> +<p> +The world simply does not agree on whether white space should be kept, or condensed. For example, pretend the '_' is a space, and look at "Hello____world". HTML, and at least some XML parsers, will interpret this as "Hello_world". They condense white space. Some XML parsers do not, and will leave it as "Hello____world". (Remember to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become Hello___world.<p> +It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the first 2 approaches. Call <a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">TiXmlBase::SetCondenseWhiteSpace( bool )</a> to set the desired behavior. The default is to condense white space.<p> +If you change the default, you should call <a class="el" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">TiXmlBase::SetCondenseWhiteSpace( bool )</a> before making any calls to Parse XML data, and I don't recommend changing it after it has been set.<p> +<h3>Handles </h3> +<p> +Where browsing an XML document in a robust way, it is important to check for null returns from method calls. An error safe implementation can generate a lot of code like:<p> +<div class="fragment"><pre class="fragment">TiXmlElement* root = document.FirstChildElement( "Document" ); +if ( root ) +{ + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. +</pre></div><p> +Handles have been introduced to clean this up. Using the <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> class, the previous code reduces to:<p> +<div class="fragment"><pre class="fragment">TiXmlHandle docHandle( &document ); +TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); +if ( child2 ) +{ + // do something useful +</pre></div><p> +Which is much easier to deal with. See <a class="el" href="classTiXmlHandle.html">TiXmlHandle</a> for more information.<p> +<h3>Row and Column tracking </h3> +<p> +Being able to track nodes and attributes back to their origin location in source files can be very important for some applications. Additionally, knowing where parsing errors occured in the original source can be very time saving.<p> +TinyXML can tracks the row and column origin of all nodes and attributes in a text file. The <a class="el" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">TiXmlBase::Row()</a> and <a class="el" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">TiXmlBase::Column()</a> methods return the origin of the node in the source text. The correct tabs can be configured in <a class="el" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">TiXmlDocument::SetTabSize()</a>.<p> +<h2>Using and Installing </h2> +<p> +To Compile and Run xmltest:<p> +A Linux Makefile and a Windows Visual C++ .dsw file is provided. Simply compile and run. It will write the file demotest.xml to your disk and generate output on the screen. It also tests walking the DOM by printing out the number of nodes found using different techniques.<p> +The Linux makefile is very generic and runs on many systems - it is currently tested on mingw and MacOSX. You do not need to run 'make depend'. The dependecies have been hard coded.<p> +<h3>Windows project file for VC6</h3> +<p> +<ul> +<li> +tinyxml: tinyxml library, non-STL </li> +<li> +tinyxmlSTL: tinyxml library, STL </li> +<li> +tinyXmlTest: test app, non-STL </li> +<li> +tinyXmlTestSTL: test app, STL </li> +</ul> +<p> +<h3>Makefile</h3> +<p> +At the top of the makefile you can set:<p> +PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in the makefile.<p> +In the tinyxml directory, type "make clean" then "make". The executable file 'xmltest' will be created.<p> +<h3>To Use in an Application:</h3> +<p> +Add tinyxml.cpp, <a class="el" href="tinyxml_8h-source.html">tinyxml.h</a>, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and <a class="el" href="tinystr_8h-source.html">tinystr.h</a> to your project or make file. That's it! It should compile on any reasonably compliant C++ system. You do not need to enable exceptions or RTTI for TinyXML.<p> +<h2>How TinyXML works. </h2> +<p> +An example is probably the best way to go. Take: <div class="fragment"><pre class="fragment"> <?xml version="1.0" standalone=no> + <!-- Our to do list data --> + <ToDo> + <Item priority="1"> Go to the <bold>Toy store!</bold></Item> + <Item priority="2"> Do bills</Item> + </ToDo> +</pre></div><p> +Its not much of a To Do list, but it will do. To read this file (say "demo.xml") you would create a document, and parse it in: <div class="fragment"><pre class="fragment"> TiXmlDocument doc( "demo.xml" ); + doc.LoadFile(); +</pre></div><p> +And its ready to go. Now lets look at some lines and how they relate to the DOM.<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" standalone=no> +</pre></div><p> +The first line is a declaration, and gets turned into the <a class="el" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> class. It will be the first child of the document node.<p> +This is the only directive/special tag parsed by by TinyXML. Generally directive tags are stored in <a class="el" href="classTiXmlUnknown.html">TiXmlUnknown</a> so the commands wont be lost when it is saved back to disk.<p> +<div class="fragment"><pre class="fragment"><!-- Our to do list data --> +</pre></div><p> +A comment. Will become a <a class="el" href="classTiXmlComment.html">TiXmlComment</a> object.<p> +<div class="fragment"><pre class="fragment"><ToDo> +</pre></div><p> +The "ToDo" tag defines a <a class="el" href="classTiXmlElement.html">TiXmlElement</a> object. This one does not have any attributes, but does contain 2 other elements.<p> +<div class="fragment"><pre class="fragment"><Item priority="1"> +</pre></div><p> +Creates another <a class="el" href="classTiXmlElement.html">TiXmlElement</a> which is a child of the "ToDo" element. This element has 1 attribute, with the name "priority" and the value "1".<p> +<div class="fragment"><pre class="fragment">Go to the +</pre></div><p> +A <a class="el" href="classTiXmlText.html">TiXmlText</a>. This is a leaf node and cannot contain other nodes. It is a child of the "Item" <a class="el" href="classTiXmlElement.html">TiXmlElement</a>.<p> +<div class="fragment"><pre class="fragment"><bold> +</pre></div><p> +Another <a class="el" href="classTiXmlElement.html">TiXmlElement</a>, this one a child of the "Item" element.<p> +Etc.<p> +Looking at the entire object tree, you end up with: <div class="fragment"><pre class="fragment">TiXmlDocument "demo.xml" + TiXmlDeclaration "version='1.0'" "standalone=no" + TiXmlComment " Our to do list data" + TiXmlElement "ToDo" + TiXmlElement "Item" Attribtutes: priority = 1 + TiXmlText "Go to the " + TiXmlElement "bold" + TiXmlText "Toy store!" + TiXmlElement "Item" Attributes: priority=2 + TiXmlText "Do bills" +</pre></div><p> +<h2>Documentation </h2> +<p> +The documentation is build with Doxygen, using the 'dox' configuration file.<p> +<h2>License </h2> +<p> +TinyXML is released under the zlib license:<p> +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.<p> +Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:<p> +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.<p> +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.<p> +3. This notice may not be removed or altered from any source distribution.<p> +<h2>References </h2> +<p> +The World Wide Web Consortium is the definitive standard body for XML, and there web pages contain huge amounts of information.<p> +The definitive spec: <a href="http://www.w3.org/TR/2004/REC-xml-20040204/">http://www.w3.org/TR/2004/REC-xml-20040204/</a><p> +I also recommend "XML Pocket Reference" by Robert Eckstein and published by OReilly...the book that got the whole thing started.<p> +<h2>Contributors, Contacts, and a Brief History </h2> +<p> +Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. A special thanks to the contributors on the web pages that keep it lively.<p> +So many people have sent in bugs and ideas, that rather than list here we try to give credit due in the "changes.txt" file.<p> +TinyXML was originally written by Lee Thomason. (Often the "I" still in the documentation.) Lee reviews changes and releases new versions, with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community.<p> +We appreciate your suggestions, and would love to know if you use TinyXML. Hopefully you will enjoy it and find it useful. Please post questions, comments, file bugs, or contact us at:<p> +www.sourceforge.net/projects/tinyxml<p> +Lee Thomason, Yves Berquin, Andrew Ellerton <hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:22 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/pages.html b/shared/tinyxml/docs/pages.html new file mode 100644 index 00000000..b23a328b --- /dev/null +++ b/shared/tinyxml/docs/pages.html @@ -0,0 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: Page Index</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li id="current"><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1>TinyXml Related Pages</h1>Here is a list of all related documentation pages:<ul> +<li><a class="el" href="deprecated.html">Deprecated List</a> + +</ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/tab_b.gif b/shared/tinyxml/docs/tab_b.gif Binary files differnew file mode 100644 index 00000000..0d623483 --- /dev/null +++ b/shared/tinyxml/docs/tab_b.gif diff --git a/shared/tinyxml/docs/tab_l.gif b/shared/tinyxml/docs/tab_l.gif Binary files differnew file mode 100644 index 00000000..9b1e6337 --- /dev/null +++ b/shared/tinyxml/docs/tab_l.gif diff --git a/shared/tinyxml/docs/tab_r.gif b/shared/tinyxml/docs/tab_r.gif Binary files differnew file mode 100644 index 00000000..ce9dd9f5 --- /dev/null +++ b/shared/tinyxml/docs/tab_r.gif diff --git a/shared/tinyxml/docs/tabs.css b/shared/tinyxml/docs/tabs.css new file mode 100644 index 00000000..a61552a6 --- /dev/null +++ b/shared/tinyxml/docs/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI#current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI#current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.nav +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/shared/tinyxml/docs/tinystr_8h-source.html b/shared/tinyxml/docs/tinystr_8h-source.html new file mode 100644 index 00000000..71408eed --- /dev/null +++ b/shared/tinyxml/docs/tinystr_8h-source.html @@ -0,0 +1,338 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: tinystr.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1>tinystr.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> +<a name="l00002"></a>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span> +<a name="l00003"></a>00003 <span class="comment">Original file by Yves Berquin.</span> +<a name="l00004"></a>00004 <span class="comment"></span> +<a name="l00005"></a>00005 <span class="comment">This software is provided 'as-is', without any express or implied</span> +<a name="l00006"></a>00006 <span class="comment">warranty. In no event will the authors be held liable for any</span> +<a name="l00007"></a>00007 <span class="comment">damages arising from the use of this software.</span> +<a name="l00008"></a>00008 <span class="comment"></span> +<a name="l00009"></a>00009 <span class="comment">Permission is granted to anyone to use this software for any</span> +<a name="l00010"></a>00010 <span class="comment">purpose, including commercial applications, and to alter it and</span> +<a name="l00011"></a>00011 <span class="comment">redistribute it freely, subject to the following restrictions:</span> +<a name="l00012"></a>00012 <span class="comment"></span> +<a name="l00013"></a>00013 <span class="comment">1. The origin of this software must not be misrepresented; you must</span> +<a name="l00014"></a>00014 <span class="comment">not claim that you wrote the original software. If you use this</span> +<a name="l00015"></a>00015 <span class="comment">software in a product, an acknowledgment in the product documentation</span> +<a name="l00016"></a>00016 <span class="comment">would be appreciated but is not required.</span> +<a name="l00017"></a>00017 <span class="comment"></span> +<a name="l00018"></a>00018 <span class="comment">2. Altered source versions must be plainly marked as such, and</span> +<a name="l00019"></a>00019 <span class="comment">must not be misrepresented as being the original software.</span> +<a name="l00020"></a>00020 <span class="comment"></span> +<a name="l00021"></a>00021 <span class="comment">3. This notice may not be removed or altered from any source</span> +<a name="l00022"></a>00022 <span class="comment">distribution.</span> +<a name="l00023"></a>00023 <span class="comment">*/</span> +<a name="l00024"></a>00024 +<a name="l00025"></a>00025 <span class="comment">/*</span> +<a name="l00026"></a>00026 <span class="comment"> * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005.</span> +<a name="l00027"></a>00027 <span class="comment"> *</span> +<a name="l00028"></a>00028 <span class="comment"> * - completely rewritten. compact, clean, and fast implementation.</span> +<a name="l00029"></a>00029 <span class="comment"> * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems)</span> +<a name="l00030"></a>00030 <span class="comment"> * - fixed reserve() to work as per specification.</span> +<a name="l00031"></a>00031 <span class="comment"> * - fixed buggy compares operator==(), operator<(), and operator>()</span> +<a name="l00032"></a>00032 <span class="comment"> * - fixed operator+=() to take a const ref argument, following spec.</span> +<a name="l00033"></a>00033 <span class="comment"> * - added "copy" constructor with length, and most compare operators.</span> +<a name="l00034"></a>00034 <span class="comment"> * - added swap(), clear(), size(), capacity(), operator+().</span> +<a name="l00035"></a>00035 <span class="comment"> */</span> +<a name="l00036"></a>00036 +<a name="l00037"></a>00037 <span class="preprocessor">#ifndef TIXML_USE_STL</span> +<a name="l00038"></a>00038 <span class="preprocessor"></span> +<a name="l00039"></a>00039 <span class="preprocessor">#ifndef TIXML_STRING_INCLUDED</span> +<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define TIXML_STRING_INCLUDED</span> +<a name="l00041"></a>00041 <span class="preprocessor"></span> +<a name="l00042"></a>00042 <span class="preprocessor">#include <assert.h></span> +<a name="l00043"></a>00043 <span class="preprocessor">#include <string.h></span> +<a name="l00044"></a>00044 +<a name="l00045"></a>00045 <span class="comment">/* The support for explicit isn't that universal, and it isn't really</span> +<a name="l00046"></a>00046 <span class="comment"> required - it is used to check that the TiXmlString class isn't incorrectly</span> +<a name="l00047"></a>00047 <span class="comment"> used. Be nice to old compilers and macro it here:</span> +<a name="l00048"></a>00048 <span class="comment">*/</span> +<a name="l00049"></a>00049 <span class="preprocessor">#if defined(_MSC_VER) && (_MSC_VER >= 1200 )</span> +<a name="l00050"></a>00050 <span class="preprocessor"></span> <span class="comment">// Microsoft visual studio, version 6 and higher.</span> +<a name="l00051"></a>00051 <span class="preprocessor"> #define TIXML_EXPLICIT explicit</span> +<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__GNUC__) && (__GNUC__ >= 3 )</span> +<a name="l00053"></a>00053 <span class="preprocessor"></span> <span class="comment">// GCC version 3 and higher.s</span> +<a name="l00054"></a>00054 <span class="preprocessor"> #define TIXML_EXPLICIT explicit</span> +<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#else</span> +<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_EXPLICIT</span> +<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +<a name="l00058"></a>00058 <span class="preprocessor"></span> +<a name="l00059"></a>00059 +<a name="l00060"></a>00060 <span class="comment">/*</span> +<a name="l00061"></a>00061 <span class="comment"> TiXmlString is an emulation of a subset of the std::string template.</span> +<a name="l00062"></a>00062 <span class="comment"> Its purpose is to allow compiling TinyXML on compilers with no or poor STL support.</span> +<a name="l00063"></a>00063 <span class="comment"> Only the member functions relevant to the TinyXML project have been implemented.</span> +<a name="l00064"></a>00064 <span class="comment"> The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase</span> +<a name="l00065"></a>00065 <span class="comment"> a string and there's no more room, we allocate a buffer twice as big as we need.</span> +<a name="l00066"></a>00066 <span class="comment">*/</span> +<a name="l00067"></a>00067 <span class="keyword">class </span>TiXmlString +<a name="l00068"></a>00068 { +<a name="l00069"></a>00069 <span class="keyword">public</span> : +<a name="l00070"></a>00070 <span class="comment">// The size type used</span> +<a name="l00071"></a>00071 <span class="keyword">typedef</span> size_t size_type; +<a name="l00072"></a>00072 +<a name="l00073"></a>00073 <span class="comment">// Error value for find primitive</span> +<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keyword">const</span> size_type npos; <span class="comment">// = -1;</span> +<a name="l00075"></a>00075 +<a name="l00076"></a>00076 +<a name="l00077"></a>00077 <span class="comment">// TiXmlString empty constructor</span> +<a name="l00078"></a>00078 TiXmlString () : rep_(&nullrep_) +<a name="l00079"></a>00079 { +<a name="l00080"></a>00080 } +<a name="l00081"></a>00081 +<a name="l00082"></a>00082 <span class="comment">// TiXmlString copy constructor</span> +<a name="l00083"></a>00083 TiXmlString ( <span class="keyword">const</span> TiXmlString & copy) : rep_(0) +<a name="l00084"></a>00084 { +<a name="l00085"></a>00085 init(copy.length()); +<a name="l00086"></a>00086 memcpy(start(), copy.data(), length()); +<a name="l00087"></a>00087 } +<a name="l00088"></a>00088 +<a name="l00089"></a>00089 <span class="comment">// TiXmlString constructor, based on a string</span> +<a name="l00090"></a>00090 TIXML_EXPLICIT TiXmlString ( <span class="keyword">const</span> <span class="keywordtype">char</span> * copy) : rep_(0) +<a name="l00091"></a>00091 { +<a name="l00092"></a>00092 init( static_cast<size_type>( strlen(copy) )); +<a name="l00093"></a>00093 memcpy(start(), copy, length()); +<a name="l00094"></a>00094 } +<a name="l00095"></a>00095 +<a name="l00096"></a>00096 <span class="comment">// TiXmlString constructor, based on a string</span> +<a name="l00097"></a>00097 TIXML_EXPLICIT TiXmlString ( <span class="keyword">const</span> <span class="keywordtype">char</span> * str, size_type len) : rep_(0) +<a name="l00098"></a>00098 { +<a name="l00099"></a>00099 init(len); +<a name="l00100"></a>00100 memcpy(start(), str, len); +<a name="l00101"></a>00101 } +<a name="l00102"></a>00102 +<a name="l00103"></a>00103 <span class="comment">// TiXmlString destructor</span> +<a name="l00104"></a>00104 ~TiXmlString () +<a name="l00105"></a>00105 { +<a name="l00106"></a>00106 quit(); +<a name="l00107"></a>00107 } +<a name="l00108"></a>00108 +<a name="l00109"></a>00109 <span class="comment">// = operator</span> +<a name="l00110"></a>00110 TiXmlString& operator = (<span class="keyword">const</span> <span class="keywordtype">char</span> * copy) +<a name="l00111"></a>00111 { +<a name="l00112"></a>00112 <span class="keywordflow">return</span> assign( copy, (size_type)strlen(copy)); +<a name="l00113"></a>00113 } +<a name="l00114"></a>00114 +<a name="l00115"></a>00115 <span class="comment">// = operator</span> +<a name="l00116"></a>00116 TiXmlString& operator = (<span class="keyword">const</span> TiXmlString & copy) +<a name="l00117"></a>00117 { +<a name="l00118"></a>00118 <span class="keywordflow">return</span> assign(copy.start(), copy.length()); +<a name="l00119"></a>00119 } +<a name="l00120"></a>00120 +<a name="l00121"></a>00121 +<a name="l00122"></a>00122 <span class="comment">// += operator. Maps to append</span> +<a name="l00123"></a>00123 TiXmlString& operator += (<span class="keyword">const</span> <span class="keywordtype">char</span> * suffix) +<a name="l00124"></a>00124 { +<a name="l00125"></a>00125 <span class="keywordflow">return</span> append(suffix, static_cast<size_type>( strlen(suffix) )); +<a name="l00126"></a>00126 } +<a name="l00127"></a>00127 +<a name="l00128"></a>00128 <span class="comment">// += operator. Maps to append</span> +<a name="l00129"></a>00129 TiXmlString& operator += (<span class="keywordtype">char</span> single) +<a name="l00130"></a>00130 { +<a name="l00131"></a>00131 <span class="keywordflow">return</span> append(&single, 1); +<a name="l00132"></a>00132 } +<a name="l00133"></a>00133 +<a name="l00134"></a>00134 <span class="comment">// += operator. Maps to append</span> +<a name="l00135"></a>00135 TiXmlString& operator += (<span class="keyword">const</span> TiXmlString & suffix) +<a name="l00136"></a>00136 { +<a name="l00137"></a>00137 <span class="keywordflow">return</span> append(suffix.data(), suffix.length()); +<a name="l00138"></a>00138 } +<a name="l00139"></a>00139 +<a name="l00140"></a>00140 +<a name="l00141"></a>00141 <span class="comment">// Convert a TiXmlString into a null-terminated char *</span> +<a name="l00142"></a>00142 <span class="keyword">const</span> <span class="keywordtype">char</span> * c_str ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; } +<a name="l00143"></a>00143 +<a name="l00144"></a>00144 <span class="comment">// Convert a TiXmlString into a char * (need not be null terminated).</span> +<a name="l00145"></a>00145 <span class="keyword">const</span> <span class="keywordtype">char</span> * data ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; } +<a name="l00146"></a>00146 +<a name="l00147"></a>00147 <span class="comment">// Return the length of a TiXmlString</span> +<a name="l00148"></a>00148 size_type length ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size; } +<a name="l00149"></a>00149 +<a name="l00150"></a>00150 <span class="comment">// Alias for length()</span> +<a name="l00151"></a>00151 size_type size ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size; } +<a name="l00152"></a>00152 +<a name="l00153"></a>00153 <span class="comment">// Checks if a TiXmlString is empty</span> +<a name="l00154"></a>00154 <span class="keywordtype">bool</span> empty ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->size == 0; } +<a name="l00155"></a>00155 +<a name="l00156"></a>00156 <span class="comment">// Return capacity of string</span> +<a name="l00157"></a>00157 size_type capacity ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->capacity; } +<a name="l00158"></a>00158 +<a name="l00159"></a>00159 +<a name="l00160"></a>00160 <span class="comment">// single char extraction</span> +<a name="l00161"></a>00161 <span class="keyword">const</span> <span class="keywordtype">char</span>& at (size_type index)<span class="keyword"> const</span> +<a name="l00162"></a>00162 <span class="keyword"> </span>{ +<a name="l00163"></a>00163 assert( index < length() ); +<a name="l00164"></a>00164 <span class="keywordflow">return</span> rep_->str[ index ]; +<a name="l00165"></a>00165 } +<a name="l00166"></a>00166 +<a name="l00167"></a>00167 <span class="comment">// [] operator</span> +<a name="l00168"></a>00168 <span class="keywordtype">char</span>& operator [] (size_type index)<span class="keyword"> const</span> +<a name="l00169"></a>00169 <span class="keyword"> </span>{ +<a name="l00170"></a>00170 assert( index < length() ); +<a name="l00171"></a>00171 <span class="keywordflow">return</span> rep_->str[ index ]; +<a name="l00172"></a>00172 } +<a name="l00173"></a>00173 +<a name="l00174"></a>00174 <span class="comment">// find a char in a string. Return TiXmlString::npos if not found</span> +<a name="l00175"></a>00175 size_type find (<span class="keywordtype">char</span> lookup)<span class="keyword"> const</span> +<a name="l00176"></a>00176 <span class="keyword"> </span>{ +<a name="l00177"></a>00177 <span class="keywordflow">return</span> find(lookup, 0); +<a name="l00178"></a>00178 } +<a name="l00179"></a>00179 +<a name="l00180"></a>00180 <span class="comment">// find a char in a string from an offset. Return TiXmlString::npos if not found</span> +<a name="l00181"></a>00181 size_type find (<span class="keywordtype">char</span> tofind, size_type offset)<span class="keyword"> const</span> +<a name="l00182"></a>00182 <span class="keyword"> </span>{ +<a name="l00183"></a>00183 <span class="keywordflow">if</span> (offset >= length()) <span class="keywordflow">return</span> npos; +<a name="l00184"></a>00184 +<a name="l00185"></a>00185 <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keywordtype">char</span>* p = c_str() + offset; *p != <span class="charliteral">'\0'</span>; ++p) +<a name="l00186"></a>00186 { +<a name="l00187"></a>00187 <span class="keywordflow">if</span> (*p == tofind) <span class="keywordflow">return</span> static_cast< size_type >( p - c_str() ); +<a name="l00188"></a>00188 } +<a name="l00189"></a>00189 <span class="keywordflow">return</span> npos; +<a name="l00190"></a>00190 } +<a name="l00191"></a>00191 +<a name="l00192"></a>00192 <span class="keywordtype">void</span> clear () +<a name="l00193"></a>00193 { +<a name="l00194"></a>00194 <span class="comment">//Lee:</span> +<a name="l00195"></a>00195 <span class="comment">//The original was just too strange, though correct:</span> +<a name="l00196"></a>00196 <span class="comment">// TiXmlString().swap(*this);</span> +<a name="l00197"></a>00197 <span class="comment">//Instead use the quit & re-init:</span> +<a name="l00198"></a>00198 quit(); +<a name="l00199"></a>00199 init(0,0); +<a name="l00200"></a>00200 } +<a name="l00201"></a>00201 +<a name="l00202"></a>00202 <span class="comment">/* Function to reserve a big amount of data when we know we'll need it. Be aware that this</span> +<a name="l00203"></a>00203 <span class="comment"> function DOES NOT clear the content of the TiXmlString if any exists.</span> +<a name="l00204"></a>00204 <span class="comment"> */</span> +<a name="l00205"></a>00205 <span class="keywordtype">void</span> reserve (size_type cap); +<a name="l00206"></a>00206 +<a name="l00207"></a>00207 TiXmlString& assign (<span class="keyword">const</span> <span class="keywordtype">char</span>* str, size_type len); +<a name="l00208"></a>00208 +<a name="l00209"></a>00209 TiXmlString& append (<span class="keyword">const</span> <span class="keywordtype">char</span>* str, size_type len); +<a name="l00210"></a>00210 +<a name="l00211"></a>00211 <span class="keywordtype">void</span> swap (TiXmlString& other) +<a name="l00212"></a>00212 { +<a name="l00213"></a>00213 Rep* r = rep_; +<a name="l00214"></a>00214 rep_ = other.rep_; +<a name="l00215"></a>00215 other.rep_ = r; +<a name="l00216"></a>00216 } +<a name="l00217"></a>00217 +<a name="l00218"></a>00218 <span class="keyword">private</span>: +<a name="l00219"></a>00219 +<a name="l00220"></a>00220 <span class="keywordtype">void</span> init(size_type sz) { init(sz, sz); } +<a name="l00221"></a>00221 <span class="keywordtype">void</span> set_size(size_type sz) { rep_->str[ rep_->size = sz ] = <span class="charliteral">'\0'</span>; } +<a name="l00222"></a>00222 <span class="keywordtype">char</span>* start()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str; } +<a name="l00223"></a>00223 <span class="keywordtype">char</span>* finish()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rep_->str + rep_->size; } +<a name="l00224"></a>00224 +<a name="l00225"></a>00225 <span class="keyword">struct </span>Rep +<a name="l00226"></a>00226 { +<a name="l00227"></a>00227 size_type size, capacity; +<a name="l00228"></a>00228 <span class="keywordtype">char</span> str[1]; +<a name="l00229"></a>00229 }; +<a name="l00230"></a>00230 +<a name="l00231"></a>00231 <span class="keywordtype">void</span> init(size_type sz, size_type cap) +<a name="l00232"></a>00232 { +<a name="l00233"></a>00233 <span class="keywordflow">if</span> (cap) +<a name="l00234"></a>00234 { +<a name="l00235"></a>00235 <span class="comment">// Lee: the original form:</span> +<a name="l00236"></a>00236 <span class="comment">// rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap));</span> +<a name="l00237"></a>00237 <span class="comment">// doesn't work in some cases of new being overloaded. Switching</span> +<a name="l00238"></a>00238 <span class="comment">// to the normal allocation, although use an 'int' for systems</span> +<a name="l00239"></a>00239 <span class="comment">// that are overly picky about structure alignment.</span> +<a name="l00240"></a>00240 <span class="keyword">const</span> size_type bytesNeeded = <span class="keyword">sizeof</span>(Rep) + cap; +<a name="l00241"></a>00241 <span class="keyword">const</span> size_type intsNeeded = ( bytesNeeded + <span class="keyword">sizeof</span>(int) - 1 ) / <span class="keyword">sizeof</span>( int ); +<a name="l00242"></a>00242 rep_ = reinterpret_cast<Rep*>( <span class="keyword">new</span> <span class="keywordtype">int</span>[ intsNeeded ] ); +<a name="l00243"></a>00243 +<a name="l00244"></a>00244 rep_->str[ rep_->size = sz ] = <span class="charliteral">'\0'</span>; +<a name="l00245"></a>00245 rep_->capacity = cap; +<a name="l00246"></a>00246 } +<a name="l00247"></a>00247 <span class="keywordflow">else</span> +<a name="l00248"></a>00248 { +<a name="l00249"></a>00249 rep_ = &nullrep_; +<a name="l00250"></a>00250 } +<a name="l00251"></a>00251 } +<a name="l00252"></a>00252 +<a name="l00253"></a>00253 <span class="keywordtype">void</span> quit() +<a name="l00254"></a>00254 { +<a name="l00255"></a>00255 <span class="keywordflow">if</span> (rep_ != &nullrep_) +<a name="l00256"></a>00256 { +<a name="l00257"></a>00257 <span class="comment">// The rep_ is really an array of ints. (see the allocator, above).</span> +<a name="l00258"></a>00258 <span class="comment">// Cast it back before delete, so the compiler won't incorrectly call destructors.</span> +<a name="l00259"></a>00259 <span class="keyword">delete</span> [] ( reinterpret_cast<int*>( rep_ ) ); +<a name="l00260"></a>00260 } +<a name="l00261"></a>00261 } +<a name="l00262"></a>00262 +<a name="l00263"></a>00263 Rep * rep_; +<a name="l00264"></a>00264 <span class="keyword">static</span> Rep nullrep_; +<a name="l00265"></a>00265 +<a name="l00266"></a>00266 } ; +<a name="l00267"></a>00267 +<a name="l00268"></a>00268 +<a name="l00269"></a>00269 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) +<a name="l00270"></a>00270 { +<a name="l00271"></a>00271 <span class="keywordflow">return</span> ( a.length() == b.length() ) <span class="comment">// optimization on some platforms</span> +<a name="l00272"></a>00272 && ( strcmp(a.c_str(), b.c_str()) == 0 ); <span class="comment">// actual compare</span> +<a name="l00273"></a>00273 } +<a name="l00274"></a>00274 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator < (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) +<a name="l00275"></a>00275 { +<a name="l00276"></a>00276 <span class="keywordflow">return</span> strcmp(a.c_str(), b.c_str()) < 0; +<a name="l00277"></a>00277 } +<a name="l00278"></a>00278 +<a name="l00279"></a>00279 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(a == b); } +<a name="l00280"></a>00280 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator > (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> b < a; } +<a name="l00281"></a>00281 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator <= (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(b < a); } +<a name="l00282"></a>00282 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator >= (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(a < b); } +<a name="l00283"></a>00283 +<a name="l00284"></a>00284 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b) { <span class="keywordflow">return</span> strcmp(a.c_str(), b) == 0; } +<a name="l00285"></a>00285 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator == (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> b == a; } +<a name="l00286"></a>00286 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b) { <span class="keywordflow">return</span> !(a == b); } +<a name="l00287"></a>00287 <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator != (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b) { <span class="keywordflow">return</span> !(b == a); } +<a name="l00288"></a>00288 +<a name="l00289"></a>00289 TiXmlString operator + (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> TiXmlString & b); +<a name="l00290"></a>00290 TiXmlString operator + (<span class="keyword">const</span> TiXmlString & a, <span class="keyword">const</span> <span class="keywordtype">char</span>* b); +<a name="l00291"></a>00291 TiXmlString operator + (<span class="keyword">const</span> <span class="keywordtype">char</span>* a, <span class="keyword">const</span> TiXmlString & b); +<a name="l00292"></a>00292 +<a name="l00293"></a>00293 +<a name="l00294"></a>00294 <span class="comment">/*</span> +<a name="l00295"></a>00295 <span class="comment"> TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString.</span> +<a name="l00296"></a>00296 <span class="comment"> Only the operators that we need for TinyXML have been developped.</span> +<a name="l00297"></a>00297 <span class="comment">*/</span> +<a name="l00298"></a>00298 <span class="keyword">class </span>TiXmlOutStream : <span class="keyword">public</span> TiXmlString +<a name="l00299"></a>00299 { +<a name="l00300"></a>00300 <span class="keyword">public</span> : +<a name="l00301"></a>00301 +<a name="l00302"></a>00302 <span class="comment">// TiXmlOutStream << operator.</span> +<a name="l00303"></a>00303 TiXmlOutStream & operator << (<span class="keyword">const</span> TiXmlString & in) +<a name="l00304"></a>00304 { +<a name="l00305"></a>00305 *<span class="keyword">this</span> += in; +<a name="l00306"></a>00306 <span class="keywordflow">return</span> *<span class="keyword">this</span>; +<a name="l00307"></a>00307 } +<a name="l00308"></a>00308 +<a name="l00309"></a>00309 <span class="comment">// TiXmlOutStream << operator.</span> +<a name="l00310"></a>00310 TiXmlOutStream & operator << (<span class="keyword">const</span> <span class="keywordtype">char</span> * in) +<a name="l00311"></a>00311 { +<a name="l00312"></a>00312 *<span class="keyword">this</span> += in; +<a name="l00313"></a>00313 <span class="keywordflow">return</span> *<span class="keyword">this</span>; +<a name="l00314"></a>00314 } +<a name="l00315"></a>00315 +<a name="l00316"></a>00316 } ; +<a name="l00317"></a>00317 +<a name="l00318"></a>00318 <span class="preprocessor">#endif // TIXML_STRING_INCLUDED</span> +<a name="l00319"></a>00319 <span class="preprocessor"></span><span class="preprocessor">#endif // TIXML_USE_STL</span> +</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:22 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/tinyxml_8h-source.html b/shared/tinyxml/docs/tinyxml_8h-source.html new file mode 100644 index 00000000..135da9ce --- /dev/null +++ b/shared/tinyxml/docs/tinyxml_8h-source.html @@ -0,0 +1,1201 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: tinyxml.h Source File</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li id="current"><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<h1>tinyxml.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> +<a name="l00002"></a>00002 <span class="comment">www.sourceforge.net/projects/tinyxml</span> +<a name="l00003"></a>00003 <span class="comment">Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)</span> +<a name="l00004"></a>00004 <span class="comment"></span> +<a name="l00005"></a>00005 <span class="comment">This software is provided 'as-is', without any express or implied</span> +<a name="l00006"></a>00006 <span class="comment">warranty. In no event will the authors be held liable for any</span> +<a name="l00007"></a>00007 <span class="comment">damages arising from the use of this software.</span> +<a name="l00008"></a>00008 <span class="comment"></span> +<a name="l00009"></a>00009 <span class="comment">Permission is granted to anyone to use this software for any</span> +<a name="l00010"></a>00010 <span class="comment">purpose, including commercial applications, and to alter it and</span> +<a name="l00011"></a>00011 <span class="comment">redistribute it freely, subject to the following restrictions:</span> +<a name="l00012"></a>00012 <span class="comment"></span> +<a name="l00013"></a>00013 <span class="comment">1. The origin of this software must not be misrepresented; you must</span> +<a name="l00014"></a>00014 <span class="comment">not claim that you wrote the original software. If you use this</span> +<a name="l00015"></a>00015 <span class="comment">software in a product, an acknowledgment in the product documentation</span> +<a name="l00016"></a>00016 <span class="comment">would be appreciated but is not required.</span> +<a name="l00017"></a>00017 <span class="comment"></span> +<a name="l00018"></a>00018 <span class="comment">2. Altered source versions must be plainly marked as such, and</span> +<a name="l00019"></a>00019 <span class="comment">must not be misrepresented as being the original software.</span> +<a name="l00020"></a>00020 <span class="comment"></span> +<a name="l00021"></a>00021 <span class="comment">3. This notice may not be removed or altered from any source</span> +<a name="l00022"></a>00022 <span class="comment">distribution.</span> +<a name="l00023"></a>00023 <span class="comment">*/</span> +<a name="l00024"></a>00024 +<a name="l00025"></a>00025 +<a name="l00026"></a>00026 <span class="preprocessor">#ifndef TINYXML_INCLUDED</span> +<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define TINYXML_INCLUDED</span> +<a name="l00028"></a>00028 <span class="preprocessor"></span> +<a name="l00029"></a>00029 <span class="preprocessor">#ifdef _MSC_VER</span> +<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( push )</span> +<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4530 )</span> +<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( disable : 4786 )</span> +<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +<a name="l00034"></a>00034 <span class="preprocessor"></span> +<a name="l00035"></a>00035 <span class="preprocessor">#include <ctype.h></span> +<a name="l00036"></a>00036 <span class="preprocessor">#include <stdio.h></span> +<a name="l00037"></a>00037 <span class="preprocessor">#include <stdlib.h></span> +<a name="l00038"></a>00038 <span class="preprocessor">#include <string.h></span> +<a name="l00039"></a>00039 <span class="preprocessor">#include <assert.h></span> +<a name="l00040"></a>00040 +<a name="l00041"></a>00041 <span class="comment">// Help out windows:</span> +<a name="l00042"></a>00042 <span class="preprocessor">#if defined( _DEBUG ) && !defined( DEBUG )</span> +<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define DEBUG</span> +<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +<a name="l00045"></a>00045 <span class="preprocessor"></span> +<a name="l00046"></a>00046 <span class="preprocessor">#ifdef TIXML_USE_STL</span> +<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor"> #include <string></span> +<a name="l00048"></a>00048 <span class="preprocessor"> #include <iostream></span> +<a name="l00049"></a>00049 <span class="preprocessor"> #include <sstream></span> +<a name="l00050"></a>00050 <span class="preprocessor"> #define TIXML_STRING std::string</span> +<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#else</span> +<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor"> #include "tinystr.h"</span> +<a name="l00053"></a>00053 <span class="preprocessor"> #define TIXML_STRING TiXmlString</span> +<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +<a name="l00055"></a>00055 <span class="preprocessor"></span> +<a name="l00056"></a>00056 <span class="comment">// Deprecated library function hell. Compilers want to use the</span> +<a name="l00057"></a>00057 <span class="comment">// new safe versions. This probably doesn't fully address the problem,</span> +<a name="l00058"></a>00058 <span class="comment">// but it gets closer. There are too many compilers for me to fully</span> +<a name="l00059"></a>00059 <span class="comment">// test. If you get compilation troubles, undefine TIXML_SAFE</span> +<a name="l00060"></a>00060 <span class="preprocessor">#define TIXML_SAFE</span> +<a name="l00061"></a>00061 <span class="preprocessor"></span> +<a name="l00062"></a>00062 <span class="preprocessor">#ifdef TIXML_SAFE</span> +<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor"> #if defined(_MSC_VER) && (_MSC_VER >= 1400 )</span> +<a name="l00064"></a>00064 <span class="preprocessor"></span> <span class="comment">// Microsoft visual studio, version 2005 and higher.</span> +<a name="l00065"></a>00065 <span class="preprocessor"> #define TIXML_SNPRINTF _snprintf_s</span> +<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SNSCANF _snscanf_s</span> +<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SSCANF sscanf_s</span> +<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="preprocessor"> #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )</span> +<a name="l00069"></a>00069 <span class="preprocessor"></span> <span class="comment">// Microsoft visual studio, version 6 and higher.</span> +<a name="l00070"></a>00070 <span class="comment">//#pragma message( "Using _sn* functions." )</span> +<a name="l00071"></a>00071 <span class="preprocessor"> #define TIXML_SNPRINTF _snprintf</span> +<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SNSCANF _snscanf</span> +<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SSCANF sscanf</span> +<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor"> #elif defined(__GNUC__) && (__GNUC__ >= 3 )</span> +<a name="l00075"></a>00075 <span class="preprocessor"></span> <span class="comment">// GCC version 3 and higher.s</span> +<a name="l00076"></a>00076 <span class="comment">//#warning( "Using sn* functions." )</span> +<a name="l00077"></a>00077 <span class="preprocessor"> #define TIXML_SNPRINTF snprintf</span> +<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SNSCANF snscanf</span> +<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SSCANF sscanf</span> +<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor"> #else</span> +<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor"> #define TIXML_SSCANF sscanf</span> +<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#endif </span> +<a name="l00084"></a>00084 <span class="preprocessor"></span> +<a name="l00085"></a>00085 <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>; +<a name="l00086"></a>00086 <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>; +<a name="l00087"></a>00087 <span class="keyword">class </span><a class="code" href="classTiXmlComment.html">TiXmlComment</a>; +<a name="l00088"></a>00088 <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>; +<a name="l00089"></a>00089 <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>; +<a name="l00090"></a>00090 <span class="keyword">class </span><a class="code" href="classTiXmlText.html">TiXmlText</a>; +<a name="l00091"></a>00091 <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>; +<a name="l00092"></a>00092 <span class="keyword">class </span>TiXmlParsingData; +<a name="l00093"></a>00093 +<a name="l00094"></a>00094 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MAJOR_VERSION = 2; +<a name="l00095"></a>00095 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_MINOR_VERSION = 5; +<a name="l00096"></a>00096 <span class="keyword">const</span> <span class="keywordtype">int</span> TIXML_PATCH_VERSION = 3; +<a name="l00097"></a>00097 +<a name="l00098"></a>00098 <span class="comment">/* Internal structure for tracking location of items </span> +<a name="l00099"></a>00099 <span class="comment"> in the XML file.</span> +<a name="l00100"></a>00100 <span class="comment">*/</span> +<a name="l00101"></a>00101 <span class="keyword">struct </span>TiXmlCursor +<a name="l00102"></a>00102 { +<a name="l00103"></a>00103 TiXmlCursor() { Clear(); } +<a name="l00104"></a>00104 <span class="keywordtype">void</span> Clear() { row = col = -1; } +<a name="l00105"></a>00105 +<a name="l00106"></a>00106 <span class="keywordtype">int</span> row; <span class="comment">// 0 based.</span> +<a name="l00107"></a>00107 <span class="keywordtype">int</span> col; <span class="comment">// 0 based.</span> +<a name="l00108"></a>00108 }; +<a name="l00109"></a>00109 +<a name="l00110"></a>00110 +<a name="l00129"></a><a class="code" href="classTiXmlVisitor.html">00129</a> <span class="keyword">class </span><a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a> +<a name="l00130"></a>00130 { +<a name="l00131"></a>00131 <span class="keyword">public</span>: +<a name="l00132"></a>00132 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>() {} +<a name="l00133"></a>00133 +<a name="l00135"></a><a class="code" href="classTiXmlVisitor.html#07baecb52dd7d8716ae2a48ad0956ee0">00135</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& <span class="comment">/*doc*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00137"></a><a class="code" href="classTiXmlVisitor.html#a0ade4f27087447e93974e975c3246ad">00137</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a0ade4f27087447e93974e975c3246ad">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& <span class="comment">/*doc*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00138"></a>00138 +<a name="l00140"></a><a class="code" href="classTiXmlVisitor.html#f6c6178ffa517bbdba95d70490875fff">00140</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#07baecb52dd7d8716ae2a48ad0956ee0">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& <span class="comment">/*element*/</span>, <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <span class="comment">/*firstAttribute*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00142"></a><a class="code" href="classTiXmlVisitor.html#ec2b1f8116226d52f3a1b95dafd3a32c">00142</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#a0ade4f27087447e93974e975c3246ad">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& <span class="comment">/*element*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00143"></a>00143 +<a name="l00145"></a><a class="code" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">00145</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>& <span class="comment">/*declaration*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00147"></a><a class="code" href="classTiXmlVisitor.html#399b8ebca5cd14664974a32d2ce029e5">00147</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>& <span class="comment">/*text*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00149"></a><a class="code" href="classTiXmlVisitor.html#53a60e7a528627b31af3161972cc7fa2">00149</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>& <span class="comment">/*comment*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00151"></a><a class="code" href="classTiXmlVisitor.html#7e284d607d275c51dac1adb58159ce28">00151</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlVisitor.html#fad71c71ce6473fb9b4b64cd92de4a19">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>& <span class="comment">/*unknown*/</span> ) { <span class="keywordflow">return</span> <span class="keyword">true</span>; } +<a name="l00152"></a>00152 }; +<a name="l00153"></a>00153 +<a name="l00154"></a>00154 <span class="comment">// Only used by Attribute::Query functions</span> +<a name="l00155"></a>00155 <span class="keyword">enum</span> +<a name="l00156"></a>00156 { +<a name="l00157"></a>00157 TIXML_SUCCESS, +<a name="l00158"></a>00158 TIXML_NO_ATTRIBUTE, +<a name="l00159"></a>00159 TIXML_WRONG_TYPE +<a name="l00160"></a>00160 }; +<a name="l00161"></a>00161 +<a name="l00162"></a>00162 +<a name="l00163"></a>00163 <span class="comment">// Used by the parsing routines.</span> +<a name="l00164"></a>00164 <span class="keyword">enum</span> TiXmlEncoding +<a name="l00165"></a>00165 { +<a name="l00166"></a>00166 TIXML_ENCODING_UNKNOWN, +<a name="l00167"></a>00167 TIXML_ENCODING_UTF8, +<a name="l00168"></a>00168 TIXML_ENCODING_LEGACY +<a name="l00169"></a>00169 }; +<a name="l00170"></a>00170 +<a name="l00171"></a>00171 <span class="keyword">const</span> TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; +<a name="l00172"></a>00172 +<a name="l00195"></a><a class="code" href="classTiXmlBase.html">00195</a> <span class="keyword">class </span><a class="code" href="classTiXmlBase.html">TiXmlBase</a> +<a name="l00196"></a>00196 { +<a name="l00197"></a>00197 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html">TiXmlNode</a>; +<a name="l00198"></a>00198 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>; +<a name="l00199"></a>00199 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>; +<a name="l00200"></a>00200 +<a name="l00201"></a>00201 <span class="keyword">public</span>: +<a name="l00202"></a>00202 <a class="code" href="classTiXmlBase.html">TiXmlBase</a>() : <a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a>(0) {} +<a name="l00203"></a>00203 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlBase.html">TiXmlBase</a>() {} +<a name="l00204"></a>00204 +<a name="l00214"></a>00214 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#0de56b3f2ef14c65091a3b916437b512">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const </span>= 0; +<a name="l00215"></a>00215 +<a name="l00222"></a><a class="code" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">00222</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#0f799ec645bfb8d8a969e83478f379c1">SetCondenseWhiteSpace</a>( <span class="keywordtype">bool</span> condense ) { condenseWhiteSpace = condense; } +<a name="l00223"></a>00223 +<a name="l00225"></a><a class="code" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">00225</a> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlBase.html#d4b1472531c647a25b1840a87ae42438">IsWhiteSpaceCondensed</a>() { <span class="keywordflow">return</span> condenseWhiteSpace; } +<a name="l00226"></a>00226 +<a name="l00245"></a><a class="code" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">00245</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#024bceb070188df92c2a8d8852dd0853">Row</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> location.row + 1; } +<a name="l00246"></a><a class="code" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">00246</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlBase.html#b54bfb9b70fe6dd276e7b279cab7f003">Column</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> location.col + 1; } +<a name="l00247"></a>00247 +<a name="l00248"></a><a class="code" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">00248</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#c6b3e0f790930d4970ec30764e937b5d">SetUserData</a>( <span class="keywordtype">void</span>* user ) { <a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a> = user; } +<a name="l00249"></a><a class="code" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">00249</a> <span class="keywordtype">void</span>* <a class="code" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>() { <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a>; } +<a name="l00250"></a><a class="code" href="classTiXmlBase.html#d0120210e4680ef2088601753ce0ede4">00250</a> <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code" href="classTiXmlBase.html#6559a530ca6763fc301a14d77ed28c17">GetUserData</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a>; } +<a name="l00251"></a>00251 +<a name="l00252"></a>00252 <span class="comment">// Table that returs, for a given lead byte, the total number of bytes</span> +<a name="l00253"></a>00253 <span class="comment">// in the UTF-8 sequence.</span> +<a name="l00254"></a>00254 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> utf8ByteTable[256]; +<a name="l00255"></a>00255 +<a name="l00256"></a>00256 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">Parse</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, +<a name="l00257"></a>00257 TiXmlParsingData* data, +<a name="l00258"></a>00258 TiXmlEncoding encoding <span class="comment">/*= TIXML_ENCODING_UNKNOWN */</span> ) = 0; +<a name="l00259"></a>00259 +<a name="l00263"></a>00263 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlBase.html#6bd8c315c1acb09e34107b8736505948">EncodeString</a>( <span class="keyword">const</span> TIXML_STRING& str, TIXML_STRING* out ); +<a name="l00264"></a>00264 +<a name="l00265"></a>00265 <span class="keyword">enum</span> +<a name="l00266"></a>00266 { +<a name="l00267"></a>00267 TIXML_NO_ERROR = 0, +<a name="l00268"></a>00268 TIXML_ERROR, +<a name="l00269"></a>00269 TIXML_ERROR_OPENING_FILE, +<a name="l00270"></a>00270 TIXML_ERROR_OUT_OF_MEMORY, +<a name="l00271"></a>00271 TIXML_ERROR_PARSING_ELEMENT, +<a name="l00272"></a>00272 TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, +<a name="l00273"></a>00273 TIXML_ERROR_READING_ELEMENT_VALUE, +<a name="l00274"></a>00274 TIXML_ERROR_READING_ATTRIBUTES, +<a name="l00275"></a>00275 TIXML_ERROR_PARSING_EMPTY, +<a name="l00276"></a>00276 TIXML_ERROR_READING_END_TAG, +<a name="l00277"></a>00277 TIXML_ERROR_PARSING_UNKNOWN, +<a name="l00278"></a>00278 TIXML_ERROR_PARSING_COMMENT, +<a name="l00279"></a>00279 TIXML_ERROR_PARSING_DECLARATION, +<a name="l00280"></a>00280 TIXML_ERROR_DOCUMENT_EMPTY, +<a name="l00281"></a>00281 TIXML_ERROR_EMBEDDED_NULL, +<a name="l00282"></a>00282 TIXML_ERROR_PARSING_CDATA, +<a name="l00283"></a>00283 TIXML_ERROR_DOCUMENT_TOP_ONLY, +<a name="l00284"></a>00284 +<a name="l00285"></a>00285 TIXML_ERROR_STRING_COUNT +<a name="l00286"></a>00286 }; +<a name="l00287"></a>00287 +<a name="l00288"></a>00288 <span class="keyword">protected</span>: +<a name="l00289"></a>00289 +<a name="l00290"></a>00290 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* SkipWhiteSpace( <span class="keyword">const</span> <span class="keywordtype">char</span>*, TiXmlEncoding encoding ); +<a name="l00291"></a>00291 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> IsWhiteSpace( <span class="keywordtype">char</span> c ) +<a name="l00292"></a>00292 { +<a name="l00293"></a>00293 <span class="keywordflow">return</span> ( isspace( (<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) c ) || c == <span class="charliteral">'\n'</span> || c == <span class="charliteral">'\r'</span> ); +<a name="l00294"></a>00294 } +<a name="l00295"></a>00295 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> IsWhiteSpace( <span class="keywordtype">int</span> c ) +<a name="l00296"></a>00296 { +<a name="l00297"></a>00297 <span class="keywordflow">if</span> ( c < 256 ) +<a name="l00298"></a>00298 <span class="keywordflow">return</span> IsWhiteSpace( (<span class="keywordtype">char</span>) c ); +<a name="l00299"></a>00299 <span class="keywordflow">return</span> <span class="keyword">false</span>; <span class="comment">// Again, only truly correct for English/Latin...but usually works.</span> +<a name="l00300"></a>00300 } +<a name="l00301"></a>00301 +<a name="l00302"></a>00302 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00303"></a>00303 <span class="preprocessor"></span> <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); +<a name="l00304"></a>00304 <span class="keyword">static</span> <span class="keywordtype">bool</span> StreamTo( std::istream * in, <span class="keywordtype">int</span> character, TIXML_STRING * tag ); +<a name="l00305"></a>00305 <span class="preprocessor"> #endif</span> +<a name="l00306"></a>00306 <span class="preprocessor"></span> +<a name="l00307"></a>00307 <span class="comment">/* Reads an XML name into the string provided. Returns</span> +<a name="l00308"></a>00308 <span class="comment"> a pointer just past the last character of the name,</span> +<a name="l00309"></a>00309 <span class="comment"> or 0 if the function has an error.</span> +<a name="l00310"></a>00310 <span class="comment"> */</span> +<a name="l00311"></a>00311 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadName( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TIXML_STRING* name, TiXmlEncoding encoding ); +<a name="l00312"></a>00312 +<a name="l00313"></a>00313 <span class="comment">/* Reads text. Returns a pointer past the given end tag.</span> +<a name="l00314"></a>00314 <span class="comment"> Wickedly complex options, but it keeps the (sensitive) code in one place.</span> +<a name="l00315"></a>00315 <span class="comment"> */</span> +<a name="l00316"></a>00316 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadText( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, <span class="comment">// where to start</span> +<a name="l00317"></a>00317 TIXML_STRING* text, <span class="comment">// the string read</span> +<a name="l00318"></a>00318 <span class="keywordtype">bool</span> ignoreWhiteSpace, <span class="comment">// whether to keep the white space</span> +<a name="l00319"></a>00319 <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag, <span class="comment">// what ends this text</span> +<a name="l00320"></a>00320 <span class="keywordtype">bool</span> ignoreCase, <span class="comment">// whether to ignore case in the end tag</span> +<a name="l00321"></a>00321 TiXmlEncoding encoding ); <span class="comment">// the current encoding</span> +<a name="l00322"></a>00322 +<a name="l00323"></a>00323 <span class="comment">// If an entity has been found, transform it into a character.</span> +<a name="l00324"></a>00324 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetEntity( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding ); +<a name="l00325"></a>00325 +<a name="l00326"></a>00326 <span class="comment">// Get a character, while interpreting entities.</span> +<a name="l00327"></a>00327 <span class="comment">// The length can be from 0 to 4 bytes.</span> +<a name="l00328"></a>00328 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GetChar( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, <span class="keywordtype">char</span>* _value, <span class="keywordtype">int</span>* length, TiXmlEncoding encoding ) +<a name="l00329"></a>00329 { +<a name="l00330"></a>00330 assert( p ); +<a name="l00331"></a>00331 <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 ) +<a name="l00332"></a>00332 { +<a name="l00333"></a>00333 *length = utf8ByteTable[ *((<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)p) ]; +<a name="l00334"></a>00334 assert( *length >= 0 && *length < 5 ); +<a name="l00335"></a>00335 } +<a name="l00336"></a>00336 <span class="keywordflow">else</span> +<a name="l00337"></a>00337 { +<a name="l00338"></a>00338 *length = 1; +<a name="l00339"></a>00339 } +<a name="l00340"></a>00340 +<a name="l00341"></a>00341 <span class="keywordflow">if</span> ( *length == 1 ) +<a name="l00342"></a>00342 { +<a name="l00343"></a>00343 <span class="keywordflow">if</span> ( *p == <span class="charliteral">'&'</span> ) +<a name="l00344"></a>00344 <span class="keywordflow">return</span> GetEntity( p, _value, length, encoding ); +<a name="l00345"></a>00345 *_value = *p; +<a name="l00346"></a>00346 <span class="keywordflow">return</span> p+1; +<a name="l00347"></a>00347 } +<a name="l00348"></a>00348 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( *length ) +<a name="l00349"></a>00349 { +<a name="l00350"></a>00350 <span class="comment">//strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe),</span> +<a name="l00351"></a>00351 <span class="comment">// and the null terminator isn't needed</span> +<a name="l00352"></a>00352 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; p[i] && i<*length; ++i ) { +<a name="l00353"></a>00353 _value[i] = p[i]; +<a name="l00354"></a>00354 } +<a name="l00355"></a>00355 <span class="keywordflow">return</span> p + (*length); +<a name="l00356"></a>00356 } +<a name="l00357"></a>00357 <span class="keywordflow">else</span> +<a name="l00358"></a>00358 { +<a name="l00359"></a>00359 <span class="comment">// Not valid text.</span> +<a name="l00360"></a>00360 <span class="keywordflow">return</span> 0; +<a name="l00361"></a>00361 } +<a name="l00362"></a>00362 } +<a name="l00363"></a>00363 +<a name="l00364"></a>00364 <span class="comment">// Return true if the next characters in the stream are any of the endTag sequences.</span> +<a name="l00365"></a>00365 <span class="comment">// Ignore case only works for english, and should only be relied on when comparing</span> +<a name="l00366"></a>00366 <span class="comment">// to English words: StringEqual( p, "version", true ) is fine.</span> +<a name="l00367"></a>00367 <span class="keyword">static</span> <span class="keywordtype">bool</span> StringEqual( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, +<a name="l00368"></a>00368 <span class="keyword">const</span> <span class="keywordtype">char</span>* endTag, +<a name="l00369"></a>00369 <span class="keywordtype">bool</span> ignoreCase, +<a name="l00370"></a>00370 TiXmlEncoding encoding ); +<a name="l00371"></a>00371 +<a name="l00372"></a>00372 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* errorString[ TIXML_ERROR_STRING_COUNT ]; +<a name="l00373"></a>00373 +<a name="l00374"></a>00374 TiXmlCursor location; +<a name="l00375"></a>00375 +<a name="l00377"></a><a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">00377</a> <span class="keywordtype">void</span>* <a class="code" href="classTiXmlBase.html#b242c01590191f644569fa89a080d97c">userData</a>; +<a name="l00378"></a>00378 +<a name="l00379"></a>00379 <span class="comment">// None of these methods are reliable for any language except English.</span> +<a name="l00380"></a>00380 <span class="comment">// Good for approximation, not great for accuracy.</span> +<a name="l00381"></a>00381 <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlpha( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding ); +<a name="l00382"></a>00382 <span class="keyword">static</span> <span class="keywordtype">int</span> IsAlphaNum( <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> anyByte, TiXmlEncoding encoding ); +<a name="l00383"></a>00383 <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">int</span> ToLower( <span class="keywordtype">int</span> v, TiXmlEncoding encoding ) +<a name="l00384"></a>00384 { +<a name="l00385"></a>00385 <span class="keywordflow">if</span> ( encoding == TIXML_ENCODING_UTF8 ) +<a name="l00386"></a>00386 { +<a name="l00387"></a>00387 <span class="keywordflow">if</span> ( v < 128 ) <span class="keywordflow">return</span> tolower( v ); +<a name="l00388"></a>00388 <span class="keywordflow">return</span> v; +<a name="l00389"></a>00389 } +<a name="l00390"></a>00390 <span class="keywordflow">else</span> +<a name="l00391"></a>00391 { +<a name="l00392"></a>00392 <span class="keywordflow">return</span> tolower( v ); +<a name="l00393"></a>00393 } +<a name="l00394"></a>00394 } +<a name="l00395"></a>00395 <span class="keyword">static</span> <span class="keywordtype">void</span> ConvertUTF32ToUTF8( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> input, <span class="keywordtype">char</span>* output, <span class="keywordtype">int</span>* length ); +<a name="l00396"></a>00396 +<a name="l00397"></a>00397 <span class="keyword">private</span>: +<a name="l00398"></a>00398 <a class="code" href="classTiXmlBase.html">TiXmlBase</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>& ); <span class="comment">// not implemented.</span> +<a name="l00399"></a>00399 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a>& base ); <span class="comment">// not allowed.</span> +<a name="l00400"></a>00400 +<a name="l00401"></a>00401 <span class="keyword">struct </span>Entity +<a name="l00402"></a>00402 { +<a name="l00403"></a>00403 <span class="keyword">const</span> <span class="keywordtype">char</span>* str; +<a name="l00404"></a>00404 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> strLength; +<a name="l00405"></a>00405 <span class="keywordtype">char</span> chr; +<a name="l00406"></a>00406 }; +<a name="l00407"></a>00407 <span class="keyword">enum</span> +<a name="l00408"></a>00408 { +<a name="l00409"></a>00409 NUM_ENTITY = 5, +<a name="l00410"></a>00410 MAX_ENTITY_LENGTH = 6 +<a name="l00411"></a>00411 +<a name="l00412"></a>00412 }; +<a name="l00413"></a>00413 <span class="keyword">static</span> Entity entity[ NUM_ENTITY ]; +<a name="l00414"></a>00414 <span class="keyword">static</span> <span class="keywordtype">bool</span> condenseWhiteSpace; +<a name="l00415"></a>00415 }; +<a name="l00416"></a>00416 +<a name="l00417"></a>00417 +<a name="l00424"></a><a class="code" href="classTiXmlNode.html">00424</a> <span class="keyword">class </span><a class="code" href="classTiXmlNode.html">TiXmlNode</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a> +<a name="l00425"></a>00425 { +<a name="l00426"></a>00426 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>; +<a name="l00427"></a>00427 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>; +<a name="l00428"></a>00428 +<a name="l00429"></a>00429 <span class="keyword">public</span>: +<a name="l00430"></a>00430 <span class="preprocessor"> #ifdef TIXML_USE_STL </span> +<a name="l00431"></a>00431 <span class="preprocessor"></span> +<a name="l00435"></a>00435 <span class="keyword">friend</span> std::istream& <a class="code" href="classTiXmlNode.html#b57bd426563c926844f65a78412e18b9">operator >> </a>(std::istream& in, <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& base); +<a name="l00436"></a>00436 +<a name="l00453"></a>00453 <span class="keyword">friend</span> std::ostream& <a class="code" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<< </a>(std::ostream& out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& base); +<a name="l00454"></a>00454 +<a name="l00456"></a>00456 <span class="keyword">friend</span> std::string& <a class="code" href="classTiXmlNode.html#86cd49cfb17a844c0010b3136ac966c7">operator<< </a>(std::string& out, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& base ); +<a name="l00457"></a>00457 +<a name="l00458"></a>00458 <span class="preprocessor"> #endif</span> +<a name="l00459"></a>00459 <span class="preprocessor"></span> +<a name="l00463"></a><a class="code" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">00463</a> <span class="keyword">enum</span> <a class="code" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> +<a name="l00464"></a>00464 { +<a name="l00465"></a>00465 DOCUMENT, +<a name="l00466"></a>00466 ELEMENT, +<a name="l00467"></a>00467 COMMENT, +<a name="l00468"></a>00468 UNKNOWN, +<a name="l00469"></a>00469 TEXT, +<a name="l00470"></a>00470 DECLARATION, +<a name="l00471"></a>00471 TYPECOUNT +<a name="l00472"></a>00472 }; +<a name="l00473"></a>00473 +<a name="l00474"></a>00474 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlNode.html">TiXmlNode</a>(); +<a name="l00475"></a>00475 +<a name="l00488"></a><a class="code" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">00488</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlNode.html#77943eb90d12c2892b1337a9f5918b41">Value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value.c_str (); } +<a name="l00489"></a>00489 +<a name="l00490"></a>00490 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00491"></a>00491 <span class="preprocessor"></span> +<a name="l00495"></a><a class="code" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">00495</a> <span class="keyword">const</span> std::string& <a class="code" href="classTiXmlNode.html#6d9e505619d39bf50bfd9609c9169ea5">ValueStr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; } +<a name="l00496"></a>00496 <span class="preprocessor"> #endif</span> +<a name="l00497"></a>00497 <span class="preprocessor"></span> +<a name="l00498"></a>00498 <span class="keyword">const</span> TIXML_STRING& ValueTStr()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; } +<a name="l00499"></a>00499 +<a name="l00509"></a><a class="code" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">00509</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * _value) { value = _value;} +<a name="l00510"></a>00510 +<a name="l00511"></a>00511 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00513"></a><a class="code" href="classTiXmlNode.html#2598d5f448042c1abbeae4503dd45ff2">00513</a> <span class="preprocessor"> void SetValue( const std::string& _value ) { value = _value; }</span> +<a name="l00514"></a>00514 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l00515"></a>00515 <span class="preprocessor"></span> +<a name="l00517"></a>00517 <span class="keywordtype">void</span> <a class="code" href="classTiXmlNode.html#708e7f953df61d4d2d12f73171550a4b">Clear</a>(); +<a name="l00518"></a>00518 +<a name="l00520"></a><a class="code" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">00520</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>() { <span class="keywordflow">return</span> parent; } +<a name="l00521"></a>00521 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#b643043132ffd794f8602685d34a982e">Parent</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> parent; } +<a name="l00522"></a>00522 +<a name="l00523"></a><a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">00523</a> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> firstChild; } +<a name="l00524"></a>00524 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>() { <span class="keywordflow">return</span> firstChild; } +<a name="l00525"></a>00525 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>; +<a name="l00526"></a>00526 +<a name="l00527"></a><a class="code" href="classTiXmlNode.html#bc8bf32be6419ec453a731868de19554">00527</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) { +<a name="l00528"></a>00528 <span class="comment">// Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)</span> +<a name="l00529"></a>00529 <span class="comment">// call the method, cast the return back to non-const.</span> +<a name="l00530"></a>00530 <span class="keywordflow">return</span> const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->FirstChild( _value )); +<a name="l00531"></a>00531 } +<a name="l00532"></a>00532 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lastChild; } +<a name="l00533"></a><a class="code" href="classTiXmlNode.html#6432d2b2495f6caf9cb4278df706a031">00533</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild() { <span class="keywordflow">return</span> lastChild; } +<a name="l00534"></a>00534 +<a name="l00535"></a>00535 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>; +<a name="l00536"></a><a class="code" href="classTiXmlNode.html#bad5bf1059c48127b958711ef89e8e5d">00536</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) { +<a name="l00537"></a>00537 <span class="keywordflow">return</span> const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->LastChild( _value )); +<a name="l00538"></a>00538 } +<a name="l00539"></a>00539 +<a name="l00540"></a>00540 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00541"></a><a class="code" href="classTiXmlNode.html#07f6200a5956c723c5b52d70f29c46f6">00541</a> <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a> (_value.c_str ()); } +<a name="l00542"></a><a class="code" href="classTiXmlNode.html#10d2669ccb5e29e02fcb0e4408685ef6">00542</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a>( <span class="keyword">const</span> std::string& _value ) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#44c8eee26bbe2d1b2762038df9dde2f0">FirstChild</a> (_value.c_str ()); } +<a name="l00543"></a><a class="code" href="classTiXmlNode.html#256d0cdbfcfeccae83f3a1c9747a8b63">00543</a> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> LastChild (_value.c_str ()); } +<a name="l00544"></a><a class="code" href="classTiXmlNode.html#69772c9202f70553f940b15c06b07be3">00544</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* LastChild( <span class="keyword">const</span> std::string& _value ) { <span class="keywordflow">return</span> LastChild (_value.c_str ()); } +<a name="l00545"></a>00545 <span class="preprocessor"> #endif</span> +<a name="l00546"></a>00546 <span class="preprocessor"></span> +<a name="l00563"></a>00563 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) <span class="keyword">const</span>; +<a name="l00564"></a>00564 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) { +<a name="l00565"></a>00565 <span class="keywordflow">return</span> const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->IterateChildren( previous ) ); +<a name="l00566"></a>00566 } +<a name="l00567"></a>00567 +<a name="l00569"></a>00569 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) <span class="keyword">const</span>; +<a name="l00570"></a>00570 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) { +<a name="l00571"></a>00571 <span class="keywordflow">return</span> const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->IterateChildren( _value, previous ) ); +<a name="l00572"></a>00572 } +<a name="l00573"></a>00573 +<a name="l00574"></a>00574 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00575"></a><a class="code" href="classTiXmlNode.html#1cbaaf8e82c09ad763d52616d75724df">00575</a> <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> std::string& _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a> (_value.c_str (), previous); } +<a name="l00576"></a><a class="code" href="classTiXmlNode.html#16e9ad53e2f5445b14bf325c90aa862c">00576</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a>( <span class="keyword">const</span> std::string& _value, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* previous ) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#8621196ba3705fa226bef4a761cc51b6">IterateChildren</a> (_value.c_str (), previous); } +<a name="l00577"></a>00577 <span class="preprocessor"> #endif</span> +<a name="l00578"></a>00578 <span class="preprocessor"></span> +<a name="l00582"></a>00582 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#d7d4630e1a2a916edda16be22448a8ba">InsertEndChild</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& addThis ); +<a name="l00583"></a>00583 +<a name="l00584"></a>00584 +<a name="l00594"></a>00594 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#5d29442ae46de6d0168429156197bfc6">LinkEndChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* addThis ); +<a name="l00595"></a>00595 +<a name="l00599"></a>00599 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#0c146fa2fff0157b681594102f48cbc7">InsertBeforeChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* beforeThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& addThis ); +<a name="l00600"></a>00600 +<a name="l00604"></a>00604 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#d9b75e54ec19301c8b4d5ff583d0b3d5">InsertAfterChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* afterThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& addThis ); +<a name="l00605"></a>00605 +<a name="l00609"></a>00609 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#0c49e739a17b9938050c22cd89617fbd">ReplaceChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* replaceThis, <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& withThis ); +<a name="l00610"></a>00610 +<a name="l00612"></a>00612 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#e19d8510efc90596552f4feeac9a8fbf">RemoveChild</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* removeThis ); +<a name="l00613"></a>00613 +<a name="l00615"></a><a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">00615</a> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> prev; } +<a name="l00616"></a>00616 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>() { <span class="keywordflow">return</span> prev; } +<a name="l00617"></a>00617 +<a name="l00619"></a>00619 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>; +<a name="l00620"></a>00620 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *_prev ) { +<a name="l00621"></a>00621 <span class="keywordflow">return</span> const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->PreviousSibling( _prev ) ); +<a name="l00622"></a>00622 } +<a name="l00623"></a>00623 +<a name="l00624"></a>00624 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00625"></a><a class="code" href="classTiXmlNode.html#658276f57d35d5d4256d1dc1a2c398ab">00625</a> <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a> (_value.c_str ()); } +<a name="l00626"></a><a class="code" href="classTiXmlNode.html#cc8a0434c7f401d4a3b6dee77c1a5912">00626</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a>( <span class="keyword">const</span> std::string& _value ) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#c2cd892768726270e511b2ab32de4d10">PreviousSibling</a> (_value.c_str ()); } +<a name="l00627"></a><a class="code" href="classTiXmlNode.html#1b94d2f7fa7ab25a5a8e8d4340c449c9">00627</a> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>( <span class="keyword">const</span> std::string& _value)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a> (_value.c_str ()); } +<a name="l00628"></a><a class="code" href="classTiXmlNode.html#1757c1f4d01e8c9596ffdbd561c76aea">00628</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>( <span class="keyword">const</span> std::string& _value) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a> (_value.c_str ()); } +<a name="l00629"></a>00629 <span class="preprocessor"> #endif</span> +<a name="l00630"></a>00630 <span class="preprocessor"></span> +<a name="l00632"></a><a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">00632</a> <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> next; } +<a name="l00633"></a>00633 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>() { <span class="keywordflow">return</span> next; } +<a name="l00634"></a>00634 +<a name="l00636"></a>00636 <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>; +<a name="l00637"></a>00637 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#f854baeba384f5fe9859f5aee03b548e">NextSibling</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _next ) { +<a name="l00638"></a>00638 <span class="keywordflow">return</span> const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->NextSibling( _next ) ); +<a name="l00639"></a>00639 } +<a name="l00640"></a>00640 +<a name="l00645"></a>00645 <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() <span class="keyword">const</span>; +<a name="l00646"></a>00646 <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>() { +<a name="l00647"></a>00647 <span class="keywordflow">return</span> const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->NextSiblingElement() ); +<a name="l00648"></a>00648 } +<a name="l00649"></a>00649 +<a name="l00654"></a>00654 <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * ) <span class="keyword">const</span>; +<a name="l00655"></a>00655 <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> *_next ) { +<a name="l00656"></a>00656 <span class="keywordflow">return</span> const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->NextSiblingElement( _next ) ); +<a name="l00657"></a>00657 } +<a name="l00658"></a>00658 +<a name="l00659"></a>00659 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00660"></a><a class="code" href="classTiXmlNode.html#7572d0af9d1e696ee3f05d8bb5ebb463">00660</a> <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>( <span class="keyword">const</span> std::string& _value)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a> (_value.c_str ()); } +<a name="l00661"></a><a class="code" href="classTiXmlNode.html#506958e34406729a4e4c5326ea39d081">00661</a> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a>( <span class="keyword">const</span> std::string& _value) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#73acf929d49d10bd0e5fb3d31b0372d1">NextSiblingElement</a> (_value.c_str ()); } +<a name="l00662"></a>00662 <span class="preprocessor"> #endif</span> +<a name="l00663"></a>00663 <span class="preprocessor"></span> +<a name="l00665"></a>00665 <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() <span class="keyword">const</span>; +<a name="l00666"></a>00666 <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>() { +<a name="l00667"></a>00667 <span class="keywordflow">return</span> const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->FirstChildElement() ); +<a name="l00668"></a>00668 } +<a name="l00669"></a>00669 +<a name="l00671"></a>00671 <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) <span class="keyword">const</span>; +<a name="l00672"></a>00672 <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) { +<a name="l00673"></a>00673 <span class="keywordflow">return</span> const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->FirstChildElement( _value ) ); +<a name="l00674"></a>00674 } +<a name="l00675"></a>00675 +<a name="l00676"></a>00676 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00677"></a><a class="code" href="classTiXmlNode.html#327ad4bbd90073c5dfc931b07314f5f7">00677</a> <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a> (_value.c_str ()); } +<a name="l00678"></a><a class="code" href="classTiXmlNode.html#7f1d7291880534c1e5cdeb392d8c1f45">00678</a> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value ) { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a> (_value.c_str ()); } +<a name="l00679"></a>00679 <span class="preprocessor"> #endif</span> +<a name="l00680"></a>00680 <span class="preprocessor"></span> +<a name="l00685"></a><a class="code" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">00685</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlNode.html#57b99d5c97d67a42b9752f5210a1ba5e">Type</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> type; } +<a name="l00686"></a>00686 +<a name="l00690"></a>00690 <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() <span class="keyword">const</span>; +<a name="l00691"></a>00691 <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#80e397fa973cf5323e33b07154b024f3">GetDocument</a>() { +<a name="l00692"></a>00692 <span class="keywordflow">return</span> const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(<span class="keyword">this</span>))->GetDocument() ); +<a name="l00693"></a>00693 } +<a name="l00694"></a>00694 +<a name="l00696"></a><a class="code" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">00696</a> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#eed21ad30630ef6e7faf096127edc9f3">NoChildren</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !firstChild; } +<a name="l00697"></a>00697 +<a name="l00698"></a><a class="code" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">00698</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00699"></a><a class="code" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">00699</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00700"></a><a class="code" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">00700</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* <a class="code" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00701"></a><a class="code" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">00701</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00702"></a><a class="code" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">00702</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00703"></a><a class="code" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">00703</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } +<a name="l00704"></a>00704 +<a name="l00705"></a><a class="code" href="classTiXmlNode.html#6a4c8ac28ee7a745d059db6691e03bae">00705</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlNode.html#8a4cda4b15c29f64cff419309aebed08">ToDocument</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00706"></a><a class="code" href="classTiXmlNode.html#a65d000223187d22a4dcebd7479e9ebc">00706</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00707"></a><a class="code" href="classTiXmlNode.html#383e06a0787f7063953934867990f849">00707</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* <a class="code" href="classTiXmlNode.html#a0a5086f9eaee910bbfdc7f975e26574">ToComment</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00708"></a><a class="code" href="classTiXmlNode.html#06de5af852668c7e4af0d09c205f0b0d">00708</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00709"></a><a class="code" href="classTiXmlNode.html#3ddfbcac78fbea041fad57e5c6d60a03">00709</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00710"></a><a class="code" href="classTiXmlNode.html#4027136ca820ff4a636b607231b6a6df">00710</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlNode.html#9f43e6984fc7d4afd6eb32714c6b7b72">ToDeclaration</a>() { <span class="keywordflow">return</span> 0; } +<a name="l00711"></a>00711 +<a name="l00715"></a>00715 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlNode.html#4508cc3a2d7a98e96a54cc09c37a78a4">Clone</a>() <span class="keyword">const </span>= 0; +<a name="l00716"></a>00716 +<a name="l00739"></a>00739 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlNode.html#cc0f88b7462c6cb73809d410a4f5bb86">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* visitor ) <span class="keyword">const </span>= 0; +<a name="l00740"></a>00740 +<a name="l00741"></a>00741 <span class="keyword">protected</span>: +<a name="l00742"></a>00742 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> _type ); +<a name="l00743"></a>00743 +<a name="l00744"></a>00744 <span class="comment">// Copy to the allocated object. Shared functionality between Clone, Copy constructor,</span> +<a name="l00745"></a>00745 <span class="comment">// and the assignment operator.</span> +<a name="l00746"></a>00746 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* target ) <span class="keyword">const</span>; +<a name="l00747"></a>00747 +<a name="l00748"></a>00748 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00749"></a>00749 <span class="preprocessor"></span> <span class="comment">// The real work of the input operator.</span> +<a name="l00750"></a>00750 <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; +<a name="l00751"></a>00751 <span class="preprocessor"> #endif</span> +<a name="l00752"></a>00752 <span class="preprocessor"></span> +<a name="l00753"></a>00753 <span class="comment">// Figure out what is at *p, and parse it. Returns null if it is not an xml node.</span> +<a name="l00754"></a>00754 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* Identify( <span class="keyword">const</span> <span class="keywordtype">char</span>* start, TiXmlEncoding encoding ); +<a name="l00755"></a>00755 +<a name="l00756"></a>00756 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* parent; +<a name="l00757"></a>00757 <a class="code" href="classTiXmlNode.html#836eded4920ab9e9ef28496f48cd95a2">NodeType</a> type; +<a name="l00758"></a>00758 +<a name="l00759"></a>00759 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* firstChild; +<a name="l00760"></a>00760 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* lastChild; +<a name="l00761"></a>00761 +<a name="l00762"></a>00762 TIXML_STRING value; +<a name="l00763"></a>00763 +<a name="l00764"></a>00764 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* prev; +<a name="l00765"></a>00765 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* next; +<a name="l00766"></a>00766 +<a name="l00767"></a>00767 <span class="keyword">private</span>: +<a name="l00768"></a>00768 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& ); <span class="comment">// not implemented.</span> +<a name="l00769"></a>00769 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>& base ); <span class="comment">// not allowed.</span> +<a name="l00770"></a>00770 }; +<a name="l00771"></a>00771 +<a name="l00772"></a>00772 +<a name="l00780"></a><a class="code" href="classTiXmlAttribute.html">00780</a> <span class="keyword">class </span><a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlBase.html">TiXmlBase</a> +<a name="l00781"></a>00781 { +<a name="l00782"></a>00782 <span class="keyword">friend</span> <span class="keyword">class </span>TiXmlAttributeSet; +<a name="l00783"></a>00783 +<a name="l00784"></a>00784 <span class="keyword">public</span>: +<a name="l00786"></a><a class="code" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">00786</a> <a class="code" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>() : <a class="code" href="classTiXmlBase.html">TiXmlBase</a>() +<a name="l00787"></a>00787 { +<a name="l00788"></a>00788 document = 0; +<a name="l00789"></a>00789 prev = next = 0; +<a name="l00790"></a>00790 } +<a name="l00791"></a>00791 +<a name="l00792"></a>00792 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00794"></a><a class="code" href="classTiXmlAttribute.html#052213522caac3979960e0714063861d">00794</a> <span class="preprocessor"> TiXmlAttribute( const std::string& _name, const std::string& _value )</span> +<a name="l00795"></a>00795 <span class="preprocessor"></span> { +<a name="l00796"></a>00796 name = _name; +<a name="l00797"></a>00797 value = _value; +<a name="l00798"></a>00798 document = 0; +<a name="l00799"></a>00799 prev = next = 0; +<a name="l00800"></a>00800 } +<a name="l00801"></a>00801 <span class="preprocessor"> #endif</span> +<a name="l00802"></a>00802 <span class="preprocessor"></span> +<a name="l00804"></a><a class="code" href="classTiXmlAttribute.html#759d0b76fb8fcf765ecab243bc14f05e">00804</a> <a class="code" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * _name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ) +<a name="l00805"></a>00805 { +<a name="l00806"></a>00806 name = _name; +<a name="l00807"></a>00807 value = _value; +<a name="l00808"></a>00808 document = 0; +<a name="l00809"></a>00809 prev = next = 0; +<a name="l00810"></a>00810 } +<a name="l00811"></a>00811 +<a name="l00812"></a><a class="code" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">00812</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlAttribute.html#298a57287d305904ba6bd96ae6f78d3d">Name</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name.c_str(); } +<a name="l00813"></a><a class="code" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">00813</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlAttribute.html#0f874490eac8ca00ee0070765d0e97e3">Value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value.c_str(); } +<a name="l00814"></a>00814 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00815"></a><a class="code" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">00815</a> <span class="preprocessor"></span> <span class="keyword">const</span> std::string& <a class="code" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> value; } +<a name="l00816"></a>00816 <span class="preprocessor"> #endif</span> +<a name="l00817"></a>00817 <span class="preprocessor"></span> <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#a1a20ad59dc7e89a0ab265396360d50f">IntValue</a>() <span class="keyword">const</span>; +<a name="l00818"></a>00818 <span class="keywordtype">double</span> <a class="code" href="classTiXmlAttribute.html#2880ddef53fc7522c99535273954d230">DoubleValue</a>() <span class="keyword">const</span>; +<a name="l00819"></a>00819 +<a name="l00820"></a>00820 <span class="comment">// Get the tinyxml string representation</span> +<a name="l00821"></a>00821 <span class="keyword">const</span> TIXML_STRING& NameTStr()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name; } +<a name="l00822"></a>00822 +<a name="l00832"></a>00832 <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#d6c93088ee21af41a107931223339344">QueryIntValue</a>( <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>; +<a name="l00834"></a>00834 <span class="keywordtype">int</span> <a class="code" href="classTiXmlAttribute.html#c87b2a8489906a5d7aa2875f20be3513">QueryDoubleValue</a>( <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>; +<a name="l00835"></a>00835 +<a name="l00836"></a><a class="code" href="classTiXmlAttribute.html#b7fa3d21ff8d7c5764cf9af15b667a99">00836</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#b7fa3d21ff8d7c5764cf9af15b667a99">SetName</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name ) { name = _name; } +<a name="l00837"></a><a class="code" href="classTiXmlAttribute.html#2dae44178f668b3cb48101be4f2236a0">00837</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#2dae44178f668b3cb48101be4f2236a0">SetValue</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _value ) { value = _value; } +<a name="l00838"></a>00838 +<a name="l00839"></a>00839 <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#7e065df640116a62ea4f4b7da5449cc8">SetIntValue</a>( <span class="keywordtype">int</span> _value ); +<a name="l00840"></a>00840 <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#0316da31373496c4368ad549bf711394">SetDoubleValue</a>( <span class="keywordtype">double</span> _value ); +<a name="l00841"></a>00841 +<a name="l00842"></a>00842 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00844"></a><a class="code" href="classTiXmlAttribute.html#b296ff0c9a8c701055cd257a8a976e57">00844</a> <span class="preprocessor"> void SetName( const std::string& _name ) { name = _name; } </span> +<a name="l00846"></a><a class="code" href="classTiXmlAttribute.html#b43f67a0cc3ec1d80e62606500f0925f">00846</a> <span class="preprocessor"> void SetValue( const std::string& _value ) { value = _value; }</span> +<a name="l00847"></a>00847 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l00848"></a>00848 <span class="preprocessor"></span> +<a name="l00850"></a>00850 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">Next</a>() <span class="keyword">const</span>; +<a name="l00851"></a>00851 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#1c78e92e223a40843f644ba48ef69f67">Next</a>() { +<a name="l00852"></a>00852 <span class="keywordflow">return</span> const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(<span class="keyword">this</span>))->Next() ); +<a name="l00853"></a>00853 } +<a name="l00854"></a>00854 +<a name="l00856"></a>00856 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a>() <span class="keyword">const</span>; +<a name="l00857"></a>00857 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlAttribute.html#6ebbfe333fe76cd834bd6cbcca3130cf">Previous</a>() { +<a name="l00858"></a>00858 <span class="keywordflow">return</span> const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(<span class="keyword">this</span>))->Previous() ); +<a name="l00859"></a>00859 } +<a name="l00860"></a>00860 +<a name="l00861"></a>00861 <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>& rhs )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs.<a class="code" href="classTiXmlAttribute.html#fcbe165f33f08cf9b24daa33f0ee951a">name</a> == name; } +<a name="l00862"></a>00862 <span class="keywordtype">bool</span> operator<( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>& rhs )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name < rhs.<a class="code" href="classTiXmlAttribute.html#fcbe165f33f08cf9b24daa33f0ee951a">name</a>; } +<a name="l00863"></a>00863 <span class="keywordtype">bool</span> operator>( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>& rhs )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name > rhs.<a class="code" href="classTiXmlAttribute.html#fcbe165f33f08cf9b24daa33f0ee951a">name</a>; } +<a name="l00864"></a>00864 +<a name="l00865"></a>00865 <span class="comment">/* Attribute parsing starts: first letter of the name</span> +<a name="l00866"></a>00866 <span class="comment"> returns: the next char after the value end quote</span> +<a name="l00867"></a>00867 <span class="comment"> */</span> +<a name="l00868"></a>00868 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l00869"></a>00869 +<a name="l00870"></a>00870 <span class="comment">// Prints this Attribute to a FILE stream.</span> +<a name="l00871"></a><a class="code" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">00871</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth )<span class="keyword"> const </span>{ +<a name="l00872"></a>00872 <a class="code" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">Print</a>( cfile, depth, 0 ); +<a name="l00873"></a>00873 } +<a name="l00874"></a>00874 <span class="keywordtype">void</span> <a class="code" href="classTiXmlAttribute.html#cc04956c1d5c4c31fe74f7a7528d109a">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth, TIXML_STRING* str ) <span class="keyword">const</span>; +<a name="l00875"></a>00875 +<a name="l00876"></a>00876 <span class="comment">// [internal use]</span> +<a name="l00877"></a>00877 <span class="comment">// Set the document pointer so the attribute can report errors.</span> +<a name="l00878"></a>00878 <span class="keywordtype">void</span> SetDocument( <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* doc ) { document = doc; } +<a name="l00879"></a>00879 +<a name="l00880"></a>00880 <span class="keyword">private</span>: +<a name="l00881"></a>00881 <a class="code" href="classTiXmlAttribute.html#9cfa3c8179873fd485d83003b114f8e1">TiXmlAttribute</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>& ); <span class="comment">// not implemented.</span> +<a name="l00882"></a>00882 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>& base ); <span class="comment">// not allowed.</span> +<a name="l00883"></a>00883 +<a name="l00884"></a>00884 <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* document; <span class="comment">// A pointer back to a document, for error reporting.</span> +<a name="l00885"></a>00885 TIXML_STRING name; +<a name="l00886"></a>00886 TIXML_STRING value; +<a name="l00887"></a>00887 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* prev; +<a name="l00888"></a>00888 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* next; +<a name="l00889"></a>00889 }; +<a name="l00890"></a>00890 +<a name="l00891"></a>00891 +<a name="l00892"></a>00892 <span class="comment">/* A class used to manage a group of attributes.</span> +<a name="l00893"></a>00893 <span class="comment"> It is only used internally, both by the ELEMENT and the DECLARATION.</span> +<a name="l00894"></a>00894 <span class="comment"> </span> +<a name="l00895"></a>00895 <span class="comment"> The set can be changed transparent to the Element and Declaration</span> +<a name="l00896"></a>00896 <span class="comment"> classes that use it, but NOT transparent to the Attribute</span> +<a name="l00897"></a>00897 <span class="comment"> which has to implement a next() and previous() method. Which makes</span> +<a name="l00898"></a>00898 <span class="comment"> it a bit problematic and prevents the use of STL.</span> +<a name="l00899"></a>00899 <span class="comment"></span> +<a name="l00900"></a>00900 <span class="comment"> This version is implemented with circular lists because:</span> +<a name="l00901"></a>00901 <span class="comment"> - I like circular lists</span> +<a name="l00902"></a>00902 <span class="comment"> - it demonstrates some independence from the (typical) doubly linked list.</span> +<a name="l00903"></a>00903 <span class="comment">*/</span> +<a name="l00904"></a>00904 <span class="keyword">class </span>TiXmlAttributeSet +<a name="l00905"></a>00905 { +<a name="l00906"></a>00906 <span class="keyword">public</span>: +<a name="l00907"></a>00907 TiXmlAttributeSet(); +<a name="l00908"></a>00908 ~TiXmlAttributeSet(); +<a name="l00909"></a>00909 +<a name="l00910"></a>00910 <span class="keywordtype">void</span> Add( <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* attribute ); +<a name="l00911"></a>00911 <span class="keywordtype">void</span> Remove( <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* attribute ); +<a name="l00912"></a>00912 +<a name="l00913"></a>00913 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* First()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } +<a name="l00914"></a>00914 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* First() { <span class="keywordflow">return</span> ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } +<a name="l00915"></a>00915 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Last()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } +<a name="l00916"></a>00916 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Last() { <span class="keywordflow">return</span> ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } +<a name="l00917"></a>00917 +<a name="l00918"></a>00918 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name ) <span class="keyword">const</span>; +<a name="l00919"></a>00919 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Find( <span class="keyword">const</span> <span class="keywordtype">char</span>* _name ) { +<a name="l00920"></a>00920 <span class="keywordflow">return</span> const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(<span class="keyword">this</span>))->Find( _name ) ); +<a name="l00921"></a>00921 } +<a name="l00922"></a>00922 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00923"></a>00923 <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Find( <span class="keyword">const</span> std::string& _name ) <span class="keyword">const</span>; +<a name="l00924"></a>00924 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* Find( <span class="keyword">const</span> std::string& _name ) { +<a name="l00925"></a>00925 <span class="keywordflow">return</span> const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(<span class="keyword">this</span>))->Find( _name ) ); +<a name="l00926"></a>00926 } +<a name="l00927"></a>00927 +<a name="l00928"></a>00928 <span class="preprocessor"> #endif</span> +<a name="l00929"></a>00929 <span class="preprocessor"></span> +<a name="l00930"></a>00930 <span class="keyword">private</span>: +<a name="l00931"></a>00931 <span class="comment">//*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),</span> +<a name="l00932"></a>00932 <span class="comment">//*ME: this class must be also use a hidden/disabled copy-constructor !!!</span> +<a name="l00933"></a>00933 TiXmlAttributeSet( <span class="keyword">const</span> TiXmlAttributeSet& ); <span class="comment">// not allowed</span> +<a name="l00934"></a>00934 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> TiXmlAttributeSet& ); <span class="comment">// not allowed (as TiXmlAttribute)</span> +<a name="l00935"></a>00935 +<a name="l00936"></a>00936 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a> sentinel; +<a name="l00937"></a>00937 }; +<a name="l00938"></a>00938 +<a name="l00939"></a>00939 +<a name="l00944"></a><a class="code" href="classTiXmlElement.html">00944</a> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l00945"></a>00945 { +<a name="l00946"></a>00946 <span class="keyword">public</span>: +<a name="l00948"></a>00948 <a class="code" href="classTiXmlElement.html#01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * in_value); +<a name="l00949"></a>00949 +<a name="l00950"></a>00950 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l00952"></a>00952 <span class="preprocessor"> TiXmlElement( const std::string& _value );</span> +<a name="l00953"></a>00953 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l00954"></a>00954 <span class="preprocessor"></span> +<a name="l00955"></a>00955 <a class="code" href="classTiXmlElement.html#01bc3ab372d35da08efcbbe65ad90c60">TiXmlElement</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& ); +<a name="l00956"></a>00956 +<a name="l00957"></a>00957 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& base ); +<a name="l00958"></a>00958 +<a name="l00959"></a>00959 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlElement.html">TiXmlElement</a>(); +<a name="l00960"></a>00960 +<a name="l00964"></a>00964 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name ) <span class="keyword">const</span>; +<a name="l00965"></a>00965 +<a name="l00972"></a>00972 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* i ) <span class="keyword">const</span>; +<a name="l00973"></a>00973 +<a name="l00980"></a>00980 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* d ) <span class="keyword">const</span>; +<a name="l00981"></a>00981 +<a name="l00989"></a>00989 <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>; +<a name="l00991"></a>00991 <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>; +<a name="l00993"></a><a class="code" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">00993</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#a04d3af11601ef5a5f88295203a843be">QueryFloatAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keywordtype">float</span>* _value )<span class="keyword"> const </span>{ +<a name="l00994"></a>00994 <span class="keywordtype">double</span> d; +<a name="l00995"></a>00995 <span class="keywordtype">int</span> result = <a class="code" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a>( name, &d ); +<a name="l00996"></a>00996 <span class="keywordflow">if</span> ( result == TIXML_SUCCESS ) { +<a name="l00997"></a>00997 *_value = (float)d; +<a name="l00998"></a>00998 } +<a name="l00999"></a>00999 <span class="keywordflow">return</span> result; +<a name="l01000"></a>01000 } +<a name="l01001"></a>01001 +<a name="l01002"></a>01002 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01003"></a>01003 <span class="preprocessor"></span> +<a name="l01011"></a><a class="code" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">01011</a> <span class="keyword">template</span>< <span class="keyword">typename</span> T > <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#e3b9a03b0a56663a40801c7256683576">QueryValueAttribute</a>( <span class="keyword">const</span> std::string& name, T* outValue )<span class="keyword"> const</span> +<a name="l01012"></a>01012 <span class="keyword"> </span>{ +<a name="l01013"></a>01013 <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* node = attributeSet.Find( name ); +<a name="l01014"></a>01014 <span class="keywordflow">if</span> ( !node ) +<a name="l01015"></a>01015 <span class="keywordflow">return</span> TIXML_NO_ATTRIBUTE; +<a name="l01016"></a>01016 +<a name="l01017"></a>01017 std::stringstream sstream( node-><a class="code" href="classTiXmlAttribute.html#87705c3ccf9ee9417beb4f7cbacd4d33">ValueStr</a>() ); +<a name="l01018"></a>01018 sstream >> *outValue; +<a name="l01019"></a>01019 <span class="keywordflow">if</span> ( !sstream.fail() ) +<a name="l01020"></a>01020 <span class="keywordflow">return</span> TIXML_SUCCESS; +<a name="l01021"></a>01021 <span class="keywordflow">return</span> TIXML_WRONG_TYPE; +<a name="l01022"></a>01022 } +<a name="l01023"></a>01023 <span class="comment">/*</span> +<a name="l01024"></a>01024 <span class="comment"> This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string"</span> +<a name="l01025"></a>01025 <span class="comment"> but template specialization is hard to get working cross-compiler. Leaving the bug for now.</span> +<a name="l01026"></a>01026 <span class="comment"> </span> +<a name="l01027"></a>01027 <span class="comment"> // The above will fail for std::string because the space character is used as a seperator.</span> +<a name="l01028"></a>01028 <span class="comment"> // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string</span> +<a name="l01029"></a>01029 <span class="comment"> template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const</span> +<a name="l01030"></a>01030 <span class="comment"> {</span> +<a name="l01031"></a>01031 <span class="comment"> const TiXmlAttribute* node = attributeSet.Find( name );</span> +<a name="l01032"></a>01032 <span class="comment"> if ( !node )</span> +<a name="l01033"></a>01033 <span class="comment"> return TIXML_NO_ATTRIBUTE;</span> +<a name="l01034"></a>01034 <span class="comment"> *outValue = node->ValueStr();</span> +<a name="l01035"></a>01035 <span class="comment"> return TIXML_SUCCESS;</span> +<a name="l01036"></a>01036 <span class="comment"> }</span> +<a name="l01037"></a>01037 <span class="comment"> */</span> +<a name="l01038"></a>01038 <span class="preprocessor"> #endif</span> +<a name="l01039"></a>01039 <span class="preprocessor"></span> +<a name="l01043"></a>01043 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* name, <span class="keyword">const</span> <span class="keywordtype">char</span> * _value ); +<a name="l01044"></a>01044 +<a name="l01045"></a>01045 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01046"></a>01046 <span class="preprocessor"></span> <span class="keyword">const</span> std::string* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> std::string& name ) <span class="keyword">const</span>; +<a name="l01047"></a>01047 <span class="keyword">const</span> std::string* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span>* i ) <span class="keyword">const</span>; +<a name="l01048"></a>01048 <span class="keyword">const</span> std::string* <a class="code" href="classTiXmlElement.html#e419a442a9701a62b0c3d8fd1cbdd12d">Attribute</a>( <span class="keyword">const</span> std::string& name, <span class="keywordtype">double</span>* d ) <span class="keyword">const</span>; +<a name="l01049"></a>01049 <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#ea0bfe471380f281c5945770ddbf52b9">QueryIntAttribute</a>( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span>* _value ) <span class="keyword">const</span>; +<a name="l01050"></a>01050 <span class="keywordtype">int</span> <a class="code" href="classTiXmlElement.html#898d7730ecc341f0bffc7a9dadbf1ce7">QueryDoubleAttribute</a>( <span class="keyword">const</span> std::string& name, <span class="keywordtype">double</span>* _value ) <span class="keyword">const</span>; +<a name="l01051"></a>01051 +<a name="l01053"></a>01053 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>( <span class="keyword">const</span> std::string& name, <span class="keyword">const</span> std::string& _value ); +<a name="l01055"></a>01055 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>( <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span> _value ); +<a name="l01056"></a>01056 <span class="preprocessor"> #endif</span> +<a name="l01057"></a>01057 <span class="preprocessor"></span> +<a name="l01061"></a>01061 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#bf0b3bd7f0e4c746a89ec6e7f101fc32">SetAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">int</span> value ); +<a name="l01062"></a>01062 +<a name="l01066"></a>01066 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#0d1dd975d75496778177e35abfe0ec0b">SetDoubleAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name, <span class="keywordtype">double</span> value ); +<a name="l01067"></a>01067 +<a name="l01070"></a>01070 <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#56979767deca794376b1dfa69a525b2a">RemoveAttribute</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * name ); +<a name="l01071"></a>01071 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01072"></a><a class="code" href="classTiXmlElement.html#1afa6aea716511326a608e4c05df4f3a">01072</a> <span class="preprocessor"></span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#56979767deca794376b1dfa69a525b2a">RemoveAttribute</a>( <span class="keyword">const</span> std::string& name ) { <a class="code" href="classTiXmlElement.html#56979767deca794376b1dfa69a525b2a">RemoveAttribute</a> (name.c_str ()); } +<a name="l01073"></a>01073 <span class="preprocessor"> #endif</span> +<a name="l01074"></a>01074 <span class="preprocessor"></span> +<a name="l01075"></a><a class="code" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">01075</a> <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> attributeSet.First(); } +<a name="l01076"></a>01076 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#516054c9073647d6cb29b6abe9fa0592">FirstAttribute</a>() { <span class="keywordflow">return</span> attributeSet.First(); } +<a name="l01077"></a><a class="code" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">01077</a> <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">LastAttribute</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> attributeSet.Last(); } +<a name="l01078"></a>01078 <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* <a class="code" href="classTiXmlElement.html#86191b49f9177be132b85b14655f1381">LastAttribute</a>() { <span class="keywordflow">return</span> attributeSet.Last(); } +<a name="l01079"></a>01079 +<a name="l01112"></a>01112 <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlElement.html#f3282294986cdb216646ea1f67af2c87">GetText</a>() <span class="keyword">const</span>; +<a name="l01113"></a>01113 +<a name="l01115"></a>01115 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlElement.html#a464535ea1994db337cb6a8ce4b588b5">Clone</a>() <span class="keyword">const</span>; +<a name="l01116"></a>01116 <span class="comment">// Print the Element to a FILE stream.</span> +<a name="l01117"></a>01117 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlElement.html#fbf52736e70fc91ec9d760721d6f4fd2">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>; +<a name="l01118"></a>01118 +<a name="l01119"></a>01119 <span class="comment">/* Attribtue parsing starts: next char past '<'</span> +<a name="l01120"></a>01120 <span class="comment"> returns: next char past '>'</span> +<a name="l01121"></a>01121 <span class="comment"> */</span> +<a name="l01122"></a>01122 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l01123"></a>01123 +<a name="l01124"></a><a class="code" href="classTiXmlElement.html#c5b8d0e25fa23fd9acbb6d146082901c">01124</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlElement.html#c5b8d0e25fa23fd9acbb6d146082901c">ToElement</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01125"></a><a class="code" href="classTiXmlElement.html#9def86337ea7a755eb41cac980f60c7a">01125</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlElement.html#c5b8d0e25fa23fd9acbb6d146082901c">ToElement</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01126"></a>01126 +<a name="l01129"></a>01129 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlElement.html#71a81b2afb0d42be1543d1c404dee6f5">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>; +<a name="l01130"></a>01130 +<a name="l01131"></a>01131 <span class="keyword">protected</span>: +<a name="l01132"></a>01132 +<a name="l01133"></a>01133 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* target ) <span class="keyword">const</span>; +<a name="l01134"></a>01134 <span class="keywordtype">void</span> ClearThis(); <span class="comment">// like clear, but initializes 'this' object as well</span> +<a name="l01135"></a>01135 +<a name="l01136"></a>01136 <span class="comment">// Used to be public [internal use]</span> +<a name="l01137"></a>01137 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01138"></a>01138 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01139"></a>01139 <span class="preprocessor"> #endif</span> +<a name="l01140"></a>01140 <span class="preprocessor"></span> <span class="comment">/* [internal use]</span> +<a name="l01141"></a>01141 <span class="comment"> Reads the "value" of the element -- another element, or text.</span> +<a name="l01142"></a>01142 <span class="comment"> This should terminate with the current end tag.</span> +<a name="l01143"></a>01143 <span class="comment"> */</span> +<a name="l01144"></a>01144 <span class="keyword">const</span> <span class="keywordtype">char</span>* ReadValue( <span class="keyword">const</span> <span class="keywordtype">char</span>* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); +<a name="l01145"></a>01145 +<a name="l01146"></a>01146 <span class="keyword">private</span>: +<a name="l01147"></a>01147 +<a name="l01148"></a>01148 TiXmlAttributeSet attributeSet; +<a name="l01149"></a>01149 }; +<a name="l01150"></a>01150 +<a name="l01151"></a>01151 +<a name="l01154"></a><a class="code" href="classTiXmlComment.html">01154</a> <span class="keyword">class </span><a class="code" href="classTiXmlComment.html">TiXmlComment</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l01155"></a>01155 { +<a name="l01156"></a>01156 <span class="keyword">public</span>: +<a name="l01158"></a><a class="code" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">01158</a> <a class="code" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>() : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::COMMENT ) {} +<a name="l01160"></a><a class="code" href="classTiXmlComment.html#37e7802ef17bc03ebe5ae79bf0713d47">01160</a> <a class="code" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _value ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::COMMENT ) { +<a name="l01161"></a>01161 <a class="code" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>( _value ); +<a name="l01162"></a>01162 } +<a name="l01163"></a>01163 <a class="code" href="classTiXmlComment.html#aa3252031d3e8bd3a2bf51a1c61201b7">TiXmlComment</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>& ); +<a name="l01164"></a>01164 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>& base ); +<a name="l01165"></a>01165 +<a name="l01166"></a>01166 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlComment.html">TiXmlComment</a>() {} +<a name="l01167"></a>01167 +<a name="l01169"></a>01169 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlComment.html#0d6662bdc52488b9e12b3c7a0453d028">Clone</a>() <span class="keyword">const</span>; +<a name="l01170"></a>01170 <span class="comment">// Write this Comment to a FILE stream.</span> +<a name="l01171"></a>01171 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlComment.html#6b316527aaa8da0370cd68c22a5a0f5f">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>; +<a name="l01172"></a>01172 +<a name="l01173"></a>01173 <span class="comment">/* Attribtue parsing starts: at the ! of the !--</span> +<a name="l01174"></a>01174 <span class="comment"> returns: next char past '>'</span> +<a name="l01175"></a>01175 <span class="comment"> */</span> +<a name="l01176"></a>01176 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l01177"></a>01177 +<a name="l01178"></a><a class="code" href="classTiXmlComment.html#00fb4215c20a2399ea05ac9b9e7e68a0">01178</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* <a class="code" href="classTiXmlComment.html#00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01179"></a><a class="code" href="classTiXmlComment.html#cc7c7e07e13c23f17797d642981511df">01179</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* <a class="code" href="classTiXmlComment.html#00fb4215c20a2399ea05ac9b9e7e68a0">ToComment</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01180"></a>01180 +<a name="l01183"></a>01183 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlComment.html#f3ac1b99fbbe9ea4fb6e14146156e43e">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>; +<a name="l01184"></a>01184 +<a name="l01185"></a>01185 <span class="keyword">protected</span>: +<a name="l01186"></a>01186 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlComment.html">TiXmlComment</a>* target ) <span class="keyword">const</span>; +<a name="l01187"></a>01187 +<a name="l01188"></a>01188 <span class="comment">// used to be public</span> +<a name="l01189"></a>01189 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01190"></a>01190 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01191"></a>01191 <span class="preprocessor"> #endif</span> +<a name="l01192"></a>01192 <span class="preprocessor"></span><span class="comment">// virtual void StreamOut( TIXML_OSTREAM * out ) const;</span> +<a name="l01193"></a>01193 +<a name="l01194"></a>01194 <span class="keyword">private</span>: +<a name="l01195"></a>01195 +<a name="l01196"></a>01196 }; +<a name="l01197"></a>01197 +<a name="l01198"></a>01198 +<a name="l01204"></a><a class="code" href="classTiXmlText.html">01204</a> <span class="keyword">class </span><a class="code" href="classTiXmlText.html">TiXmlText</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l01205"></a>01205 { +<a name="l01206"></a>01206 <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTiXmlElement.html">TiXmlElement</a>; +<a name="l01207"></a>01207 <span class="keyword">public</span>: +<a name="l01212"></a><a class="code" href="classTiXmlText.html#f659e77c6b87d684827f35a8f4895960">01212</a> <a class="code" href="classTiXmlText.html#f659e77c6b87d684827f35a8f4895960">TiXmlText</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> * initValue ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a> (<a class="code" href="classTiXmlNode.html">TiXmlNode</a>::TEXT) +<a name="l01213"></a>01213 { +<a name="l01214"></a>01214 <a class="code" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>( initValue ); +<a name="l01215"></a>01215 cdata = <span class="keyword">false</span>; +<a name="l01216"></a>01216 } +<a name="l01217"></a>01217 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlText.html">TiXmlText</a>() {} +<a name="l01218"></a>01218 +<a name="l01219"></a>01219 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01221"></a><a class="code" href="classTiXmlText.html#439792f6183a3d3fb6f2bc2b16fa5691">01221</a> <span class="preprocessor"> TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)</span> +<a name="l01222"></a>01222 <span class="preprocessor"></span> { +<a name="l01223"></a>01223 <a class="code" href="classTiXmlNode.html#2a38329ca5d3f28f98ce932b8299ae90">SetValue</a>( initValue ); +<a name="l01224"></a>01224 cdata = <span class="keyword">false</span>; +<a name="l01225"></a>01225 } +<a name="l01226"></a>01226 <span class="preprocessor"> #endif</span> +<a name="l01227"></a>01227 <span class="preprocessor"></span> +<a name="l01228"></a>01228 <a class="code" href="classTiXmlText.html#f659e77c6b87d684827f35a8f4895960">TiXmlText</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>& copy ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::TEXT ) { copy.<a class="code" href="classTiXmlText.html#dcec7d9b6fccfc5777452bb97e6031c1">CopyTo</a>( <span class="keyword">this</span> ); } +<a name="l01229"></a>01229 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>& base ) { base.<a class="code" href="classTiXmlText.html#dcec7d9b6fccfc5777452bb97e6031c1">CopyTo</a>( <span class="keyword">this</span> ); } +<a name="l01230"></a>01230 +<a name="l01231"></a>01231 <span class="comment">// Write this text object to a FILE stream.</span> +<a name="l01232"></a>01232 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#0cafbf6f236c7f02d12b2bffc2b7976b">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>; +<a name="l01233"></a>01233 +<a name="l01235"></a><a class="code" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">01235</a> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlText.html#d1a6a6b83fa2271022dd97c072a2b586">CDATA</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> cdata; } +<a name="l01237"></a><a class="code" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">01237</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlText.html#cb17ff7c5d09b2c839393445a3de5ea9">SetCDATA</a>( <span class="keywordtype">bool</span> _cdata ) { cdata = _cdata; } +<a name="l01238"></a>01238 +<a name="l01239"></a>01239 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l01240"></a>01240 +<a name="l01241"></a><a class="code" href="classTiXmlText.html#895bf34ffad17f7439ab2a52b9651648">01241</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlText.html#895bf34ffad17f7439ab2a52b9651648">ToText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01242"></a><a class="code" href="classTiXmlText.html#e7c3a8fd3e4dbf6c0c4363a943d72f5b">01242</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlText.html#895bf34ffad17f7439ab2a52b9651648">ToText</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01243"></a>01243 +<a name="l01246"></a>01246 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlText.html#8483d4415ce9de6c4fa8f63d067d5de6">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* content ) <span class="keyword">const</span>; +<a name="l01247"></a>01247 +<a name="l01248"></a>01248 <span class="keyword">protected</span> : +<a name="l01250"></a>01250 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlText.html#0c411e93a27537369479d034cc82da3b">Clone</a>() <span class="keyword">const</span>; +<a name="l01251"></a>01251 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlText.html">TiXmlText</a>* target ) <span class="keyword">const</span>; +<a name="l01252"></a>01252 +<a name="l01253"></a>01253 <span class="keywordtype">bool</span> Blank() <span class="keyword">const</span>; <span class="comment">// returns true if all white space and new lines</span> +<a name="l01254"></a>01254 <span class="comment">// [internal use]</span> +<a name="l01255"></a>01255 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01256"></a>01256 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01257"></a>01257 <span class="preprocessor"> #endif</span> +<a name="l01258"></a>01258 <span class="preprocessor"></span> +<a name="l01259"></a>01259 <span class="keyword">private</span>: +<a name="l01260"></a>01260 <span class="keywordtype">bool</span> cdata; <span class="comment">// true if this should be input and output as a CDATA style text element</span> +<a name="l01261"></a>01261 }; +<a name="l01262"></a>01262 +<a name="l01263"></a>01263 +<a name="l01277"></a><a class="code" href="classTiXmlDeclaration.html">01277</a> <span class="keyword">class </span><a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l01278"></a>01278 { +<a name="l01279"></a>01279 <span class="keyword">public</span>: +<a name="l01281"></a><a class="code" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">01281</a> <a class="code" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a>() : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>::DECLARATION ) {} +<a name="l01282"></a>01282 +<a name="l01283"></a>01283 <span class="preprocessor">#ifdef TIXML_USE_STL</span> +<a name="l01285"></a>01285 <span class="preprocessor"> TiXmlDeclaration( const std::string& _version,</span> +<a name="l01286"></a>01286 <span class="preprocessor"></span> <span class="keyword">const</span> std::string& _encoding, +<a name="l01287"></a>01287 <span class="keyword">const</span> std::string& _standalone ); +<a name="l01288"></a>01288 <span class="preprocessor">#endif</span> +<a name="l01289"></a>01289 <span class="preprocessor"></span> +<a name="l01291"></a>01291 <a class="code" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _version, +<a name="l01292"></a>01292 <span class="keyword">const</span> <span class="keywordtype">char</span>* _encoding, +<a name="l01293"></a>01293 <span class="keyword">const</span> <span class="keywordtype">char</span>* _standalone ); +<a name="l01294"></a>01294 +<a name="l01295"></a>01295 <a class="code" href="classTiXmlDeclaration.html#a0484d059bea0ea1acb47c9094382d79">TiXmlDeclaration</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>& copy ); +<a name="l01296"></a>01296 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>& copy ); +<a name="l01297"></a>01297 +<a name="l01298"></a>01298 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>() {} +<a name="l01299"></a>01299 +<a name="l01301"></a><a class="code" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">01301</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#02ee557b1a4545c3219ed377c103ec76">Version</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> version.c_str (); } +<a name="l01303"></a><a class="code" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">01303</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#5d974231f9e9a2f0542f15f3a46cdb76">Encoding</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> encoding.c_str (); } +<a name="l01305"></a><a class="code" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">01305</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="classTiXmlDeclaration.html#9ff06afc033d7ef730ec7c6825b97ad9">Standalone</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> standalone.c_str (); } +<a name="l01306"></a>01306 +<a name="l01308"></a>01308 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlDeclaration.html#7cf459186040141cda7a180a6585ce2e">Clone</a>() <span class="keyword">const</span>; +<a name="l01309"></a>01309 <span class="comment">// Print this declaration to a FILE stream.</span> +<a name="l01310"></a>01310 <span class="keyword">virtual</span> <span class="keywordtype">void</span> Print( FILE* cfile, <span class="keywordtype">int</span> depth, TIXML_STRING* str ) <span class="keyword">const</span>; +<a name="l01311"></a><a class="code" href="classTiXmlDeclaration.html#bf6303db4bd05b5be554036817ff1cb4">01311</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> Print( FILE* cfile, <span class="keywordtype">int</span> depth )<span class="keyword"> const </span>{ +<a name="l01312"></a>01312 Print( cfile, depth, 0 ); +<a name="l01313"></a>01313 } +<a name="l01314"></a>01314 +<a name="l01315"></a>01315 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l01316"></a>01316 +<a name="l01317"></a><a class="code" href="classTiXmlDeclaration.html#1e085d3fefd1dbf5ccdbff729931a967">01317</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlDeclaration.html#1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01318"></a><a class="code" href="classTiXmlDeclaration.html#6bd3d1daddcaeb9543c24bfd090969ce">01318</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* <a class="code" href="classTiXmlDeclaration.html#1e085d3fefd1dbf5ccdbff729931a967">ToDeclaration</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01319"></a>01319 +<a name="l01322"></a>01322 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDeclaration.html#22315a535983b86535cdba3458669e3e">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* visitor ) <span class="keyword">const</span>; +<a name="l01323"></a>01323 +<a name="l01324"></a>01324 <span class="keyword">protected</span>: +<a name="l01325"></a>01325 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>* target ) <span class="keyword">const</span>; +<a name="l01326"></a>01326 <span class="comment">// used to be public</span> +<a name="l01327"></a>01327 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01328"></a>01328 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01329"></a>01329 <span class="preprocessor"> #endif</span> +<a name="l01330"></a>01330 <span class="preprocessor"></span> +<a name="l01331"></a>01331 <span class="keyword">private</span>: +<a name="l01332"></a>01332 +<a name="l01333"></a>01333 TIXML_STRING version; +<a name="l01334"></a>01334 TIXML_STRING encoding; +<a name="l01335"></a>01335 TIXML_STRING standalone; +<a name="l01336"></a>01336 }; +<a name="l01337"></a>01337 +<a name="l01338"></a>01338 +<a name="l01346"></a><a class="code" href="classTiXmlUnknown.html">01346</a> <span class="keyword">class </span><a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l01347"></a>01347 { +<a name="l01348"></a>01348 <span class="keyword">public</span>: +<a name="l01349"></a>01349 <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>() : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( TiXmlNode::UNKNOWN ) {} +<a name="l01350"></a>01350 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>() {} +<a name="l01351"></a>01351 +<a name="l01352"></a>01352 <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>& copy ) : <a class="code" href="classTiXmlNode.html">TiXmlNode</a>( TiXmlNode::UNKNOWN ) { copy.<a class="code" href="classTiXmlUnknown.html#08ca7b225a2bcb604d3c72e199d33408">CopyTo</a>( <span class="keyword">this</span> ); } +<a name="l01353"></a>01353 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>& copy ) { copy.<a class="code" href="classTiXmlUnknown.html#08ca7b225a2bcb604d3c72e199d33408">CopyTo</a>( <span class="keyword">this</span> ); } +<a name="l01354"></a>01354 +<a name="l01356"></a>01356 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlUnknown.html#0960bb7428b3f341da46244229604d73">Clone</a>() <span class="keyword">const</span>; +<a name="l01357"></a>01357 <span class="comment">// Print this Unknown to a FILE stream.</span> +<a name="l01358"></a>01358 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlUnknown.html#31ba089a40fb5a1869750fce09b0bacb">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth ) <span class="keyword">const</span>; +<a name="l01359"></a>01359 +<a name="l01360"></a>01360 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* Parse( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data, TiXmlEncoding encoding ); +<a name="l01361"></a>01361 +<a name="l01362"></a><a class="code" href="classTiXmlUnknown.html#b0313e5fe77987d746ac1a97a254419d">01362</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlUnknown.html#b0313e5fe77987d746ac1a97a254419d">ToUnknown</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01363"></a><a class="code" href="classTiXmlUnknown.html#67c9fd22940e8c47f706a72cdd2e332c">01363</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlUnknown.html#b0313e5fe77987d746ac1a97a254419d">ToUnknown</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01364"></a>01364 +<a name="l01367"></a>01367 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlUnknown.html#d7122e5135581b3c832a1a3217760a93">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* content ) <span class="keyword">const</span>; +<a name="l01368"></a>01368 +<a name="l01369"></a>01369 <span class="keyword">protected</span>: +<a name="l01370"></a>01370 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* target ) <span class="keyword">const</span>; +<a name="l01371"></a>01371 +<a name="l01372"></a>01372 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01373"></a>01373 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01374"></a>01374 <span class="preprocessor"> #endif</span> +<a name="l01375"></a>01375 <span class="preprocessor"></span> +<a name="l01376"></a>01376 <span class="keyword">private</span>: +<a name="l01377"></a>01377 +<a name="l01378"></a>01378 }; +<a name="l01379"></a>01379 +<a name="l01380"></a>01380 +<a name="l01385"></a><a class="code" href="classTiXmlDocument.html">01385</a> <span class="keyword">class </span><a class="code" href="classTiXmlDocument.html">TiXmlDocument</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a> +<a name="l01386"></a>01386 { +<a name="l01387"></a>01387 <span class="keyword">public</span>: +<a name="l01389"></a>01389 <a class="code" href="classTiXmlDocument.html#9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>(); +<a name="l01391"></a>01391 <a class="code" href="classTiXmlDocument.html#9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * documentName ); +<a name="l01392"></a>01392 +<a name="l01393"></a>01393 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01395"></a>01395 <span class="preprocessor"> TiXmlDocument( const std::string& documentName );</span> +<a name="l01396"></a>01396 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l01397"></a>01397 <span class="preprocessor"></span> +<a name="l01398"></a>01398 <a class="code" href="classTiXmlDocument.html#9f5e84335708fde98400230f9f12659c">TiXmlDocument</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& copy ); +<a name="l01399"></a>01399 <span class="keywordtype">void</span> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& copy ); +<a name="l01400"></a>01400 +<a name="l01401"></a>01401 <span class="keyword">virtual</span> ~<a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>() {} +<a name="l01402"></a>01402 +<a name="l01407"></a>01407 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); +<a name="l01409"></a>01409 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>() <span class="keyword">const</span>; +<a name="l01411"></a>01411 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); +<a name="l01413"></a>01413 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * filename ) <span class="keyword">const</span>; +<a name="l01419"></a>01419 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); +<a name="l01421"></a>01421 <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>( FILE* ) <span class="keyword">const</span>; +<a name="l01422"></a>01422 +<a name="l01423"></a>01423 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01424"></a><a class="code" href="classTiXmlDocument.html#18ae6ed34fed7991ebc220862dfac884">01424</a> <span class="preprocessor"></span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>( <span class="keyword">const</span> std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) +<a name="l01425"></a>01425 { +<a name="l01426"></a>01426 <span class="comment">// StringToBuffer f( filename );</span> +<a name="l01427"></a>01427 <span class="comment">// return ( f.buffer && LoadFile( f.buffer, encoding ));</span> +<a name="l01428"></a>01428 <span class="keywordflow">return</span> <a class="code" href="classTiXmlDocument.html#4c852a889c02cf251117fd1d9fe1845f">LoadFile</a>( filename.c_str(), encoding ); +<a name="l01429"></a>01429 } +<a name="l01430"></a><a class="code" href="classTiXmlDocument.html#3d4fae0463f3f03679ba0b7cf6f2df52">01430</a> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>( <span class="keyword">const</span> std::string& filename ) <span class="keyword">const</span> +<a name="l01431"></a>01431 { +<a name="l01432"></a>01432 <span class="comment">// StringToBuffer f( filename );</span> +<a name="l01433"></a>01433 <span class="comment">// return ( f.buffer && SaveFile( f.buffer ));</span> +<a name="l01434"></a>01434 <span class="keywordflow">return</span> <a class="code" href="classTiXmlDocument.html#21c0aeb0d0a720169ad4ac89523ebe93">SaveFile</a>( filename.c_str() ); +<a name="l01435"></a>01435 } +<a name="l01436"></a>01436 <span class="preprocessor"> #endif</span> +<a name="l01437"></a>01437 <span class="preprocessor"></span> +<a name="l01442"></a>01442 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlDocument.html#17ebabe36926ef398e78dec0d0ad0378">Parse</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); +<a name="l01443"></a>01443 +<a name="l01448"></a><a class="code" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">01448</a> <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">RootElement</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>(); } +<a name="l01449"></a>01449 <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlDocument.html#d09d17927f908f40efb406af2fb873be">RootElement</a>() { <span class="keywordflow">return</span> <a class="code" href="classTiXmlNode.html#f4fb652f6bd79ae0d5ce7d0f7d3c0fba">FirstChildElement</a>(); } +<a name="l01450"></a>01450 +<a name="l01456"></a><a class="code" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">01456</a> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#6dfc01a6e5d58e56acd537dfd3bdeb29">Error</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> error; } +<a name="l01457"></a>01457 +<a name="l01459"></a><a class="code" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">01459</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classTiXmlDocument.html#9d0f689f6e09ea494ea547be8d79c25e">ErrorDesc</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorDesc.c_str (); } +<a name="l01460"></a>01460 +<a name="l01464"></a><a class="code" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">01464</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#f96fc2f3f9ec6422782bfe916c9e778f">ErrorId</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorId; } +<a name="l01465"></a>01465 +<a name="l01473"></a><a class="code" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">01473</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#f30efc75e804aa2e92fb8be3a8cb676e">ErrorRow</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorLocation.row+1; } +<a name="l01474"></a><a class="code" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">01474</a> <span class="keywordtype">int</span> <a class="code" href="classTiXmlDocument.html#a90bc630ee5203c6109ca5fad3323649">ErrorCol</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> errorLocation.col+1; } +<a name="l01475"></a>01475 +<a name="l01500"></a><a class="code" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">01500</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#51dac56316f89b35bdb7d0d433ba988e">SetTabSize</a>( <span class="keywordtype">int</span> _tabsize ) { tabsize = _tabsize; } +<a name="l01501"></a>01501 +<a name="l01502"></a>01502 <span class="keywordtype">int</span> TabSize()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> tabsize; } +<a name="l01503"></a>01503 +<a name="l01507"></a><a class="code" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">01507</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#c66b8c28db86363315712a3574e87c35">ClearError</a>() { error = <span class="keyword">false</span>; +<a name="l01508"></a>01508 errorId = 0; +<a name="l01509"></a>01509 errorDesc = <span class="stringliteral">""</span>; +<a name="l01510"></a>01510 errorLocation.row = errorLocation.col = 0; +<a name="l01511"></a>01511 <span class="comment">//errorLocation.last = 0; </span> +<a name="l01512"></a>01512 } +<a name="l01513"></a>01513 +<a name="l01515"></a><a class="code" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">01515</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">Print</a>()<span class="keyword"> const </span>{ <a class="code" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">Print</a>( stdout, 0 ); } +<a name="l01516"></a>01516 +<a name="l01517"></a>01517 <span class="comment">/* Write the document to a string using formatted printing ("pretty print"). This</span> +<a name="l01518"></a>01518 <span class="comment"> will allocate a character array (new char[]) and return it as a pointer. The</span> +<a name="l01519"></a>01519 <span class="comment"> calling code pust call delete[] on the return char* to avoid a memory leak.</span> +<a name="l01520"></a>01520 <span class="comment"> */</span> +<a name="l01521"></a>01521 <span class="comment">//char* PrintToMemory() const; </span> +<a name="l01522"></a>01522 +<a name="l01524"></a>01524 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classTiXmlDocument.html#f08389ec70ee9b2de7f800e206a18510">Print</a>( FILE* cfile, <span class="keywordtype">int</span> depth = 0 ) <span class="keyword">const</span>; +<a name="l01525"></a>01525 <span class="comment">// [internal use]</span> +<a name="l01526"></a>01526 <span class="keywordtype">void</span> SetError( <span class="keywordtype">int</span> err, <span class="keyword">const</span> <span class="keywordtype">char</span>* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); +<a name="l01527"></a>01527 +<a name="l01528"></a><a class="code" href="classTiXmlDocument.html#1dc977bde3e4fe85a8eb9d88a35ef5a4">01528</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlDocument.html#1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01529"></a><a class="code" href="classTiXmlDocument.html#1025d942a1f328fd742d545e37efdd42">01529</a> <span class="keyword">virtual</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* <a class="code" href="classTiXmlDocument.html#1dc977bde3e4fe85a8eb9d88a35ef5a4">ToDocument</a>() { <span class="keywordflow">return</span> <span class="keyword">this</span>; } +<a name="l01530"></a>01530 +<a name="l01533"></a>01533 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlDocument.html#a545aae325d9752ad64120bc4ecf939a">Accept</a>( <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a>* content ) <span class="keyword">const</span>; +<a name="l01534"></a>01534 +<a name="l01535"></a>01535 <span class="keyword">protected</span> : +<a name="l01536"></a>01536 <span class="comment">// [internal use]</span> +<a name="l01537"></a>01537 <span class="keyword">virtual</span> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlDocument.html#4968661cab4a1f44a23329c6f8db1907">Clone</a>() <span class="keyword">const</span>; +<a name="l01538"></a>01538 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01539"></a>01539 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StreamIn( std::istream * in, TIXML_STRING * tag ); +<a name="l01540"></a>01540 <span class="preprocessor"> #endif</span> +<a name="l01541"></a>01541 <span class="preprocessor"></span> +<a name="l01542"></a>01542 <span class="keyword">private</span>: +<a name="l01543"></a>01543 <span class="keywordtype">void</span> CopyTo( <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>* target ) <span class="keyword">const</span>; +<a name="l01544"></a>01544 +<a name="l01545"></a>01545 <span class="keywordtype">bool</span> error; +<a name="l01546"></a>01546 <span class="keywordtype">int</span> errorId; +<a name="l01547"></a>01547 TIXML_STRING errorDesc; +<a name="l01548"></a>01548 <span class="keywordtype">int</span> tabsize; +<a name="l01549"></a>01549 TiXmlCursor errorLocation; +<a name="l01550"></a>01550 <span class="keywordtype">bool</span> useMicrosoftBOM; <span class="comment">// the UTF-8 BOM were found when read. Note this, and try to write.</span> +<a name="l01551"></a>01551 }; +<a name="l01552"></a>01552 +<a name="l01553"></a>01553 +<a name="l01634"></a><a class="code" href="classTiXmlHandle.html">01634</a> <span class="keyword">class </span><a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> +<a name="l01635"></a>01635 { +<a name="l01636"></a>01636 <span class="keyword">public</span>: +<a name="l01638"></a><a class="code" href="classTiXmlHandle.html#ba18fd7bdefb942ecdea4bf4b8e29ec8">01638</a> <a class="code" href="classTiXmlHandle.html#ba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a>( <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* _node ) { this->node = _node; } +<a name="l01640"></a><a class="code" href="classTiXmlHandle.html#236d7855e1e56ccc7b980630c48c7fd7">01640</a> <a class="code" href="classTiXmlHandle.html#ba18fd7bdefb942ecdea4bf4b8e29ec8">TiXmlHandle</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a>& ref ) { this->node = ref.<a class="code" href="classTiXmlHandle.html#c5429de14bb78b16288bac5bf33c6858">node</a>; } +<a name="l01641"></a>01641 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> operator=( <span class="keyword">const</span> <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a>& ref ) { this->node = ref.<a class="code" href="classTiXmlHandle.html#c5429de14bb78b16288bac5bf33c6858">node</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; } +<a name="l01642"></a>01642 +<a name="l01644"></a>01644 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>() <span class="keyword">const</span>; +<a name="l01646"></a>01646 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>; +<a name="l01648"></a>01648 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>() <span class="keyword">const</span>; +<a name="l01650"></a>01650 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * value ) <span class="keyword">const</span>; +<a name="l01651"></a>01651 +<a name="l01655"></a>01655 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>; +<a name="l01659"></a>01659 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>; +<a name="l01664"></a>01664 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* value, <span class="keywordtype">int</span> index ) <span class="keyword">const</span>; +<a name="l01669"></a>01669 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a>( <span class="keywordtype">int</span> index ) <span class="keyword">const</span>; +<a name="l01670"></a>01670 +<a name="l01671"></a>01671 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01672"></a>01672 <span class="preprocessor"></span> <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#cdb1faaf88a700b40ca2c8d9aee21139">FirstChild</a>( _value.c_str() ); } +<a name="l01673"></a>01673 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>( <span class="keyword">const</span> std::string& _value )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#24d1112e995e937e4dddb202d4113d4a">FirstChildElement</a>( _value.c_str() ); } +<a name="l01674"></a>01674 +<a name="l01675"></a>01675 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a>( <span class="keyword">const</span> std::string& _value, <span class="keywordtype">int</span> index )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#072492b4be1acdb0db2d03cd8f71ccc4">Child</a>( _value.c_str(), index ); } +<a name="l01676"></a>01676 <a class="code" href="classTiXmlHandle.html">TiXmlHandle</a> <a class="code" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a>( <span class="keyword">const</span> std::string& _value, <span class="keywordtype">int</span> index )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#979a3f850984a176ee884e394c7eed2d">ChildElement</a>( _value.c_str(), index ); } +<a name="l01677"></a>01677 <span class="preprocessor"> #endif</span> +<a name="l01678"></a>01678 <span class="preprocessor"></span> +<a name="l01681"></a><a class="code" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">01681</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">ToNode</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> node; } +<a name="l01684"></a><a class="code" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">01684</a> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ( ( node && node-><a class="code" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() ) ? node-><a class="code" href="classTiXmlNode.html#72abed96dc9667ab9e0a2a275301bb1c">ToElement</a>() : 0 ); } +<a name="l01687"></a><a class="code" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">01687</a> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">ToText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ( ( node && node-><a class="code" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() ) ? node-><a class="code" href="classTiXmlNode.html#95a46a52c525992d6b4ee08beb14cd69">ToText</a>() : 0 ); } +<a name="l01690"></a><a class="code" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">01690</a> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">ToUnknown</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ( ( node && node-><a class="code" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() ) ? node-><a class="code" href="classTiXmlNode.html#fd7205cf31d7a376929f8a36930627a2">ToUnknown</a>() : 0 ); } +<a name="l01691"></a>01691 +<a name="l01695"></a><a class="code" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">01695</a> <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* <a class="code" href="classTiXmlHandle.html#b44b723a8dc9af72838a303c079d0376">Node</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#f678e5088e83be67baf76f699756f2c3">ToNode</a>(); } +<a name="l01699"></a><a class="code" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">01699</a> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>* <a class="code" href="classTiXmlHandle.html#cb5fe8388a526289ea65e817a51e05e7">Element</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#bc6e7ed383a5fe1e52b0c0004b457b9e">ToElement</a>(); } +<a name="l01703"></a><a class="code" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">01703</a> <a class="code" href="classTiXmlText.html">TiXmlText</a>* <a class="code" href="classTiXmlHandle.html#9fc739c8a18d160006f82572fc143d13">Text</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#4ac53a652296203a5b5e13854d923586">ToText</a>(); } +<a name="l01707"></a><a class="code" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">01707</a> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>* <a class="code" href="classTiXmlHandle.html#49675b74357ba2aae124657a9a1ef465">Unknown</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classTiXmlHandle.html#1381c17507a130767b1e23afc93b3674">ToUnknown</a>(); } +<a name="l01708"></a>01708 +<a name="l01709"></a>01709 <span class="keyword">private</span>: +<a name="l01710"></a>01710 <a class="code" href="classTiXmlNode.html">TiXmlNode</a>* node; +<a name="l01711"></a>01711 }; +<a name="l01712"></a>01712 +<a name="l01713"></a>01713 +<a name="l01733"></a><a class="code" href="classTiXmlPrinter.html">01733</a> <span class="keyword">class </span><a class="code" href="classTiXmlPrinter.html">TiXmlPrinter</a> : <span class="keyword">public</span> <a class="code" href="classTiXmlVisitor.html">TiXmlVisitor</a> +<a name="l01734"></a>01734 { +<a name="l01735"></a>01735 <span class="keyword">public</span>: +<a name="l01736"></a>01736 <a class="code" href="classTiXmlPrinter.html">TiXmlPrinter</a>() : depth( 0 ), simpleTextPrint( <span class="keyword">false</span> ), +<a name="l01737"></a>01737 buffer(), indent( <span class="stringliteral">" "</span> ), lineBreak( <span class="stringliteral">"\n"</span> ) {} +<a name="l01738"></a>01738 +<a name="l01739"></a>01739 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& doc ); +<a name="l01740"></a>01740 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#66b33edd76c538b462f789b797a4fdf2">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDocument.html">TiXmlDocument</a>& doc ); +<a name="l01741"></a>01741 +<a name="l01742"></a>01742 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#799f4f0388570cbb54c0d3c345fef7c1">VisitEnter</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& element, <span class="keyword">const</span> <a class="code" href="classTiXmlAttribute.html">TiXmlAttribute</a>* firstAttribute ); +<a name="l01743"></a>01743 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#66b33edd76c538b462f789b797a4fdf2">VisitExit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlElement.html">TiXmlElement</a>& element ); +<a name="l01744"></a>01744 +<a name="l01745"></a>01745 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlDeclaration.html">TiXmlDeclaration</a>& declaration ); +<a name="l01746"></a>01746 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlText.html">TiXmlText</a>& text ); +<a name="l01747"></a>01747 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlComment.html">TiXmlComment</a>& comment ); +<a name="l01748"></a>01748 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classTiXmlPrinter.html#ce1b14d33eede2575c0743e2350f6a38">Visit</a>( <span class="keyword">const</span> <a class="code" href="classTiXmlUnknown.html">TiXmlUnknown</a>& unknown ); +<a name="l01749"></a>01749 +<a name="l01753"></a><a class="code" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">01753</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#213377a4070c7e625bae59716b089e5e">SetIndent</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _indent ) { indent = _indent ? _indent : <span class="stringliteral">""</span> ; } +<a name="l01755"></a><a class="code" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">01755</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#bb33ec7d4bad6aaeb57f4304394b133d">Indent</a>() { <span class="keywordflow">return</span> indent.c_str(); } +<a name="l01760"></a><a class="code" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">01760</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#4be1e37e69e3858c59635aa947174fe6">SetLineBreak</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : <span class="stringliteral">""</span>; } +<a name="l01762"></a><a class="code" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">01762</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#11f1b4804a460b175ec244eb5724d96d">LineBreak</a>() { <span class="keywordflow">return</span> lineBreak.c_str(); } +<a name="l01763"></a>01763 +<a name="l01767"></a><a class="code" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">01767</a> <span class="keywordtype">void</span> <a class="code" href="classTiXmlPrinter.html#b23a90629e374cb1cadca090468bbd19">SetStreamPrinting</a>() { indent = <span class="stringliteral">""</span>; +<a name="l01768"></a>01768 lineBreak = <span class="stringliteral">""</span>; +<a name="l01769"></a>01769 } +<a name="l01771"></a><a class="code" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">01771</a> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classTiXmlPrinter.html#859eede9597d3e0355b77757be48735e">CStr</a>() { <span class="keywordflow">return</span> buffer.c_str(); } +<a name="l01773"></a><a class="code" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">01773</a> size_t <a class="code" href="classTiXmlPrinter.html#d01375ae9199bd2f48252eaddce3039d">Size</a>() { <span class="keywordflow">return</span> buffer.size(); } +<a name="l01774"></a>01774 +<a name="l01775"></a>01775 <span class="preprocessor"> #ifdef TIXML_USE_STL</span> +<a name="l01777"></a><a class="code" href="classTiXmlPrinter.html#3bd4daf44309b41f5813a833caa0d1c9">01777</a> <span class="preprocessor"> const std::string& Str() { return buffer; }</span> +<a name="l01778"></a>01778 <span class="preprocessor"></span><span class="preprocessor"> #endif</span> +<a name="l01779"></a>01779 <span class="preprocessor"></span> +<a name="l01780"></a>01780 <span class="keyword">private</span>: +<a name="l01781"></a>01781 <span class="keywordtype">void</span> DoIndent() { +<a name="l01782"></a>01782 <span class="keywordflow">for</span>( <span class="keywordtype">int</span> i=0; i<depth; ++i ) +<a name="l01783"></a>01783 buffer += indent; +<a name="l01784"></a>01784 } +<a name="l01785"></a>01785 <span class="keywordtype">void</span> DoLineBreak() { +<a name="l01786"></a>01786 buffer += lineBreak; +<a name="l01787"></a>01787 } +<a name="l01788"></a>01788 +<a name="l01789"></a>01789 <span class="keywordtype">int</span> depth; +<a name="l01790"></a>01790 <span class="keywordtype">bool</span> simpleTextPrint; +<a name="l01791"></a>01791 TIXML_STRING buffer; +<a name="l01792"></a>01792 TIXML_STRING indent; +<a name="l01793"></a>01793 TIXML_STRING lineBreak; +<a name="l01794"></a>01794 }; +<a name="l01795"></a>01795 +<a name="l01796"></a>01796 +<a name="l01797"></a>01797 <span class="preprocessor">#ifdef _MSC_VER</span> +<a name="l01798"></a>01798 <span class="preprocessor"></span><span class="preprocessor">#pragma warning( pop )</span> +<a name="l01799"></a>01799 <span class="preprocessor"></span><span class="preprocessor">#endif</span> +<a name="l01800"></a>01800 <span class="preprocessor"></span> +<a name="l01801"></a>01801 <span class="preprocessor">#endif</span> +<a name="l01802"></a>01802 <span class="preprocessor"></span> +</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/docs/tutorial0.html b/shared/tinyxml/docs/tutorial0.html new file mode 100644 index 00000000..d5d19cab --- /dev/null +++ b/shared/tinyxml/docs/tutorial0.html @@ -0,0 +1,721 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>TinyXml: TinyXML Tutorial</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.4.7 --> +<div class="tabs"> + <ul> + <li><a href="index.html"><span>Main Page</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + <li><a href="pages.html"><span>Related Pages</span></a></li> + </ul></div> +<div class="nav"> +<a class="el" href="index.html">index</a></div> +<h1><a class="anchor" name="tutorial0">TinyXML Tutorial</a></h1><h1>What is this? </h1> +<p> +This tutorial has a few tips and suggestions on how to use TinyXML effectively.<p> +I've also tried to include some C++ tips like how to convert strings to integers and vice versa. This isn't anything to do with TinyXML itself, but it may helpful for your project so I've put it in anyway.<p> +If you don't know basic C++ concepts this tutorial won't be useful. Likewise if you don't know what a DOM is, look elsewhere first.<p> +<h1>Before we start </h1> +<p> +Some example XML datasets/files will be used.<p> +example1.xml:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<Hello>World</Hello> +</pre></div><p> +example2.xml:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<poetry> + <verse> + Alas + Great World + Alas (again) + </verse> +</poetry> +</pre></div><p> +example3.xml:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<shapes> + <circle name="int-based" x="20" y="30" r="50" /> + <point name="float-based" x="3.5" y="52.1" /> +</shapes> +</pre></div><p> +example4.xml<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<MyApp> + <!-- Settings for MyApp --> + <Messages> + <Welcome>Welcome to MyApp</Welcome> + <Farewell>Thank you for using MyApp</Farewell> + </Messages> + <Windows> + <Window name="MainFrame" x="5" y="15" w="400" h="250" /> + </Windows> + <Connection ip="192.168.0.1" timeout="123.456000" /> +</MyApp> +</pre></div><p> +<h1>Getting Started </h1> +<p> +<h2>Load XML from a file </h2> +<p> +The simplest way to load a file into a TinyXML DOM is:<p> +<div class="fragment"><pre class="fragment">TiXmlDocument doc( "demo.xml" ); +doc.LoadFile(); +</pre></div><p> +A more real-world usage is shown below. This will load the file and display the contents to STDOUT:<p> +<div class="fragment"><pre class="fragment">// load the named file and dump its structure to STDOUT +void dump_to_stdout(const char* pFilename) +{ + TiXmlDocument doc(pFilename); + bool loadOkay = doc.LoadFile(); + if (loadOkay) + { + printf("\n%s:\n", pFilename); + dump_to_stdout( &doc ); // defined later in the tutorial + } + else + { + printf("Failed to load file \"%s\"\n", pFilename); + } +} +</pre></div><p> +A simple demonstration of this function is to use a main like this:<p> +<div class="fragment"><pre class="fragment">int main(void) +{ + dump_to_stdout("example1.xml"); + return 0; +} +</pre></div><p> +Recall that Example 1 XML is:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<Hello>World</Hello> +</pre></div><p> +Running the program with this XML will display this in the console/DOS window:<p> +<div class="fragment"><pre class="fragment">DOCUMENT ++ DECLARATION ++ ELEMENT Hello + + TEXT[World] +</pre></div><p> +The ``dump_to_stdout`` function is defined later in this tutorial and is useful if you want to understand recursive traversal of a DOM.<p> +<h2>Building Documents Programatically </h2> +<p> +This is how to build Example 1 pragmatically:<p> +<div class="fragment"><pre class="fragment">void build_simple_doc( ) +{ + // Make xml: <?xml ..><Hello>World</Hello> + TiXmlDocument doc; + TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" ); + TiXmlElement * element = new TiXmlElement( "Hello" ); + TiXmlText * text = new TiXmlText( "World" ); + element->LinkEndChild( text ); + doc.LinkEndChild( decl ); + doc.LinkEndChild( element ); + doc.SaveFile( "madeByHand.xml" ); +} +</pre></div><p> +This can be loaded and displayed on the console with:<p> +<div class="fragment"><pre class="fragment">dump_to_stdout("madeByHand.xml"); // this func defined later in the tutorial +</pre></div><p> +and you'll see it is identical to Example 1:<p> +<div class="fragment"><pre class="fragment">madeByHand.xml: +Document ++ Declaration ++ Element [Hello] + + Text: [World] +</pre></div><p> +This code produces exactly the same XML DOM but it shows a different ordering to node creation and linking:<p> +<div class="fragment"><pre class="fragment">void write_simple_doc2( ) +{ + // same as write_simple_doc1 but add each node + // as early as possible into the tree. + + TiXmlDocument doc; + TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "", "" ); + doc.LinkEndChild( decl ); + + TiXmlElement * element = new TiXmlElement( "Hello" ); + doc.LinkEndChild( element ); + + TiXmlText * text = new TiXmlText( "World" ); + element->LinkEndChild( text ); + + doc.SaveFile( "madeByHand2.xml" ); +} +</pre></div><p> +Both of these produce the same XML, namely:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<Hello>World</Hello> +</pre></div><p> +Or in structure form:<p> +<div class="fragment"><pre class="fragment">DOCUMENT ++ DECLARATION ++ ELEMENT Hello + + TEXT[World] +</pre></div><p> +<h2>Attributes </h2> +<p> +Given an existing node, settings attributes is easy:<p> +<div class="fragment"><pre class="fragment">window = new TiXmlElement( "Demo" ); +window->SetAttribute("name", "Circle"); +window->SetAttribute("x", 5); +window->SetAttribute("y", 15); +window->SetDoubleAttribute("radius", 3.14159); +</pre></div><p> +You can it also work with the <a class="el" href="classTiXmlAttribute.html">TiXmlAttribute</a> objects if you want.<p> +The following code shows one way (not the only way) to get all attributes of an element, print the name and string value, and if the value can be converted to an integer or double, print that value too:<p> +<div class="fragment"><pre class="fragment">// print all attributes of pElement. +// returns the number of attributes printed +int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent) +{ + if ( !pElement ) return 0; + + TiXmlAttribute* pAttrib=pElement->FirstAttribute(); + int i=0; + int ival; + double dval; + const char* pIndent=getIndent(indent); + printf("\n"); + while (pAttrib) + { + printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value()); + + if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS) printf( " int=%d", ival); + if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval); + printf( "\n" ); + i++; + pAttrib=pAttrib->Next(); + } + return i; +} +</pre></div><p> +<h2>Writing a document to a file </h2> +<p> +Writing a pre-built DOM to a file is trivial:<p> +<div class="fragment"><pre class="fragment">doc.SaveFile( saveFilename ); +</pre></div><p> +Recall, for example, example 4:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<MyApp> + <!-- Settings for MyApp --> + <Messages> + <Welcome>Welcome to MyApp</Welcome> + <Farewell>Thank you for using MyApp</Farewell> + </Messages> + <Windows> + <Window name="MainFrame" x="5" y="15" w="400" h="250" /> + </Windows> + <Connection ip="192.168.0.1" timeout="123.456000" /> +</MyApp> +</pre></div><p> +The following function builds this DOM and writes the file "appsettings.xml":<p> +<div class="fragment"><pre class="fragment">void write_app_settings_doc( ) +{ + TiXmlDocument doc; + TiXmlElement* msg; + TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); + doc.LinkEndChild( decl ); + + TiXmlElement * root = new TiXmlElement( "MyApp" ); + doc.LinkEndChild( root ); + + TiXmlComment * comment = new TiXmlComment(); + comment->SetValue(" Settings for MyApp " ); + root->LinkEndChild( comment ); + + TiXmlElement * msgs = new TiXmlElement( "Messages" ); + root->LinkEndChild( msgs ); + + msg = new TiXmlElement( "Welcome" ); + msg->LinkEndChild( new TiXmlText( "Welcome to MyApp" )); + msgs->LinkEndChild( msg ); + + msg = new TiXmlElement( "Farewell" ); + msg->LinkEndChild( new TiXmlText( "Thank you for using MyApp" )); + msgs->LinkEndChild( msg ); + + TiXmlElement * windows = new TiXmlElement( "Windows" ); + root->LinkEndChild( windows ); + + TiXmlElement * window; + window = new TiXmlElement( "Window" ); + windows->LinkEndChild( window ); + window->SetAttribute("name", "MainFrame"); + window->SetAttribute("x", 5); + window->SetAttribute("y", 15); + window->SetAttribute("w", 400); + window->SetAttribute("h", 250); + + TiXmlElement * cxn = new TiXmlElement( "Connection" ); + root->LinkEndChild( cxn ); + cxn->SetAttribute("ip", "192.168.0.1"); + cxn->SetDoubleAttribute("timeout", 123.456); // floating point attrib + + dump_to_stdout( &doc ); + doc.SaveFile( "appsettings.xml" ); +} +</pre></div><p> +The dump_to_stdout function will show this structure:<p> +<div class="fragment"><pre class="fragment">Document ++ Declaration ++ Element [MyApp] + (No attributes) + + Comment: [ Settings for MyApp ] + + Element [Messages] + (No attributes) + + Element [Welcome] + (No attributes) + + Text: [Welcome to MyApp] + + Element [Farewell] + (No attributes) + + Text: [Thank you for using MyApp] + + Element [Windows] + (No attributes) + + Element [Window] + + name: value=[MainFrame] + + x: value=[5] int=5 d=5.0 + + y: value=[15] int=15 d=15.0 + + w: value=[400] int=400 d=400.0 + + h: value=[250] int=250 d=250.0 + 5 attributes + + Element [Connection] + + ip: value=[192.168.0.1] int=192 d=192.2 + + timeout: value=[123.456000] int=123 d=123.5 + 2 attributes +</pre></div><p> +I was surprised that TinyXml, by default, writes the XML in what other APIs call a "pretty" format - it modifies the whitespace of text of elements that contain other nodes so that writing the tree includes an indication of nesting level.<p> +I haven't looked yet to see if there is a way to turn off indenting when writing a file - its bound to be easy.<p> +[Lee: It's easy in STL mode, just use cout << myDoc. Non-STL mode is always in "pretty" format. Adding a switch would be a nice feature and has been requested.]<p> +<h1>XML to/from C++ objects </h1> +<p> +<h2>Intro </h2> +<p> +This example assumes you're loading and saving your app settings in an XML file, e.g. something like example4.xml.<p> +There are a number of ways to do this. For example, look into the TinyBind project at <a href="http://sourceforge.net/projects/tinybind">http://sourceforge.net/projects/tinybind</a><p> +This section shows a plain-old approach to loading and saving a basic object structure using XML.<p> +<h2>Set up your object classes </h2> +<p> +Start off with some basic classes like these:<p> +<div class="fragment"><pre class="fragment">#include <string> +#include <map> +using namespace std; + +typedef std::map<std::string,std::string> MessageMap; + +// a basic window abstraction - demo purposes only +class WindowSettings +{ +public: + int x,y,w,h; + string name; + + WindowSettings() + : x(0), y(0), w(100), h(100), name("Untitled") + { + } + + WindowSettings(int x, int y, int w, int h, const string& name) + { + this->x=x; + this->y=y; + this->w=w; + this->h=h; + this->name=name; + } +}; + +class ConnectionSettings +{ +public: + string ip; + double timeout; +}; + +class AppSettings +{ +public: + string m_name; + MessageMap m_messages; + list<WindowSettings> m_windows; + ConnectionSettings m_connection; + + AppSettings() {} + + void save(const char* pFilename); + void load(const char* pFilename); + + // just to show how to do it + void setDemoValues() + { + m_name="MyApp"; + m_messages.clear(); + m_messages["Welcome"]="Welcome to "+m_name; + m_messages["Farewell"]="Thank you for using "+m_name; + m_windows.clear(); + m_windows.push_back(WindowSettings(15,15,400,250,"Main")); + m_connection.ip="Unknown"; + m_connection.timeout=123.456; + } +}; +</pre></div><p> +This is a basic main() that shows how to create a default settings object tree, save it and load it again:<p> +<div class="fragment"><pre class="fragment">int main(void) +{ + AppSettings settings; + + settings.save("appsettings2.xml"); + settings.load("appsettings2.xml"); + return 0; +} +</pre></div><p> +The following main() shows creation, modification, saving and then loading of a settings structure:<p> +<div class="fragment"><pre class="fragment">int main(void) +{ + // block: customise and save settings + { + AppSettings settings; + settings.m_name="HitchHikerApp"; + settings.m_messages["Welcome"]="Don't Panic"; + settings.m_messages["Farewell"]="Thanks for all the fish"; + settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame")); + settings.m_connection.ip="192.168.0.77"; + settings.m_connection.timeout=42.0; + + settings.save("appsettings2.xml"); + } + + // block: load settings + { + AppSettings settings; + settings.load("appsettings2.xml"); + printf("%s: %s\n", settings.m_name.c_str(), + settings.m_messages["Welcome"].c_str()); + WindowSettings & w=settings.m_windows.front(); + printf("%s: Show window '%s' at %d,%d (%d x %d)\n", + settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h); + printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str()); + } + return 0; +} +</pre></div><p> +When the save() and load() are completed (see below), running this main() displays on the console:<p> +<div class="fragment"><pre class="fragment">HitchHikerApp: Don't Panic +HitchHikerApp: Show window 'BookFrame' at 15,25 (300 x 100) +HitchHikerApp: Thanks for all the fish +</pre></div><p> +<h2>Encode C++ state as XML </h2> +<p> +There are lots of different ways to approach saving this to a file. Here's one:<p> +<div class="fragment"><pre class="fragment">void AppSettings::save(const char* pFilename) +{ + TiXmlDocument doc; + TiXmlElement* msg; + TiXmlComment * comment; + string s; + TiXmlDeclaration* decl = new TiXmlDeclaration( "1.0", "", "" ); + doc.LinkEndChild( decl ); + + TiXmlElement * root = new TiXmlElement(m_name.c_str()); + doc.LinkEndChild( root ); + + comment = new TiXmlComment(); + s=" Settings for "+m_name+" "; + comment->SetValue(s.c_str()); + root->LinkEndChild( comment ); + + // block: messages + { + MessageMap::iterator iter; + + TiXmlElement * msgs = new TiXmlElement( "Messages" ); + root->LinkEndChild( msgs ); + + for (iter=m_messages.begin(); iter != m_messages.end(); iter++) + { + const string & key=(*iter).first; + const string & value=(*iter).second; + msg = new TiXmlElement(key.c_str()); + msg->LinkEndChild( new TiXmlText(value.c_str())); + msgs->LinkEndChild( msg ); + } + } + + // block: windows + { + TiXmlElement * windowsNode = new TiXmlElement( "Windows" ); + root->LinkEndChild( windowsNode ); + + list<WindowSettings>::iterator iter; + + for (iter=m_windows.begin(); iter != m_windows.end(); iter++) + { + const WindowSettings& w=*iter; + + TiXmlElement * window; + window = new TiXmlElement( "Window" ); + windowsNode->LinkEndChild( window ); + window->SetAttribute("name", w.name.c_str()); + window->SetAttribute("x", w.x); + window->SetAttribute("y", w.y); + window->SetAttribute("w", w.w); + window->SetAttribute("h", w.h); + } + } + + // block: connection + { + TiXmlElement * cxn = new TiXmlElement( "Connection" ); + root->LinkEndChild( cxn ); + cxn->SetAttribute("ip", m_connection.ip.c_str()); + cxn->SetDoubleAttribute("timeout", m_connection.timeout); + } + + doc.SaveFile(pFilename); +} +</pre></div><p> +Running this with the modified main produces this file:<p> +<div class="fragment"><pre class="fragment"><?xml version="1.0" ?> +<HitchHikerApp> + <!-- Settings for HitchHikerApp --> + <Messages> + <Farewell>Thanks for all the fish</Farewell> + <Welcome>Don&apos;t Panic</Welcome> + </Messages> + <Windows> + <Window name="BookFrame" x="15" y="25" w="300" h="250" /> + </Windows> + <Connection ip="192.168.0.77" timeout="42.000000" /> +</HitchHikerApp> +</pre></div><p> +<h2>Decoding state from XML </h2> +<p> +As with encoding objects, there are a number of approaches to decoding XML into your own C++ object structure. The following approach uses TiXmlHandles.<p> +<div class="fragment"><pre class="fragment">void AppSettings::load(const char* pFilename) +{ + TiXmlDocument doc(pFilename); + if (!doc.LoadFile()) return; + + TiXmlHandle hDoc(&doc); + TiXmlElement* pElem; + TiXmlHandle hRoot(0); + + // block: name + { + pElem=hDoc.FirstChildElement().Element(); + // should always have a valid root but handle gracefully if it does + if (!pElem) return; + m_name=pElem->Value(); + + // save this for later + hRoot=TiXmlHandle(pElem); + } + + // block: string table + { + m_messages.clear(); // trash existing table + + pElem=hRoot.FirstChild( "Messages" ).FirstChild().Element(); + for( pElem; pElem; pElem=pElem->NextSiblingElement()) + { + const char *pKey=pElem->Value(); + const char *pText=pElem->GetText(); + if (pKey && pText) + { + m_messages[pKey]=pText; + } + } + } + + // block: windows + { + m_windows.clear(); // trash existing list + + TiXmlElement* pWindowNode=hRoot.FirstChild( "Windows" ).FirstChild().Element(); + for( pWindowNode; pWindowNode; pWindowNode=pWindowNode->NextSiblingElement()) + { + WindowSettings w; + const char *pName=pWindowNode->Attribute("name"); + if (pName) w.name=pName; + + pWindowNode->QueryIntAttribute("x", &w.x); // If this fails, original value is left as-is + pWindowNode->QueryIntAttribute("y", &w.y); + pWindowNode->QueryIntAttribute("w", &w.w); + pWindowNode->QueryIntAttribute("hh", &w.h); + + m_windows.push_back(w); + } + } + + // block: connection + { + pElem=hRoot.FirstChild("Connection").Element(); + if (pElem) + { + m_connection.ip=pElem->Attribute("ip"); + pElem->QueryDoubleAttribute("timeout",&m_connection.timeout); + } + } +} +</pre></div><p> +<h1>Full listing for dump_to_stdout </h1> +<p> +Below is a copy-and-paste demo program for loading arbitrary XML files and dumping the structure to STDOUT using the recursive traversal listed above.<p> +<div class="fragment"><pre class="fragment">// tutorial demo program +#include "stdafx.h" +#include "tinyxml.h" + +// ---------------------------------------------------------------------- +// STDOUT dump and indenting utility functions +// ---------------------------------------------------------------------- +const unsigned int NUM_INDENTS_PER_SPACE=2; + +const char * getIndent( unsigned int numIndents ) +{ + static const char * pINDENT=" + "; + static const unsigned int LENGTH=strlen( pINDENT ); + unsigned int n=numIndents*NUM_INDENTS_PER_SPACE; + if ( n > LENGTH ) n = LENGTH; + + return &pINDENT[ LENGTH-n ]; +} + +// same as getIndent but no "+" at the end +const char * getIndentAlt( unsigned int numIndents ) +{ + static const char * pINDENT=" "; + static const unsigned int LENGTH=strlen( pINDENT ); + unsigned int n=numIndents*NUM_INDENTS_PER_SPACE; + if ( n > LENGTH ) n = LENGTH; + + return &pINDENT[ LENGTH-n ]; +} + +int dump_attribs_to_stdout(TiXmlElement* pElement, unsigned int indent) +{ + if ( !pElement ) return 0; + + TiXmlAttribute* pAttrib=pElement->FirstAttribute(); + int i=0; + int ival; + double dval; + const char* pIndent=getIndent(indent); + printf("\n"); + while (pAttrib) + { + printf( "%s%s: value=[%s]", pIndent, pAttrib->Name(), pAttrib->Value()); + + if (pAttrib->QueryIntValue(&ival)==TIXML_SUCCESS) printf( " int=%d", ival); + if (pAttrib->QueryDoubleValue(&dval)==TIXML_SUCCESS) printf( " d=%1.1f", dval); + printf( "\n" ); + i++; + pAttrib=pAttrib->Next(); + } + return i; +} + +void dump_to_stdout( TiXmlNode* pParent, unsigned int indent = 0 ) +{ + if ( !pParent ) return; + + TiXmlNode* pChild; + TiXmlText* pText; + int t = pParent->Type(); + printf( "%s", getIndent(indent)); + int num; + + switch ( t ) + { + case TiXmlNode::DOCUMENT: + printf( "Document" ); + break; + + case TiXmlNode::ELEMENT: + printf( "Element [%s]", pParent->Value() ); + num=dump_attribs_to_stdout(pParent->ToElement(), indent+1); + switch(num) + { + case 0: printf( " (No attributes)"); break; + case 1: printf( "%s1 attribute", getIndentAlt(indent)); break; + default: printf( "%s%d attributes", getIndentAlt(indent), num); break; + } + break; + + case TiXmlNode::COMMENT: + printf( "Comment: [%s]", pParent->Value()); + break; + + case TiXmlNode::UNKNOWN: + printf( "Unknown" ); + break; + + case TiXmlNode::TEXT: + pText = pParent->ToText(); + printf( "Text: [%s]", pText->Value() ); + break; + + case TiXmlNode::DECLARATION: + printf( "Declaration" ); + break; + default: + break; + } + printf( "\n" ); + for ( pChild = pParent->FirstChild(); pChild != 0; pChild = pChild->NextSibling()) + { + dump_to_stdout( pChild, indent+1 ); + } +} + +// load the named file and dump its structure to STDOUT +void dump_to_stdout(const char* pFilename) +{ + TiXmlDocument doc(pFilename); + bool loadOkay = doc.LoadFile(); + if (loadOkay) + { + printf("\n%s:\n", pFilename); + dump_to_stdout( &doc ); // defined later in the tutorial + } + else + { + printf("Failed to load file \"%s\"\n", pFilename); + } +} + +// ---------------------------------------------------------------------- +// main() for printing files named on the command line +// ---------------------------------------------------------------------- +int main(int argc, char* argv[]) +{ + for (int i=1; i<argc; i++) + { + dump_to_stdout(argv[i]); + } + return 0; +} +</pre></div><p> +Run this from the command line or a DOS window, e.g.:<p> +<div class="fragment"><pre class="fragment">C:\dev\tinyxml> Debug\tinyxml_1.exe example1.xml + +example1.xml: +Document ++ Declaration ++ Element [Hello] + (No attributes) + + Text: [World] +</pre></div><p> +<em> Authors and Changes <ul> +<li> +Written by Ellers, April, May, June 2005 </li> +<li> +Minor edits and integration into doc system, Lee Thomason September 2005 </li> +<li> +Updated by Ellers, October 2005 </li> +</ul> +</em> <hr size="1"><address style="align: right;"><small>Generated on Sun May 6 15:41:23 2007 for TinyXml by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> +</body> +</html> diff --git a/shared/tinyxml/echo.dsp b/shared/tinyxml/echo.dsp new file mode 100644 index 00000000..d81db12e --- /dev/null +++ b/shared/tinyxml/echo.dsp @@ -0,0 +1,113 @@ +# Microsoft Developer Studio Project File - Name="echo" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=echo - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "echo.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "echo.mak" CFG="echo - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "echo - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "echo - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "echo - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "echoRelease" +# PROP Intermediate_Dir "echoRelease" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TIXML_USE_STL" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "echo - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "echo___Win32_Debug" +# PROP BASE Intermediate_Dir "echo___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "echoDebug" +# PROP Intermediate_Dir "echoDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TIXML_USE_STL" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "echo - Win32 Release" +# Name "echo - Win32 Debug" +# Begin Source File + +SOURCE=.\xmltester\bugtest.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinystr.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinystr.h +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.h +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlerror.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlparser.cpp +# End Source File +# End Target +# End Project diff --git a/shared/tinyxml/readme.txt b/shared/tinyxml/readme.txt new file mode 100644 index 00000000..14ec3d2e --- /dev/null +++ b/shared/tinyxml/readme.txt @@ -0,0 +1,530 @@ +/** @mainpage + +<h1> TinyXML </h1> + +TinyXML is a simple, small, C++ XML parser that can be easily +integrated into other programs. + +<h2> What it does. </h2> + +In brief, TinyXML parses an XML document, and builds from that a +Document Object Model (DOM) that can be read, modified, and saved. + +XML stands for "eXtensible Markup Language." It allows you to create +your own document markups. Where HTML does a very good job of marking +documents for browsers, XML allows you to define any kind of document +markup, for example a document that describes a "to do" list for an +organizer application. XML is a very structured and convenient format. +All those random file formats created to store application data can +all be replaced with XML. One parser for everything. + +The best place for the complete, correct, and quite frankly hard to +read spec is at <a href="http://www.w3.org/TR/2004/REC-xml-20040204/"> +http://www.w3.org/TR/2004/REC-xml-20040204/</a>. An intro to XML +(that I really like) can be found at +<a href="http://skew.org/xml/tutorial/">http://skew.org/xml/tutorial</a>. + +There are different ways to access and interact with XML data. +TinyXML uses a Document Object Model (DOM), meaning the XML data is parsed +into a C++ objects that can be browsed and manipulated, and then +written to disk or another output stream. You can also construct an XML document +from scratch with C++ objects and write this to disk or another output +stream. + +TinyXML is designed to be easy and fast to learn. It is two headers +and four cpp files. Simply add these to your project and off you go. +There is an example file - xmltest.cpp - to get you started. + +TinyXML is released under the ZLib license, +so you can use it in open source or commercial code. The details +of the license are at the top of every source file. + +TinyXML attempts to be a flexible parser, but with truly correct and +compliant XML output. TinyXML should compile on any reasonably C++ +compliant system. It does not rely on exceptions or RTTI. It can be +compiled with or without STL support. TinyXML fully supports +the UTF-8 encoding, and the first 64k character entities. + + +<h2> What it doesn't do. </h2> + +TinyXML doesn't parse or use DTDs (Document Type Definitions) or XSLs +(eXtensible Stylesheet Language.) There are other parsers out there +(check out www.sourceforge.org, search for XML) that are much more fully +featured. But they are also much bigger, take longer to set up in +your project, have a higher learning curve, and often have a more +restrictive license. If you are working with browsers or have more +complete XML needs, TinyXML is not the parser for you. + +The following DTD syntax will not parse at this time in TinyXML: + +@verbatim + <!DOCTYPE Archiv [ + <!ELEMENT Comment (#PCDATA)> + ]> +@endverbatim + +because TinyXML sees this as a !DOCTYPE node with an illegally +embedded !ELEMENT node. This may be addressed in the future. + +<h2> Tutorials. </h2> + +For the impatient, here is a tutorial to get you going. A great way to get started, +but it is worth your time to read this (very short) manual completely. + +- @subpage tutorial0 + +<h2> Code Status. </h2> + +TinyXML is mature, tested code. It is very stable. If you find +bugs, please file a bug report on the sourceforge web site +(www.sourceforge.net/projects/tinyxml). We'll get them straightened +out as soon as possible. + +There are some areas of improvement; please check sourceforge if you are +interested in working on TinyXML. + +<h2> Related Projects </h2> + +TinyXML projects you may find useful! (Descriptions provided by the projects.) + +<ul> +<li> <b>TinyXPath</b> (http://tinyxpath.sourceforge.net). TinyXPath is a small footprint + XPath syntax decoder, written in C++.</li> +<li> <b>TinyXML++</b> (http://code.google.com/p/ticpp/). TinyXML++ is a completely new + interface to TinyXML that uses MANY of the C++ strengths. Templates, + exceptions, and much better error handling.</li> +</ul> + +<h2> Features </h2> + +<h3> Using STL </h3> + +TinyXML can be compiled to use or not use STL. When using STL, TinyXML +uses the std::string class, and fully supports std::istream, std::ostream, +operator<<, and operator>>. Many API methods have both 'const char*' and +'const std::string&' forms. + +When STL support is compiled out, no STL files are included whatsoever. All +the string classes are implemented by TinyXML itself. API methods +all use the 'const char*' form for input. + +Use the compile time #define: + + TIXML_USE_STL + +to compile one version or the other. This can be passed by the compiler, +or set as the first line of "tinyxml.h". + +Note: If compiling the test code in Linux, setting the environment +variable TINYXML_USE_STL=YES/NO will control STL compilation. In the +Windows project file, STL and non STL targets are provided. In your project, +It's probably easiest to add the line "#define TIXML_USE_STL" as the first +line of tinyxml.h. + +<h3> UTF-8 </h3> + +TinyXML supports UTF-8 allowing to manipulate XML files in any language. TinyXML +also supports "legacy mode" - the encoding used before UTF-8 support and +probably best described as "extended ascii". + +Normally, TinyXML will try to detect the correct encoding and use it. However, +by setting the value of TIXML_DEFAULT_ENCODING in the header file, TinyXML +can be forced to always use one encoding. + +TinyXML will assume Legacy Mode until one of the following occurs: +<ol> + <li> If the non-standard but common "UTF-8 lead bytes" (0xef 0xbb 0xbf) + begin the file or data stream, TinyXML will read it as UTF-8. </li> + <li> If the declaration tag is read, and it has an encoding="UTF-8", then + TinyXML will read it as UTF-8. </li> + <li> If the declaration tag is read, and it has no encoding specified, then TinyXML will + read it as UTF-8. </li> + <li> If the declaration tag is read, and it has an encoding="something else", then TinyXML + will read it as Legacy Mode. In legacy mode, TinyXML will work as it did before. It's + not clear what that mode does exactly, but old content should keep working.</li> + <li> Until one of the above criteria is met, TinyXML runs in Legacy Mode.</li> +</ol> + +What happens if the encoding is incorrectly set or detected? TinyXML will try +to read and pass through text seen as improperly encoded. You may get some strange results or +mangled characters. You may want to force TinyXML to the correct mode. + +You may force TinyXML to Legacy Mode by using LoadFile( TIXML_ENCODING_LEGACY ) or +LoadFile( filename, TIXML_ENCODING_LEGACY ). You may force it to use legacy mode all +the time by setting TIXML_DEFAULT_ENCODING = TIXML_ENCODING_LEGACY. Likewise, you may +force it to TIXML_ENCODING_UTF8 with the same technique. + +For English users, using English XML, UTF-8 is the same as low-ASCII. You +don't need to be aware of UTF-8 or change your code in any way. You can think +of UTF-8 as a "superset" of ASCII. + +UTF-8 is not a double byte format - but it is a standard encoding of Unicode! +TinyXML does not use or directly support wchar, TCHAR, or Microsoft's _UNICODE at this time. +It is common to see the term "Unicode" improperly refer to UTF-16, a wide byte encoding +of unicode. This is a source of confusion. + +For "high-ascii" languages - everything not English, pretty much - TinyXML can +handle all languages, at the same time, as long as the XML is encoded +in UTF-8. That can be a little tricky, older programs and operating systems +tend to use the "default" or "traditional" code page. Many apps (and almost all +modern ones) can output UTF-8, but older or stubborn (or just broken) ones +still output text in the default code page. + +For example, Japanese systems traditionally use SHIFT-JIS encoding. +Text encoded as SHIFT-JIS can not be read by TinyXML. +A good text editor can import SHIFT-JIS and then save as UTF-8. + +The <a href="http://skew.org/xml/tutorial/">Skew.org link</a> does a great +job covering the encoding issue. + +The test file "utf8test.xml" is an XML containing English, Spanish, Russian, +and Simplified Chinese. (Hopefully they are translated correctly). The file +"utf8test.gif" is a screen capture of the XML file, rendered in IE. Note that +if you don't have the correct fonts (Simplified Chinese or Russian) on your +system, you won't see output that matches the GIF file even if you can parse +it correctly. Also note that (at least on my Windows machine) console output +is in a Western code page, so that Print() or printf() cannot correctly display +the file. This is not a bug in TinyXML - just an OS issue. No data is lost or +destroyed by TinyXML. The console just doesn't render UTF-8. + + +<h3> Entities </h3> +TinyXML recognizes the pre-defined "character entities", meaning special +characters. Namely: + +@verbatim + & & + < < + > > + " " + ' ' +@endverbatim + +These are recognized when the XML document is read, and translated to there +UTF-8 equivalents. For instance, text with the XML of: + +@verbatim + Far & Away +@endverbatim + +will have the Value() of "Far & Away" when queried from the TiXmlText object, +and will be written back to the XML stream/file as an ampersand. Older versions +of TinyXML "preserved" character entities, but the newer versions will translate +them into characters. + +Additionally, any character can be specified by its Unicode code point: +The syntax " " or " " are both to the non-breaking space characher. + +<h3> Printing </h3> +TinyXML can print output in several different ways that all have strengths and limitations. + +- Print( FILE* ). Output to a std-C stream, which includes all C files as well as stdout. + - "Pretty prints", but you don't have control over printing options. + - The output is streamed directly to the FILE object, so there is no memory overhead + in the TinyXML code. + - used by Print() and SaveFile() + +- operator<<. Output to a c++ stream. + - Integrates with standart C++ iostreams. + - Outputs in "network printing" mode without line breaks. Good for network transmission + and moving XML between C++ objects, but hard for a human to read. + +- TiXmlPrinter. Output to a std::string or memory buffer. + - API is less concise + - Future printing options will be put here. + - Printing may change slightly in future versions as it is refined and expanded. + +<h3> Streams </h3> +With TIXML_USE_STL on TinyXML supports C++ streams (operator <<,>>) streams as well +as C (FILE*) streams. There are some differences that you may need to be aware of. + +C style output: + - based on FILE* + - the Print() and SaveFile() methods + + Generates formatted output, with plenty of white space, intended to be as + human-readable as possible. They are very fast, and tolerant of ill formed + XML documents. For example, an XML document that contains 2 root elements + and 2 declarations, will still print. + +C style input: + - based on FILE* + - the Parse() and LoadFile() methods + + A fast, tolerant read. Use whenever you don't need the C++ streams. + +C++ style output: + - based on std::ostream + - operator<< + + Generates condensed output, intended for network transmission rather than + readability. Depending on your system's implementation of the ostream class, + these may be somewhat slower. (Or may not.) Not tolerant of ill formed XML: + a document should contain the correct one root element. Additional root level + elements will not be streamed out. + +C++ style input: + - based on std::istream + - operator>> + + Reads XML from a stream, making it useful for network transmission. The tricky + part is knowing when the XML document is complete, since there will almost + certainly be other data in the stream. TinyXML will assume the XML data is + complete after it reads the root element. Put another way, documents that + are ill-constructed with more than one root element will not read correctly. + Also note that operator>> is somewhat slower than Parse, due to both + implementation of the STL and limitations of TinyXML. + +<h3> White space </h3> +The world simply does not agree on whether white space should be kept, or condensed. +For example, pretend the '_' is a space, and look at "Hello____world". HTML, and +at least some XML parsers, will interpret this as "Hello_world". They condense white +space. Some XML parsers do not, and will leave it as "Hello____world". (Remember +to keep pretending the _ is a space.) Others suggest that __Hello___world__ should become +Hello___world. + +It's an issue that hasn't been resolved to my satisfaction. TinyXML supports the +first 2 approaches. Call TiXmlBase::SetCondenseWhiteSpace( bool ) to set the desired behavior. +The default is to condense white space. + +If you change the default, you should call TiXmlBase::SetCondenseWhiteSpace( bool ) +before making any calls to Parse XML data, and I don't recommend changing it after +it has been set. + + +<h3> Handles </h3> + +Where browsing an XML document in a robust way, it is important to check +for null returns from method calls. An error safe implementation can +generate a lot of code like: + +@verbatim +TiXmlElement* root = document.FirstChildElement( "Document" ); +if ( root ) +{ + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. +@endverbatim + +Handles have been introduced to clean this up. Using the TiXmlHandle class, +the previous code reduces to: + +@verbatim +TiXmlHandle docHandle( &document ); +TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); +if ( child2 ) +{ + // do something useful +@endverbatim + +Which is much easier to deal with. See TiXmlHandle for more information. + + +<h3> Row and Column tracking </h3> +Being able to track nodes and attributes back to their origin location +in source files can be very important for some applications. Additionally, +knowing where parsing errors occured in the original source can be very +time saving. + +TinyXML can tracks the row and column origin of all nodes and attributes +in a text file. The TiXmlBase::Row() and TiXmlBase::Column() methods return +the origin of the node in the source text. The correct tabs can be +configured in TiXmlDocument::SetTabSize(). + + +<h2> Using and Installing </h2> + +To Compile and Run xmltest: + +A Linux Makefile and a Windows Visual C++ .dsw file is provided. +Simply compile and run. It will write the file demotest.xml to your +disk and generate output on the screen. It also tests walking the +DOM by printing out the number of nodes found using different +techniques. + +The Linux makefile is very generic and runs on many systems - it +is currently tested on mingw and +MacOSX. You do not need to run 'make depend'. The dependecies have been +hard coded. + +<h3>Windows project file for VC6</h3> +<ul> +<li>tinyxml: tinyxml library, non-STL </li> +<li>tinyxmlSTL: tinyxml library, STL </li> +<li>tinyXmlTest: test app, non-STL </li> +<li>tinyXmlTestSTL: test app, STL </li> +</ul> + +<h3>Makefile</h3> +At the top of the makefile you can set: + +PROFILE, DEBUG, and TINYXML_USE_STL. Details (such that they are) are in +the makefile. + +In the tinyxml directory, type "make clean" then "make". The executable +file 'xmltest' will be created. + + + +<h3>To Use in an Application:</h3> + +Add tinyxml.cpp, tinyxml.h, tinyxmlerror.cpp, tinyxmlparser.cpp, tinystr.cpp, and tinystr.h to your +project or make file. That's it! It should compile on any reasonably +compliant C++ system. You do not need to enable exceptions or +RTTI for TinyXML. + + +<h2> How TinyXML works. </h2> + +An example is probably the best way to go. Take: +@verbatim + <?xml version="1.0" standalone=no> + <!-- Our to do list data --> + <ToDo> + <Item priority="1"> Go to the <bold>Toy store!</bold></Item> + <Item priority="2"> Do bills</Item> + </ToDo> +@endverbatim + +Its not much of a To Do list, but it will do. To read this file +(say "demo.xml") you would create a document, and parse it in: +@verbatim + TiXmlDocument doc( "demo.xml" ); + doc.LoadFile(); +@endverbatim + +And its ready to go. Now lets look at some lines and how they +relate to the DOM. + +@verbatim +<?xml version="1.0" standalone=no> +@endverbatim + + The first line is a declaration, and gets turned into the + TiXmlDeclaration class. It will be the first child of the + document node. + + This is the only directive/special tag parsed by by TinyXML. + Generally directive tags are stored in TiXmlUnknown so the + commands wont be lost when it is saved back to disk. + +@verbatim +<!-- Our to do list data --> +@endverbatim + + A comment. Will become a TiXmlComment object. + +@verbatim +<ToDo> +@endverbatim + + The "ToDo" tag defines a TiXmlElement object. This one does not have + any attributes, but does contain 2 other elements. + +@verbatim +<Item priority="1"> +@endverbatim + + Creates another TiXmlElement which is a child of the "ToDo" element. + This element has 1 attribute, with the name "priority" and the value + "1". + +@verbatim +Go to the +@endverbatim + + A TiXmlText. This is a leaf node and cannot contain other nodes. + It is a child of the "Item" TiXmlElement. + +@verbatim +<bold> +@endverbatim + + + Another TiXmlElement, this one a child of the "Item" element. + +Etc. + +Looking at the entire object tree, you end up with: +@verbatim +TiXmlDocument "demo.xml" + TiXmlDeclaration "version='1.0'" "standalone=no" + TiXmlComment " Our to do list data" + TiXmlElement "ToDo" + TiXmlElement "Item" Attribtutes: priority = 1 + TiXmlText "Go to the " + TiXmlElement "bold" + TiXmlText "Toy store!" + TiXmlElement "Item" Attributes: priority=2 + TiXmlText "Do bills" +@endverbatim + +<h2> Documentation </h2> + +The documentation is build with Doxygen, using the 'dox' +configuration file. + +<h2> License </h2> + +TinyXML is released under the zlib license: + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. + +<h2> References </h2> + +The World Wide Web Consortium is the definitive standard body for +XML, and there web pages contain huge amounts of information. + +The definitive spec: <a href="http://www.w3.org/TR/2004/REC-xml-20040204/"> +http://www.w3.org/TR/2004/REC-xml-20040204/</a> + +I also recommend "XML Pocket Reference" by Robert Eckstein and published by +OReilly...the book that got the whole thing started. + +<h2> Contributors, Contacts, and a Brief History </h2> + +Thanks very much to everyone who sends suggestions, bugs, ideas, and +encouragement. It all helps, and makes this project fun. A special thanks +to the contributors on the web pages that keep it lively. + +So many people have sent in bugs and ideas, that rather than list here +we try to give credit due in the "changes.txt" file. + +TinyXML was originally written by Lee Thomason. (Often the "I" still +in the documentation.) Lee reviews changes and releases new versions, +with the help of Yves Berquin, Andrew Ellerton, and the tinyXml community. + +We appreciate your suggestions, and would love to know if you +use TinyXML. Hopefully you will enjoy it and find it useful. +Please post questions, comments, file bugs, or contact us at: + +www.sourceforge.net/projects/tinyxml + +Lee Thomason, Yves Berquin, Andrew Ellerton +*/ diff --git a/shared/tinyxml/tinyXmlTest.dsp b/shared/tinyxml/tinyXmlTest.dsp new file mode 100644 index 00000000..bf4baf02 --- /dev/null +++ b/shared/tinyxml/tinyXmlTest.dsp @@ -0,0 +1,92 @@ +# Microsoft Developer Studio Project File - Name="tinyXmlTest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=tinyXmlTest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tinyXmlTest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tinyXmlTest.mak" CFG="tinyXmlTest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tinyXmlTest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "tinyXmlTest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tinyXmlTest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "tinyXmlTest___Win32_Release" +# PROP BASE Intermediate_Dir "tinyXmlTest___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "tinyXmlTest___Win32_Release" +# PROP Intermediate_Dir "tinyXmlTest___Win32_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ./Release/tinyxml.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "tinyXmlTest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "tinyXmlTest___Win32_Debug" +# PROP BASE Intermediate_Dir "tinyXmlTest___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "tinyXmlTest___Win32_Debug" +# PROP Intermediate_Dir "tinyXmlTest___Win32_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TUNE" /FR /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ./Debug/tinyxmld.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "tinyXmlTest - Win32 Release" +# Name "tinyXmlTest - Win32 Debug" +# Begin Source File + +SOURCE=.\xmltest.cpp +# End Source File +# End Target +# End Project diff --git a/shared/tinyxml/tinyXmlTest.vcproj b/shared/tinyxml/tinyXmlTest.vcproj new file mode 100644 index 00000000..f9e5a204 --- /dev/null +++ b/shared/tinyxml/tinyXmlTest.vcproj @@ -0,0 +1,227 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="tinyXmlTest" + ProjectGUID="{34719950-09E8-457E-BE23-8F1CE3A1F1F6}" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\tinyXmlTest___Win32_Debug" + IntermediateDirectory=".\tinyXmlTest___Win32_Debug" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\tinyXmlTest___Win32_Debug/tinyXmlTest.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TUNE;_CRT_SECURE_NO_WARNINGS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\tinyXmlTest___Win32_Debug/tinyXmlTest.pch" + AssemblerListingLocation=".\tinyXmlTest___Win32_Debug/" + ObjectFile=".\tinyXmlTest___Win32_Debug/" + ProgramDataBaseFileName=".\tinyXmlTest___Win32_Debug/" + BrowseInformation="1" + WarningLevel="4" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="./Debug/tinyxmld.lib" + OutputFile=".\tinyXmlTest___Win32_Debug/tinyXmlTest.exe" + LinkIncremental="2" + SuppressStartupBanner="true" + GenerateDebugInformation="true" + ProgramDatabaseFile=".\tinyXmlTest___Win32_Debug/tinyXmlTest.pdb" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\tinyXmlTest___Win32_Debug/tinyXmlTest.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\tinyXmlTest___Win32_Release" + IntermediateDirectory=".\tinyXmlTest___Win32_Release" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\tinyXmlTest___Win32_Release/tinyXmlTest.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\tinyXmlTest___Win32_Release/tinyXmlTest.pch" + AssemblerListingLocation=".\tinyXmlTest___Win32_Release/" + ObjectFile=".\tinyXmlTest___Win32_Release/" + ProgramDataBaseFileName=".\tinyXmlTest___Win32_Release/" + BrowseInformation="1" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="./Release/tinyxml.lib odbc32.lib odbccp32.lib" + OutputFile=".\tinyXmlTest___Win32_Release/tinyXmlTest.exe" + LinkIncremental="1" + SuppressStartupBanner="true" + ProgramDatabaseFile=".\tinyXmlTest___Win32_Release/tinyXmlTest.pdb" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\tinyXmlTest___Win32_Release/tinyXmlTest.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="xmltest.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/shared/tinyxml/tinyXmlTestSTL.dsp b/shared/tinyxml/tinyXmlTestSTL.dsp new file mode 100644 index 00000000..c4b1926e --- /dev/null +++ b/shared/tinyxml/tinyXmlTestSTL.dsp @@ -0,0 +1,92 @@ +# Microsoft Developer Studio Project File - Name="tinyXmlTestSTL" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=tinyXmlTestSTL - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tinyXmlTestSTL.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tinyXmlTestSTL.mak" CFG="tinyXmlTestSTL - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tinyXmlTestSTL - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "tinyXmlTestSTL - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tinyXmlTestSTL - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "tinyXmlTestSTL___Win32_Release" +# PROP BASE Intermediate_Dir "tinyXmlTestSTL___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "tinyXmlTestSTL___Win32_Release" +# PROP Intermediate_Dir "tinyXmlTestSTL___Win32_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TIXML_USE_STL" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 ./Release_STL/tinyxml_stl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "tinyXmlTestSTL - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "tinyXmlTestSTL___Win32_Debug" +# PROP BASE Intermediate_Dir "tinyXmlTestSTL___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "tinyXmlTestSTL___Win32_Debug" +# PROP Intermediate_Dir "tinyXmlTestSTL___Win32_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TIXML_USE_STL" /D "TUNE" /FR /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 ./Debug_STL/tinyxmld_stl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "tinyXmlTestSTL - Win32 Release" +# Name "tinyXmlTestSTL - Win32 Debug" +# Begin Source File + +SOURCE=.\xmltest.cpp +# End Source File +# End Target +# End Project diff --git a/shared/tinyxml/tinyXmlTestSTL.vcproj b/shared/tinyxml/tinyXmlTestSTL.vcproj new file mode 100644 index 00000000..b3203a14 --- /dev/null +++ b/shared/tinyxml/tinyXmlTestSTL.vcproj @@ -0,0 +1,226 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="tinyXmlTestSTL" + ProjectGUID="{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\tinyXmlTestSTL___Win32_Debug" + IntermediateDirectory=".\tinyXmlTestSTL___Win32_Debug" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\tinyXmlTestSTL___Win32_Debug/tinyXmlTestSTL.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TIXML_USE_STL;TUNE;_CRT_SECURE_NO_WARNINGS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\tinyXmlTestSTL___Win32_Debug/tinyXmlTestSTL.pch" + AssemblerListingLocation=".\tinyXmlTestSTL___Win32_Debug/" + ObjectFile=".\tinyXmlTestSTL___Win32_Debug/" + ProgramDataBaseFileName=".\tinyXmlTestSTL___Win32_Debug/" + BrowseInformation="1" + WarningLevel="4" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="./Debug_STL/tinyxmld_stl.lib" + OutputFile=".\tinyXmlTestSTL___Win32_Debug/tinyXmlTestSTL.exe" + LinkIncremental="1" + SuppressStartupBanner="true" + GenerateDebugInformation="true" + ProgramDatabaseFile=".\tinyXmlTestSTL___Win32_Debug/tinyXmlTestSTL.pdb" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\tinyXmlTestSTL___Win32_Debug/tinyXmlTestSTL.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\tinyXmlTestSTL___Win32_Release" + IntermediateDirectory=".\tinyXmlTestSTL___Win32_Release" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TypeLibraryName=".\tinyXmlTestSTL___Win32_Release/tinyXmlTestSTL.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;TIXML_USE_STL;_CRT_SECURE_NO_WARNINGS" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\tinyXmlTestSTL___Win32_Release/tinyXmlTestSTL.pch" + AssemblerListingLocation=".\tinyXmlTestSTL___Win32_Release/" + ObjectFile=".\tinyXmlTestSTL___Win32_Release/" + ProgramDataBaseFileName=".\tinyXmlTestSTL___Win32_Release/" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="./Release_STL/tinyxml_stl.lib odbc32.lib odbccp32.lib" + OutputFile=".\tinyXmlTestSTL___Win32_Release/tinyXmlTestSTL.exe" + LinkIncremental="1" + SuppressStartupBanner="true" + ProgramDatabaseFile=".\tinyXmlTestSTL___Win32_Release/tinyXmlTestSTL.pdb" + SubSystem="1" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\tinyXmlTestSTL___Win32_Release/tinyXmlTestSTL.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="xmltest.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/shared/tinyxml/tinystr.cpp b/shared/tinyxml/tinystr.cpp new file mode 100644 index 00000000..2b9b5467 --- /dev/null +++ b/shared/tinyxml/tinystr.cpp @@ -0,0 +1,116 @@ +/* +www.sourceforge.net/projects/tinyxml +Original file by Yves Berquin. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +/* + * THIS FILE WAS ALTERED BY Tyge Løvset, 7. April 2005. + */ + + +#ifndef TIXML_USE_STL + +#include "tinystr.h" + +// Error value for find primitive +const TiXmlString::size_type TiXmlString::npos = static_cast< TiXmlString::size_type >(-1); + + +// Null rep. +TiXmlString::Rep TiXmlString::nullrep_ = { 0, 0, { '\0' } }; + + +void TiXmlString::reserve (size_type cap) +{ + if (cap > capacity()) + { + TiXmlString tmp; + tmp.init(length(), cap); + memcpy(tmp.start(), data(), length()); + swap(tmp); + } +} + + +TiXmlString& TiXmlString::assign(const char* str, size_type len) +{ + size_type cap = capacity(); + if (len > cap || cap > 3*(len + 8)) + { + TiXmlString tmp; + tmp.init(len); + memcpy(tmp.start(), str, len); + swap(tmp); + } + else + { + memmove(start(), str, len); + set_size(len); + } + return *this; +} + + +TiXmlString& TiXmlString::append(const char* str, size_type len) +{ + size_type newsize = length() + len; + if (newsize > capacity()) + { + reserve (newsize + capacity()); + } + memmove(finish(), str, len); + set_size(newsize); + return *this; +} + + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b) +{ + TiXmlString tmp; + tmp.reserve(a.length() + b.length()); + tmp += a; + tmp += b; + return tmp; +} + +TiXmlString operator + (const TiXmlString & a, const char* b) +{ + TiXmlString tmp; + TiXmlString::size_type b_len = static_cast<TiXmlString::size_type>( strlen(b) ); + tmp.reserve(a.length() + b_len); + tmp += a; + tmp.append(b, b_len); + return tmp; +} + +TiXmlString operator + (const char* a, const TiXmlString & b) +{ + TiXmlString tmp; + TiXmlString::size_type a_len = static_cast<TiXmlString::size_type>( strlen(a) ); + tmp.reserve(a_len + b.length()); + tmp.append(a, a_len); + tmp += b; + return tmp; +} + + +#endif // TIXML_USE_STL diff --git a/shared/tinyxml/tinystr.h b/shared/tinyxml/tinystr.h new file mode 100644 index 00000000..3c2aa9d5 --- /dev/null +++ b/shared/tinyxml/tinystr.h @@ -0,0 +1,319 @@ +/* +www.sourceforge.net/projects/tinyxml +Original file by Yves Berquin. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +/* + * THIS FILE WAS ALTERED BY Tyge Lovset, 7. April 2005. + * + * - completely rewritten. compact, clean, and fast implementation. + * - sizeof(TiXmlString) = pointer size (4 bytes on 32-bit systems) + * - fixed reserve() to work as per specification. + * - fixed buggy compares operator==(), operator<(), and operator>() + * - fixed operator+=() to take a const ref argument, following spec. + * - added "copy" constructor with length, and most compare operators. + * - added swap(), clear(), size(), capacity(), operator+(). + */ + +#ifndef TIXML_USE_STL + +#ifndef TIXML_STRING_INCLUDED +#define TIXML_STRING_INCLUDED + +#include <assert.h> +#include <string.h> + +/* The support for explicit isn't that universal, and it isn't really + required - it is used to check that the TiXmlString class isn't incorrectly + used. Be nice to old compilers and macro it here: +*/ +#if defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + #define TIXML_EXPLICIT explicit +#elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + #define TIXML_EXPLICIT explicit +#else + #define TIXML_EXPLICIT +#endif + + +/* + TiXmlString is an emulation of a subset of the std::string template. + Its purpose is to allow compiling TinyXML on compilers with no or poor STL support. + Only the member functions relevant to the TinyXML project have been implemented. + The buffer allocation is made by a simplistic power of 2 like mechanism : if we increase + a string and there's no more room, we allocate a buffer twice as big as we need. +*/ +class TiXmlString +{ + public : + // The size type used + typedef size_t size_type; + + // Error value for find primitive + static const size_type npos; // = -1; + + + // TiXmlString empty constructor + TiXmlString () : rep_(&nullrep_) + { + } + + // TiXmlString copy constructor + TiXmlString ( const TiXmlString & copy) : rep_(0) + { + init(copy.length()); + memcpy(start(), copy.data(), length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * copy) : rep_(0) + { + init( static_cast<size_type>( strlen(copy) )); + memcpy(start(), copy, length()); + } + + // TiXmlString constructor, based on a string + TIXML_EXPLICIT TiXmlString ( const char * str, size_type len) : rep_(0) + { + init(len); + memcpy(start(), str, len); + } + + // TiXmlString destructor + ~TiXmlString () + { + quit(); + } + + // = operator + TiXmlString& operator = (const char * copy) + { + return assign( copy, (size_type)strlen(copy)); + } + + // = operator + TiXmlString& operator = (const TiXmlString & copy) + { + return assign(copy.start(), copy.length()); + } + + + // += operator. Maps to append + TiXmlString& operator += (const char * suffix) + { + return append(suffix, static_cast<size_type>( strlen(suffix) )); + } + + // += operator. Maps to append + TiXmlString& operator += (char single) + { + return append(&single, 1); + } + + // += operator. Maps to append + TiXmlString& operator += (const TiXmlString & suffix) + { + return append(suffix.data(), suffix.length()); + } + + + // Convert a TiXmlString into a null-terminated char * + const char * c_str () const { return rep_->str; } + + // Convert a TiXmlString into a char * (need not be null terminated). + const char * data () const { return rep_->str; } + + // Return the length of a TiXmlString + size_type length () const { return rep_->size; } + + // Alias for length() + size_type size () const { return rep_->size; } + + // Checks if a TiXmlString is empty + bool empty () const { return rep_->size == 0; } + + // Return capacity of string + size_type capacity () const { return rep_->capacity; } + + + // single char extraction + const char& at (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // [] operator + char& operator [] (size_type index) const + { + assert( index < length() ); + return rep_->str[ index ]; + } + + // find a char in a string. Return TiXmlString::npos if not found + size_type find (char lookup) const + { + return find(lookup, 0); + } + + // find a char in a string from an offset. Return TiXmlString::npos if not found + size_type find (char tofind, size_type offset) const + { + if (offset >= length()) return npos; + + for (const char* p = c_str() + offset; *p != '\0'; ++p) + { + if (*p == tofind) return static_cast< size_type >( p - c_str() ); + } + return npos; + } + + void clear () + { + //Lee: + //The original was just too strange, though correct: + // TiXmlString().swap(*this); + //Instead use the quit & re-init: + quit(); + init(0,0); + } + + /* Function to reserve a big amount of data when we know we'll need it. Be aware that this + function DOES NOT clear the content of the TiXmlString if any exists. + */ + void reserve (size_type cap); + + TiXmlString& assign (const char* str, size_type len); + + TiXmlString& append (const char* str, size_type len); + + void swap (TiXmlString& other) + { + Rep* r = rep_; + rep_ = other.rep_; + other.rep_ = r; + } + + private: + + void init(size_type sz) { init(sz, sz); } + void set_size(size_type sz) { rep_->str[ rep_->size = sz ] = '\0'; } + char* start() const { return rep_->str; } + char* finish() const { return rep_->str + rep_->size; } + + struct Rep + { + size_type size, capacity; + char str[1]; + }; + + void init(size_type sz, size_type cap) + { + if (cap) + { + // Lee: the original form: + // rep_ = static_cast<Rep*>(operator new(sizeof(Rep) + cap)); + // doesn't work in some cases of new being overloaded. Switching + // to the normal allocation, although use an 'int' for systems + // that are overly picky about structure alignment. + const size_type bytesNeeded = sizeof(Rep) + cap; + const size_type intsNeeded = ( bytesNeeded + sizeof(int) - 1 ) / sizeof( int ); + rep_ = reinterpret_cast<Rep*>( new int[ intsNeeded ] ); + + rep_->str[ rep_->size = sz ] = '\0'; + rep_->capacity = cap; + } + else + { + rep_ = &nullrep_; + } + } + + void quit() + { + if (rep_ != &nullrep_) + { + // The rep_ is really an array of ints. (see the allocator, above). + // Cast it back before delete, so the compiler won't incorrectly call destructors. + delete [] ( reinterpret_cast<int*>( rep_ ) ); + } + } + + Rep * rep_; + static Rep nullrep_; + +} ; + + +inline bool operator == (const TiXmlString & a, const TiXmlString & b) +{ + return ( a.length() == b.length() ) // optimization on some platforms + && ( strcmp(a.c_str(), b.c_str()) == 0 ); // actual compare +} +inline bool operator < (const TiXmlString & a, const TiXmlString & b) +{ + return strcmp(a.c_str(), b.c_str()) < 0; +} + +inline bool operator != (const TiXmlString & a, const TiXmlString & b) { return !(a == b); } +inline bool operator > (const TiXmlString & a, const TiXmlString & b) { return b < a; } +inline bool operator <= (const TiXmlString & a, const TiXmlString & b) { return !(b < a); } +inline bool operator >= (const TiXmlString & a, const TiXmlString & b) { return !(a < b); } + +inline bool operator == (const TiXmlString & a, const char* b) { return strcmp(a.c_str(), b) == 0; } +inline bool operator == (const char* a, const TiXmlString & b) { return b == a; } +inline bool operator != (const TiXmlString & a, const char* b) { return !(a == b); } +inline bool operator != (const char* a, const TiXmlString & b) { return !(b == a); } + +TiXmlString operator + (const TiXmlString & a, const TiXmlString & b); +TiXmlString operator + (const TiXmlString & a, const char* b); +TiXmlString operator + (const char* a, const TiXmlString & b); + + +/* + TiXmlOutStream is an emulation of std::ostream. It is based on TiXmlString. + Only the operators that we need for TinyXML have been developped. +*/ +class TiXmlOutStream : public TiXmlString +{ +public : + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const TiXmlString & in) + { + *this += in; + return *this; + } + + // TiXmlOutStream << operator. + TiXmlOutStream & operator << (const char * in) + { + *this += in; + return *this; + } + +} ; + +#endif // TIXML_STRING_INCLUDED +#endif // TIXML_USE_STL diff --git a/shared/tinyxml/tinyxml.cpp b/shared/tinyxml/tinyxml.cpp new file mode 100644 index 00000000..aa13deec --- /dev/null +++ b/shared/tinyxml/tinyxml.cpp @@ -0,0 +1,1942 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include <ctype.h> + +#ifdef TIXML_USE_STL +#include <sstream> +#include <iostream> +#endif + +#include "tinyxml.h" + + +bool TiXmlBase::condenseWhiteSpace = true; + +// Microsoft compiler security +FILE* TiXmlFOpen( const char* filename, const char* mode ) +{ +#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) + FILE* fp = 0; + errno_t err = fopen_s( &fp, filename, mode ); + if ( !err && fp ) + return fp; + return 0; +#else + return fopen( filename, mode ); +#endif +} + +void TiXmlBase::EncodeString( const TIXML_STRING& str, TIXML_STRING* outString ) +{ + int i=0; + + while ( i<(int)str.length() ) + { + unsigned char c = (unsigned char) str[i]; + + if ( c == '&' + && i < ( (int)str.length() - 2 ) + && str[i+1] == '#' + && str[i+2] == 'x' ) + { + // Hexadecimal character reference. + // Pass through unchanged. + // © -- copyright symbol, for example. + // + // The -1 is a bug fix from Rob Laveaux. It keeps + // an overflow from happening if there is no ';'. + // There are actually 2 ways to exit this loop - + // while fails (error case) and break (semicolon found). + // However, there is no mechanism (currently) for + // this function to return an error. + while ( i<(int)str.length()-1 ) + { + outString->append( str.c_str() + i, 1 ); + ++i; + if ( str[i] == ';' ) + break; + } + } + else if ( c == '&' ) + { + outString->append( entity[0].str, entity[0].strLength ); + ++i; + } + else if ( c == '<' ) + { + outString->append( entity[1].str, entity[1].strLength ); + ++i; + } + else if ( c == '>' ) + { + outString->append( entity[2].str, entity[2].strLength ); + ++i; + } + else if ( c == '\"' ) + { + outString->append( entity[3].str, entity[3].strLength ); + ++i; + } + else if ( c == '\'' ) + { + outString->append( entity[4].str, entity[4].strLength ); + ++i; + } + else if ( c < 32 ) + { + // Easy pass at non-alpha/numeric/symbol + // Below 32 is symbolic. + char buf[ 32 ]; + +#if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) ); +#else + sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) ); +#endif + + //*ME: warning C4267: convert 'size_t' to 'int' + //*ME: Int-Cast to make compiler happy ... + outString->append( buf, (int)strlen( buf ) ); + ++i; + } + else + { + //char realc = (char) c; + //outString->append( &realc, 1 ); + *outString += (char) c; // somewhat more efficient function call. + ++i; + } + } +} + + +TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase() +{ + parent = 0; + type = _type; + firstChild = 0; + lastChild = 0; + prev = 0; + next = 0; +} + + +TiXmlNode::~TiXmlNode() +{ + TiXmlNode* node = firstChild; + TiXmlNode* temp = 0; + + while ( node ) + { + temp = node; + node = node->next; + delete temp; + } +} + + +void TiXmlNode::CopyTo( TiXmlNode* target ) const +{ + target->SetValue (value.c_str() ); + target->userData = userData; +} + + +void TiXmlNode::Clear() +{ + TiXmlNode* node = firstChild; + TiXmlNode* temp = 0; + + while ( node ) + { + temp = node; + node = node->next; + delete temp; + } + + firstChild = 0; + lastChild = 0; +} + + +TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node ) +{ + assert( node->parent == 0 || node->parent == this ); + assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() ); + + if ( node->Type() == TiXmlNode::DOCUMENT ) + { + delete node; + if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + node->parent = this; + + node->prev = lastChild; + node->next = 0; + + if ( lastChild ) + lastChild->next = node; + else + firstChild = node; // it was an empty list. + + lastChild = node; + return node; +} + + +TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis ) +{ + if ( addThis.Type() == TiXmlNode::DOCUMENT ) + { + if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + + return LinkEndChild( node ); +} + + +TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ) +{ + if ( !beforeThis || beforeThis->parent != this ) + { + return 0; + } + if ( addThis.Type() == TiXmlNode::DOCUMENT ) + { + if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + node->parent = this; + + node->next = beforeThis; + node->prev = beforeThis->prev; + if ( beforeThis->prev ) + { + beforeThis->prev->next = node; + } + else + { + assert( firstChild == beforeThis ); + firstChild = node; + } + beforeThis->prev = node; + return node; +} + + +TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ) +{ + if ( !afterThis || afterThis->parent != this ) + { + return 0; + } + if ( addThis.Type() == TiXmlNode::DOCUMENT ) + { + if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + TiXmlNode* node = addThis.Clone(); + if ( !node ) + return 0; + node->parent = this; + + node->prev = afterThis; + node->next = afterThis->next; + if ( afterThis->next ) + { + afterThis->next->prev = node; + } + else + { + assert( lastChild == afterThis ); + lastChild = node; + } + afterThis->next = node; + return node; +} + + +TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ) +{ + if ( replaceThis->parent != this ) + return 0; + + TiXmlNode* node = withThis.Clone(); + if ( !node ) + return 0; + + node->next = replaceThis->next; + node->prev = replaceThis->prev; + + if ( replaceThis->next ) + replaceThis->next->prev = node; + else + lastChild = node; + + if ( replaceThis->prev ) + replaceThis->prev->next = node; + else + firstChild = node; + + delete replaceThis; + node->parent = this; + return node; +} + + +bool TiXmlNode::RemoveChild( TiXmlNode* removeThis ) +{ + if ( removeThis->parent != this ) + { + assert( 0 ); + return false; + } + + if ( removeThis->next ) + removeThis->next->prev = removeThis->prev; + else + lastChild = removeThis->prev; + + if ( removeThis->prev ) + removeThis->prev->next = removeThis->next; + else + firstChild = removeThis->next; + + delete removeThis; + return true; +} + +const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = firstChild; node; node = node->next ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = lastChild; node; node = node->prev ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const +{ + if ( !previous ) + { + return FirstChild(); + } + else + { + assert( previous->parent == this ); + return previous->NextSibling(); + } +} + + +const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const +{ + if ( !previous ) + { + return FirstChild( val ); + } + else + { + assert( previous->parent == this ); + return previous->NextSibling( val ); + } +} + + +const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = next; node; node = node->next ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const +{ + const TiXmlNode* node; + for ( node = prev; node; node = node->prev ) + { + if ( strcmp( node->Value(), _value ) == 0 ) + return node; + } + return 0; +} + + +void TiXmlElement::RemoveAttribute( const char * name ) +{ +#ifdef TIXML_USE_STL + TIXML_STRING str( name ); + TiXmlAttribute* node = attributeSet.Find( str ); +#else + TiXmlAttribute* node = attributeSet.Find( name ); +#endif + if ( node ) + { + attributeSet.Remove( node ); + delete node; + } +} + +const TiXmlElement* TiXmlNode::FirstChildElement() const +{ + const TiXmlNode* node; + + for ( node = FirstChild(); + node; + node = node->NextSibling() ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const +{ + const TiXmlNode* node; + + for ( node = FirstChild( _value ); + node; + node = node->NextSibling( _value ) ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::NextSiblingElement() const +{ + const TiXmlNode* node; + + for ( node = NextSibling(); + node; + node = node->NextSibling() ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const +{ + const TiXmlNode* node; + + for ( node = NextSibling( _value ); + node; + node = node->NextSibling( _value ) ) + { + if ( node->ToElement() ) + return node->ToElement(); + } + return 0; +} + + +const TiXmlDocument* TiXmlNode::GetDocument() const +{ + const TiXmlNode* node; + + for ( node = this; node; node = node->parent ) + { + if ( node->ToDocument() ) + return node->ToDocument(); + } + return 0; +} + + +TiXmlElement::TiXmlElement (const char * _value) + : TiXmlNode( TiXmlNode::ELEMENT ) +{ + firstChild = lastChild = 0; + value = _value; +} + + +#ifdef TIXML_USE_STL +TiXmlElement::TiXmlElement( const std::string& _value ) + : TiXmlNode( TiXmlNode::ELEMENT ) +{ + firstChild = lastChild = 0; + value = _value; +} +#endif + + +TiXmlElement::TiXmlElement( const TiXmlElement& copy) + : TiXmlNode( TiXmlNode::ELEMENT ) +{ + firstChild = lastChild = 0; + copy.CopyTo( this ); +} + + +void TiXmlElement::operator=( const TiXmlElement& base ) +{ + ClearThis(); + base.CopyTo( this ); +} + + +TiXmlElement::~TiXmlElement() +{ + ClearThis(); +} + + +void TiXmlElement::ClearThis() +{ + Clear(); + while ( attributeSet.First() ) + { + TiXmlAttribute* node = attributeSet.First(); + attributeSet.Remove( node ); + delete node; + } +} + + +const char* TiXmlElement::Attribute( const char* name ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( node ) + return node->Value(); + return 0; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( node ) + return &node->ValueStr(); + return 0; +} +#endif + + +const char* TiXmlElement::Attribute( const char* name, int* i ) const +{ + const char* s = Attribute( name ); + if ( i ) + { + if ( s ) + { + *i = atoi( s ); + } + else + { + *i = 0; + } + } + return s; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const +{ + const std::string* s = Attribute( name ); + if ( i ) + { + if ( s ) + { + *i = atoi( s->c_str() ); + } + else + { + *i = 0; + } + } + return s; +} +#endif + + +const char* TiXmlElement::Attribute( const char* name, double* d ) const +{ + const char* s = Attribute( name ); + if ( d ) + { + if ( s ) + { + *d = atof( s ); + } + else + { + *d = 0; + } + } + return s; +} + + +#ifdef TIXML_USE_STL +const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const +{ + const std::string* s = Attribute( name ); + if ( d ) + { + if ( s ) + { + *d = atof( s->c_str() ); + } + else + { + *d = 0; + } + } + return s; +} +#endif + + +int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + return node->QueryIntValue( ival ); +} + + +#ifdef TIXML_USE_STL +int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + return node->QueryIntValue( ival ); +} +#endif + + +int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + return node->QueryDoubleValue( dval ); +} + + +#ifdef TIXML_USE_STL +int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const +{ + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + return node->QueryDoubleValue( dval ); +} +#endif + + +void TiXmlElement::SetAttribute( const char * name, int val ) +{ + char buf[64]; +#if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "%d", val ); +#else + sprintf( buf, "%d", val ); +#endif + SetAttribute( name, buf ); +} + + +#ifdef TIXML_USE_STL +void TiXmlElement::SetAttribute( const std::string& name, int val ) +{ + std::ostringstream oss; + oss << val; + SetAttribute( name, oss.str() ); +} +#endif + + +void TiXmlElement::SetDoubleAttribute( const char * name, double val ) +{ + char buf[256]; +#if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "%f", val ); +#else + sprintf( buf, "%f", val ); +#endif + SetAttribute( name, buf ); +} + + +void TiXmlElement::SetAttribute( const char * cname, const char * cvalue ) +{ +#ifdef TIXML_USE_STL + TIXML_STRING _name( cname ); + TIXML_STRING _value( cvalue ); +#else + const char* _name = cname; + const char* _value = cvalue; +#endif + + TiXmlAttribute* node = attributeSet.Find( _name ); + if ( node ) + { + node->SetValue( _value ); + return; + } + + TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue ); + if ( attrib ) + { + attributeSet.Add( attrib ); + } + else + { + TiXmlDocument* document = GetDocument(); + if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); + } +} + + +#ifdef TIXML_USE_STL +void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value ) +{ + TiXmlAttribute* node = attributeSet.Find( name ); + if ( node ) + { + node->SetValue( _value ); + return; + } + + TiXmlAttribute* attrib = new TiXmlAttribute( name, _value ); + if ( attrib ) + { + attributeSet.Add( attrib ); + } + else + { + TiXmlDocument* document = GetDocument(); + if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); + } +} +#endif + + +void TiXmlElement::Print( FILE* cfile, int depth ) const +{ + int i; + assert( cfile ); + for ( i=0; i<depth; i++ ) + { + fprintf( cfile, " " ); + } + + fprintf( cfile, "<%s", value.c_str() ); + + const TiXmlAttribute* attrib; + for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() ) + { + fprintf( cfile, " " ); + attrib->Print( cfile, depth ); + } + + // There are 3 different formatting approaches: + // 1) An element without children is printed as a <foo /> node + // 2) An element with only a text child is printed as <foo> text </foo> + // 3) An element with children is printed on multiple lines. + TiXmlNode* node; + if ( !firstChild ) + { + fprintf( cfile, " />" ); + } + else if ( firstChild == lastChild && firstChild->ToText() ) + { + fprintf( cfile, ">" ); + firstChild->Print( cfile, depth + 1 ); + fprintf( cfile, "</%s>", value.c_str() ); + } + else + { + fprintf( cfile, ">" ); + + for ( node = firstChild; node; node=node->NextSibling() ) + { + if ( !node->ToText() ) + { + fprintf( cfile, "\n" ); + } + node->Print( cfile, depth+1 ); + } + fprintf( cfile, "\n" ); + for ( i=0; i<depth; ++i ) + { + fprintf( cfile, " " ); + } + fprintf( cfile, "</%s>", value.c_str() ); + } +} + + +void TiXmlElement::CopyTo( TiXmlElement* target ) const +{ + // superclass: + TiXmlNode::CopyTo( target ); + + // Element class: + // Clone the attributes, then clone the children. + const TiXmlAttribute* attribute = 0; + for ( attribute = attributeSet.First(); + attribute; + attribute = attribute->Next() ) + { + target->SetAttribute( attribute->Name(), attribute->Value() ); + } + + TiXmlNode* node = 0; + for ( node = firstChild; node; node = node->NextSibling() ) + { + target->LinkEndChild( node->Clone() ); + } +} + +bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const +{ + if ( visitor->VisitEnter( *this, attributeSet.First() ) ) + { + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + if ( !node->Accept( visitor ) ) + break; + } + } + return visitor->VisitExit( *this ); +} + + +TiXmlNode* TiXmlElement::Clone() const +{ + TiXmlElement* clone = new TiXmlElement( Value() ); + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +const char* TiXmlElement::GetText() const +{ + const TiXmlNode* child = this->FirstChild(); + if ( child ) + { + const TiXmlText* childText = child->ToText(); + if ( childText ) + { + return childText->Value(); + } + } + return 0; +} + + +TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = false; + ClearError(); +} + +TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = false; + value = documentName; + ClearError(); +} + + +#ifdef TIXML_USE_STL +TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT ) +{ + tabsize = 4; + useMicrosoftBOM = false; + value = documentName; + ClearError(); +} +#endif + + +TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT ) +{ + copy.CopyTo( this ); +} + + +void TiXmlDocument::operator=( const TiXmlDocument& copy ) +{ + Clear(); + copy.CopyTo( this ); +} + + +bool TiXmlDocument::LoadFile( TiXmlEncoding encoding ) +{ + // See STL_STRING_BUG below. + //StringToBuffer buf( value ); + + return LoadFile( Value(), encoding ); +} + + +bool TiXmlDocument::SaveFile() const +{ + // See STL_STRING_BUG below. +// StringToBuffer buf( value ); +// +// if ( buf.buffer && SaveFile( buf.buffer ) ) +// return true; +// +// return false; + return SaveFile( Value() ); +} + +bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding ) +{ + // There was a really terrifying little bug here. The code: + // value = filename + // in the STL case, cause the assignment method of the std::string to + // be called. What is strange, is that the std::string had the same + // address as it's c_str() method, and so bad things happen. Looks + // like a bug in the Microsoft STL implementation. + // Add an extra string to avoid the crash. + TIXML_STRING filename( _filename ); + value = filename; + + // reading in binary mode so that tinyxml can normalize the EOL + FILE* file = TiXmlFOpen( value.c_str (), "rb" ); + + if ( file ) + { + bool result = LoadFile( file, encoding ); + fclose( file ); + return result; + } + else + { + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } +} + +bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding ) +{ + if ( !file ) + { + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + // Delete the existing data: + Clear(); + location.Clear(); + + // Get the file size, so we can pre-allocate the string. HUGE speed impact. + long length = 0; + fseek( file, 0, SEEK_END ); + length = ftell( file ); + fseek( file, 0, SEEK_SET ); + + // Strange case, but good to handle up front. + if ( length <= 0 ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + // If we have a file, assume it is all one big XML file, and read it in. + // The document parser may decide the document ends sooner than the entire file, however. + TIXML_STRING data; + data.reserve( length ); + + // Subtle bug here. TinyXml did use fgets. But from the XML spec: + // 2.11 End-of-Line Handling + // <snip> + // <quote> + // ...the XML processor MUST behave as if it normalized all line breaks in external + // parsed entities (including the document entity) on input, before parsing, by translating + // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to + // a single #xA character. + // </quote> + // + // It is not clear fgets does that, and certainly isn't clear it works cross platform. + // Generally, you expect fgets to translate from the convention of the OS to the c/unix + // convention, and not work generally. + + /* + while( fgets( buf, sizeof(buf), file ) ) + { + data += buf; + } + */ + + char* buf = new char[ length+1 ]; + buf[0] = 0; + + if ( fread( buf, length, 1, file ) != 1 ) + { + delete [] buf; + SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN ); + return false; + } + + const char* lastPos = buf; + const char* p = buf; + + buf[length] = 0; + while ( *p ) + { + assert( p < (buf+length) ); + if ( *p == 0xa ) + { + // Newline character. No special rules for this. Append all the characters + // since the last string, and include the newline. + data.append( lastPos, (p-lastPos+1) ); // append, include the newline + ++p; // move past the newline + lastPos = p; // and point to the new buffer (may be 0) + assert( p <= (buf+length) ); + } + else if ( *p == 0xd ) + { + // Carriage return. Append what we have so far, then + // handle moving forward in the buffer. + if ( (p-lastPos) > 0 ) + { + data.append( lastPos, p-lastPos ); // do not add the CR + } + data += (char)0xa; // a proper newline + + if ( *(p+1) == 0xa ) + { + // Carriage return - new line sequence + p += 2; + lastPos = p; + assert( p <= (buf+length) ); + } + else + { + // it was followed by something else...that is presumably characters again. + ++p; + lastPos = p; + assert( p <= (buf+length) ); + } + } + else + { + ++p; + } + } + // Handle any left over characters. + if ( p-lastPos ) + { + data.append( lastPos, p-lastPos ); + } + delete [] buf; + buf = 0; + + Parse( data.c_str(), 0, encoding ); + + if ( Error() ) + return false; + else + return true; +} + + +bool TiXmlDocument::SaveFile( const char * filename ) const +{ + // The old c stuff lives on... + FILE* fp = TiXmlFOpen( filename, "w" ); + if ( fp ) + { + bool result = SaveFile( fp ); + fclose( fp ); + return result; + } + return false; +} + + +bool TiXmlDocument::SaveFile( FILE* fp ) const +{ + if ( useMicrosoftBOM ) + { + const unsigned char TIXML_UTF_LEAD_0 = 0xefU; + const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; + const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + + fputc( TIXML_UTF_LEAD_0, fp ); + fputc( TIXML_UTF_LEAD_1, fp ); + fputc( TIXML_UTF_LEAD_2, fp ); + } + Print( fp, 0 ); + return (ferror(fp) == 0); +} + + +void TiXmlDocument::CopyTo( TiXmlDocument* target ) const +{ + TiXmlNode::CopyTo( target ); + + target->error = error; + target->errorId = errorId; + target->errorDesc = errorDesc; + target->tabsize = tabsize; + target->errorLocation = errorLocation; + target->useMicrosoftBOM = useMicrosoftBOM; + + TiXmlNode* node = 0; + for ( node = firstChild; node; node = node->NextSibling() ) + { + target->LinkEndChild( node->Clone() ); + } +} + + +TiXmlNode* TiXmlDocument::Clone() const +{ + TiXmlDocument* clone = new TiXmlDocument(); + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlDocument::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + node->Print( cfile, depth ); + fprintf( cfile, "\n" ); + } +} + + +bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const +{ + if ( visitor->VisitEnter( *this ) ) + { + for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() ) + { + if ( !node->Accept( visitor ) ) + break; + } + } + return visitor->VisitExit( *this ); +} + + +const TiXmlAttribute* TiXmlAttribute::Next() const +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( next->value.empty() && next->name.empty() ) + return 0; + return next; +} + +/* +TiXmlAttribute* TiXmlAttribute::Next() +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( next->value.empty() && next->name.empty() ) + return 0; + return next; +} +*/ + +const TiXmlAttribute* TiXmlAttribute::Previous() const +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( prev->value.empty() && prev->name.empty() ) + return 0; + return prev; +} + +/* +TiXmlAttribute* TiXmlAttribute::Previous() +{ + // We are using knowledge of the sentinel. The sentinel + // have a value or name. + if ( prev->value.empty() && prev->name.empty() ) + return 0; + return prev; +} +*/ + +void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const +{ + TIXML_STRING n, v; + + EncodeString( name, &n ); + EncodeString( value, &v ); + + if (value.find ('\"') == TIXML_STRING::npos) + { + if ( cfile ) + { + fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() ); + } + if ( str ) + { + (*str) += n; + (*str) += "=\""; + (*str) += v; + (*str) += "\""; + } + } + else + { + if ( cfile ) + { + fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() ); + } + if ( str ) + { + (*str) += n; + (*str) += "='"; + (*str) += v; + (*str) += "'"; + } + } +} + + +int TiXmlAttribute::QueryIntValue( int* ival ) const +{ + if ( TIXML_SSCANF( value.c_str(), "%d", ival ) == 1 ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; +} + +int TiXmlAttribute::QueryDoubleValue( double* dval ) const +{ + if ( TIXML_SSCANF( value.c_str(), "%lf", dval ) == 1 ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; +} + +void TiXmlAttribute::SetIntValue( int _value ) +{ + char buf [64]; +#if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value); +#else + sprintf (buf, "%d", _value); +#endif + SetValue (buf); +} + +void TiXmlAttribute::SetDoubleValue( double _value ) +{ + char buf [256]; +#if defined(TIXML_SNPRINTF) + TIXML_SNPRINTF( buf, sizeof(buf), "%lf", _value); +#else + sprintf (buf, "%lf", _value); +#endif + SetValue (buf); +} + +int TiXmlAttribute::IntValue() const +{ + return atoi (value.c_str ()); +} + +double TiXmlAttribute::DoubleValue() const +{ + return atof (value.c_str ()); +} + + +TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT ) +{ + copy.CopyTo( this ); +} + + +void TiXmlComment::operator=( const TiXmlComment& base ) +{ + Clear(); + base.CopyTo( this ); +} + + +void TiXmlComment::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + for ( int i=0; i<depth; i++ ) + { + fprintf( cfile, " " ); + } + fprintf( cfile, "<!--%s-->", value.c_str() ); +} + + +void TiXmlComment::CopyTo( TiXmlComment* target ) const +{ + TiXmlNode::CopyTo( target ); +} + + +bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlComment::Clone() const +{ + TiXmlComment* clone = new TiXmlComment(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlText::Print( FILE* cfile, int depth ) const +{ + assert( cfile ); + if ( cdata ) + { + int i; + fprintf( cfile, "\n" ); + for ( i=0; i<depth; i++ ) + { + fprintf( cfile, " " ); + } + fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output + } + else + { + TIXML_STRING buffer; + EncodeString( value, &buffer ); + fprintf( cfile, "%s", buffer.c_str() ); + } +} + + +void TiXmlText::CopyTo( TiXmlText* target ) const +{ + TiXmlNode::CopyTo( target ); + target->cdata = cdata; +} + + +bool TiXmlText::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlText::Clone() const +{ + TiXmlText* clone = 0; + clone = new TiXmlText( "" ); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +TiXmlDeclaration::TiXmlDeclaration( const char * _version, + const char * _encoding, + const char * _standalone ) + : TiXmlNode( TiXmlNode::DECLARATION ) +{ + version = _version; + encoding = _encoding; + standalone = _standalone; +} + + +#ifdef TIXML_USE_STL +TiXmlDeclaration::TiXmlDeclaration( const std::string& _version, + const std::string& _encoding, + const std::string& _standalone ) + : TiXmlNode( TiXmlNode::DECLARATION ) +{ + version = _version; + encoding = _encoding; + standalone = _standalone; +} +#endif + + +TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy ) + : TiXmlNode( TiXmlNode::DECLARATION ) +{ + copy.CopyTo( this ); +} + + +void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy ) +{ + Clear(); + copy.CopyTo( this ); +} + + +void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const +{ + if ( cfile ) fprintf( cfile, "<?xml " ); + if ( str ) (*str) += "<?xml "; + + if ( !version.empty() ) + { + if ( cfile ) fprintf (cfile, "version=\"%s\" ", version.c_str ()); + if ( str ) + { + (*str) += "version=\""; + (*str) += version; + (*str) += "\" "; + } + } + if ( !encoding.empty() ) + { + if ( cfile ) fprintf (cfile, "encoding=\"%s\" ", encoding.c_str ()); + if ( str ) + { + (*str) += "encoding=\""; + (*str) += encoding; + (*str) += "\" "; + } + } + if ( !standalone.empty() ) + { + if ( cfile ) fprintf (cfile, "standalone=\"%s\" ", standalone.c_str ()); + if ( str ) + { + (*str) += "standalone=\""; + (*str) += standalone; + (*str) += "\" "; + } + } + if ( cfile ) fprintf( cfile, "?>" ); + if ( str ) (*str) += "?>"; +} + + +void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const +{ + TiXmlNode::CopyTo( target ); + + target->version = version; + target->encoding = encoding; + target->standalone = standalone; +} + + +bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlDeclaration::Clone() const +{ + TiXmlDeclaration* clone = new TiXmlDeclaration(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +void TiXmlUnknown::Print( FILE* cfile, int depth ) const +{ + for ( int i=0; i<depth; i++ ) + fprintf( cfile, " " ); + fprintf( cfile, "<%s>", value.c_str() ); +} + + +void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const +{ + TiXmlNode::CopyTo( target ); +} + + +bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const +{ + return visitor->Visit( *this ); +} + + +TiXmlNode* TiXmlUnknown::Clone() const +{ + TiXmlUnknown* clone = new TiXmlUnknown(); + + if ( !clone ) + return 0; + + CopyTo( clone ); + return clone; +} + + +TiXmlAttributeSet::TiXmlAttributeSet() +{ + sentinel.next = &sentinel; + sentinel.prev = &sentinel; +} + + +TiXmlAttributeSet::~TiXmlAttributeSet() +{ + assert( sentinel.next == &sentinel ); + assert( sentinel.prev == &sentinel ); +} + + +void TiXmlAttributeSet::Add( TiXmlAttribute* addMe ) +{ +#ifdef TIXML_USE_STL + assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set. +#else + assert( !Find( addMe->Name() ) ); // Shouldn't be multiply adding to the set. +#endif + + addMe->next = &sentinel; + addMe->prev = sentinel.prev; + + sentinel.prev->next = addMe; + sentinel.prev = addMe; +} + +void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe ) +{ + TiXmlAttribute* node; + + for ( node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( node == removeMe ) + { + node->prev->next = node->next; + node->next->prev = node->prev; + node->next = 0; + node->prev = 0; + return; + } + } + assert( 0 ); // we tried to remove a non-linked attribute. +} + + +#ifdef TIXML_USE_STL +const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const +{ + for ( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( node->name == name ) + return node; + } + return 0; +} + +/* +TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) +{ + for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( node->name == name ) + return node; + } + return 0; +} +*/ +#endif + + +const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const +{ + for ( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( strcmp( node->name.c_str(), name ) == 0 ) + return node; + } + return 0; +} + +/* +TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) +{ + for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next ) + { + if ( strcmp( node->name.c_str(), name ) == 0 ) + return node; + } + return 0; +} +*/ + +#ifdef TIXML_USE_STL +std::istream& operator>> (std::istream & in, TiXmlNode & base) +{ + TIXML_STRING tag; + tag.reserve( 8 * 1000 ); + base.StreamIn( &in, &tag ); + + base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING ); + return in; +} +#endif + + +#ifdef TIXML_USE_STL +std::ostream& operator<< (std::ostream & out, const TiXmlNode & base) +{ + TiXmlPrinter printer; + printer.SetStreamPrinting(); + base.Accept( &printer ); + out << printer.Str(); + + return out; +} + + +std::string& operator<< (std::string& out, const TiXmlNode& base ) +{ + TiXmlPrinter printer; + printer.SetStreamPrinting(); + base.Accept( &printer ); + out.append( printer.Str() ); + + return out; +} +#endif + + +TiXmlHandle TiXmlHandle::FirstChild() const +{ + if ( node ) + { + TiXmlNode* child = node->FirstChild(); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const +{ + if ( node ) + { + TiXmlNode* child = node->FirstChild( value ); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChildElement() const +{ + if ( node ) + { + TiXmlElement* child = node->FirstChildElement(); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const +{ + if ( node ) + { + TiXmlElement* child = node->FirstChildElement( value ); + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::Child( int count ) const +{ + if ( node ) + { + int i; + TiXmlNode* child = node->FirstChild(); + for ( i=0; + child && i<count; + child = child->NextSibling(), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const +{ + if ( node ) + { + int i; + TiXmlNode* child = node->FirstChild( value ); + for ( i=0; + child && i<count; + child = child->NextSibling( value ), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::ChildElement( int count ) const +{ + if ( node ) + { + int i; + TiXmlElement* child = node->FirstChildElement(); + for ( i=0; + child && i<count; + child = child->NextSiblingElement(), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const +{ + if ( node ) + { + int i; + TiXmlElement* child = node->FirstChildElement( value ); + for ( i=0; + child && i<count; + child = child->NextSiblingElement( value ), ++i ) + { + // nothing + } + if ( child ) + return TiXmlHandle( child ); + } + return TiXmlHandle( 0 ); +} + + +bool TiXmlPrinter::VisitEnter( const TiXmlDocument& ) +{ + return true; +} + +bool TiXmlPrinter::VisitExit( const TiXmlDocument& ) +{ + return true; +} + +bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) +{ + DoIndent(); + buffer += "<"; + buffer += element.Value(); + + for ( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() ) + { + buffer += " "; + attrib->Print( 0, 0, &buffer ); + } + + if ( !element.FirstChild() ) + { + buffer += " />"; + DoLineBreak(); + } + else + { + buffer += ">"; + if ( element.FirstChild()->ToText() + && element.LastChild() == element.FirstChild() + && element.FirstChild()->ToText()->CDATA() == false ) + { + simpleTextPrint = true; + // no DoLineBreak()! + } + else + { + DoLineBreak(); + } + } + ++depth; + return true; +} + + +bool TiXmlPrinter::VisitExit( const TiXmlElement& element ) +{ + --depth; + if ( !element.FirstChild() ) + { + // nothing. + } + else + { + if ( simpleTextPrint ) + { + simpleTextPrint = false; + } + else + { + DoIndent(); + } + buffer += "</"; + buffer += element.Value(); + buffer += ">"; + DoLineBreak(); + } + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlText& text ) +{ + if ( text.CDATA() ) + { + DoIndent(); + buffer += "<![CDATA["; + buffer += text.Value(); + buffer += "]]>"; + DoLineBreak(); + } + else if ( simpleTextPrint ) + { + TIXML_STRING str; + TiXmlBase::EncodeString( text.ValueTStr(), &str ); + buffer += str; + } + else + { + DoIndent(); + TIXML_STRING str; + TiXmlBase::EncodeString( text.ValueTStr(), &str ); + buffer += str; + DoLineBreak(); + } + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration ) +{ + DoIndent(); + declaration.Print( 0, 0, &buffer ); + DoLineBreak(); + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlComment& comment ) +{ + DoIndent(); + buffer += "<!--"; + buffer += comment.Value(); + buffer += "-->"; + DoLineBreak(); + return true; +} + + +bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown ) +{ + DoIndent(); + buffer += "<"; + buffer += unknown.Value(); + buffer += ">"; + DoLineBreak(); + return true; +} + diff --git a/shared/tinyxml/tinyxml.dsw b/shared/tinyxml/tinyxml.dsw new file mode 100644 index 00000000..6ff9cfae --- /dev/null +++ b/shared/tinyxml/tinyxml.dsw @@ -0,0 +1,71 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "tinyXmlTest"=.\tinyXmlTest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name tinyxml + End Project Dependency +}}} + +############################################################################### + +Project: "tinyXmlTestSTL"=.\tinyXmlTestSTL.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name tinyxmlSTL + End Project Dependency +}}} + +############################################################################### + +Project: "tinyxml"=.\tinyxml_lib.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "tinyxmlSTL"=.\tinyxmlSTL.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/shared/tinyxml/tinyxml.h b/shared/tinyxml/tinyxml.h new file mode 100644 index 00000000..c6f40cc2 --- /dev/null +++ b/shared/tinyxml/tinyxml.h @@ -0,0 +1,1802 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + + +#ifndef TINYXML_INCLUDED +#define TINYXML_INCLUDED + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable : 4530 ) +#pragma warning( disable : 4786 ) +#endif + +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +// Help out windows: +#if defined( _DEBUG ) && !defined( DEBUG ) +#define DEBUG +#endif + +#ifdef TIXML_USE_STL + #include <string> + #include <iostream> + #include <sstream> + #define TIXML_STRING std::string +#else + #include "tinystr.h" + #define TIXML_STRING TiXmlString +#endif + +// Deprecated library function hell. Compilers want to use the +// new safe versions. This probably doesn't fully address the problem, +// but it gets closer. There are too many compilers for me to fully +// test. If you get compilation troubles, undefine TIXML_SAFE +#define TIXML_SAFE + +#ifdef TIXML_SAFE + #if defined(_MSC_VER) && (_MSC_VER >= 1400 ) + // Microsoft visual studio, version 2005 and higher. + #define TIXML_SNPRINTF _snprintf_s + #define TIXML_SNSCANF _snscanf_s + #define TIXML_SSCANF sscanf_s + #elif defined(_MSC_VER) && (_MSC_VER >= 1200 ) + // Microsoft visual studio, version 6 and higher. + //#pragma message( "Using _sn* functions." ) + #define TIXML_SNPRINTF _snprintf + #define TIXML_SNSCANF _snscanf + #define TIXML_SSCANF sscanf + #elif defined(__GNUC__) && (__GNUC__ >= 3 ) + // GCC version 3 and higher.s + //#warning( "Using sn* functions." ) + #define TIXML_SNPRINTF snprintf + #define TIXML_SNSCANF snscanf + #define TIXML_SSCANF sscanf + #else + #define TIXML_SSCANF sscanf + #endif +#endif + +class TiXmlDocument; +class TiXmlElement; +class TiXmlComment; +class TiXmlUnknown; +class TiXmlAttribute; +class TiXmlText; +class TiXmlDeclaration; +class TiXmlParsingData; + +const int TIXML_MAJOR_VERSION = 2; +const int TIXML_MINOR_VERSION = 5; +const int TIXML_PATCH_VERSION = 3; + +/* Internal structure for tracking location of items + in the XML file. +*/ +struct TiXmlCursor +{ + TiXmlCursor() { Clear(); } + void Clear() { row = col = -1; } + + int row; // 0 based. + int col; // 0 based. +}; + + +/** + If you call the Accept() method, it requires being passed a TiXmlVisitor + class to handle callbacks. For nodes that contain other nodes (Document, Element) + you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves + are simple called with Visit(). + + If you return 'true' from a Visit method, recursive parsing will continue. If you return + false, <b>no children of this node or its sibilings</b> will be Visited. + + All flavors of Visit methods have a default implementation that returns 'true' (continue + visiting). You need to only override methods that are interesting to you. + + Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting. + + You should never change the document from a callback. + + @sa TiXmlNode::Accept() +*/ +class TiXmlVisitor +{ +public: + virtual ~TiXmlVisitor() {} + + /// Visit a document. + virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; } + /// Visit a document. + virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; } + + /// Visit an element. + virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; } + /// Visit an element. + virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; } + + /// Visit a declaration + virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; } + /// Visit a text node + virtual bool Visit( const TiXmlText& /*text*/ ) { return true; } + /// Visit a comment node + virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; } + /// Visit an unknow node + virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; } +}; + +// Only used by Attribute::Query functions +enum +{ + TIXML_SUCCESS, + TIXML_NO_ATTRIBUTE, + TIXML_WRONG_TYPE +}; + + +// Used by the parsing routines. +enum TiXmlEncoding +{ + TIXML_ENCODING_UNKNOWN, + TIXML_ENCODING_UTF8, + TIXML_ENCODING_LEGACY +}; + +const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; + +/** TiXmlBase is a base class for every class in TinyXml. + It does little except to establish that TinyXml classes + can be printed and provide some utility functions. + + In XML, the document and elements can contain + other elements and other types of nodes. + + @verbatim + A Document can contain: Element (container or leaf) + Comment (leaf) + Unknown (leaf) + Declaration( leaf ) + + An Element can contain: Element (container or leaf) + Text (leaf) + Attributes (not on tree) + Comment (leaf) + Unknown (leaf) + + A Decleration contains: Attributes (not on tree) + @endverbatim +*/ +class TiXmlBase +{ + friend class TiXmlNode; + friend class TiXmlElement; + friend class TiXmlDocument; + +public: + TiXmlBase() : userData(0) {} + virtual ~TiXmlBase() {} + + /** All TinyXml classes can print themselves to a filestream + or the string class (TiXmlString in non-STL mode, std::string + in STL mode.) Either or both cfile and str can be null. + + This is a formatted print, and will insert + tabs and newlines. + + (For an unformatted stream, use the << operator.) + */ + virtual void Print( FILE* cfile, int depth ) const = 0; + + /** The world does not agree on whether white space should be kept or + not. In order to make everyone happy, these global, static functions + are provided to set whether or not TinyXml will condense all white space + into a single space or not. The default is to condense. Note changing this + value is not thread safe. + */ + static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; } + + /// Return the current white space setting. + static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; } + + /** Return the position, in the original source file, of this node or attribute. + The row and column are 1-based. (That is the first row and first column is + 1,1). If the returns values are 0 or less, then the parser does not have + a row and column value. + + Generally, the row and column value will be set when the TiXmlDocument::Load(), + TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set + when the DOM was created from operator>>. + + The values reflect the initial load. Once the DOM is modified programmatically + (by adding or changing nodes and attributes) the new values will NOT update to + reflect changes in the document. + + There is a minor performance cost to computing the row and column. Computation + can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value. + + @sa TiXmlDocument::SetTabSize() + */ + int Row() const { return location.row + 1; } + int Column() const { return location.col + 1; } ///< See Row() + + void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data. + void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data. + const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data. + + // Table that returs, for a given lead byte, the total number of bytes + // in the UTF-8 sequence. + static const int utf8ByteTable[256]; + + virtual const char* Parse( const char* p, + TiXmlParsingData* data, + TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0; + + /** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, + or they will be transformed into entities! + */ + static void EncodeString( const TIXML_STRING& str, TIXML_STRING* out ); + + enum + { + TIXML_NO_ERROR = 0, + TIXML_ERROR, + TIXML_ERROR_OPENING_FILE, + TIXML_ERROR_OUT_OF_MEMORY, + TIXML_ERROR_PARSING_ELEMENT, + TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, + TIXML_ERROR_READING_ELEMENT_VALUE, + TIXML_ERROR_READING_ATTRIBUTES, + TIXML_ERROR_PARSING_EMPTY, + TIXML_ERROR_READING_END_TAG, + TIXML_ERROR_PARSING_UNKNOWN, + TIXML_ERROR_PARSING_COMMENT, + TIXML_ERROR_PARSING_DECLARATION, + TIXML_ERROR_DOCUMENT_EMPTY, + TIXML_ERROR_EMBEDDED_NULL, + TIXML_ERROR_PARSING_CDATA, + TIXML_ERROR_DOCUMENT_TOP_ONLY, + + TIXML_ERROR_STRING_COUNT + }; + +protected: + + static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding ); + inline static bool IsWhiteSpace( char c ) + { + return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); + } + inline static bool IsWhiteSpace( int c ) + { + if ( c < 256 ) + return IsWhiteSpace( (char) c ); + return false; // Again, only truly correct for English/Latin...but usually works. + } + + #ifdef TIXML_USE_STL + static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ); + static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag ); + #endif + + /* Reads an XML name into the string provided. Returns + a pointer just past the last character of the name, + or 0 if the function has an error. + */ + static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding ); + + /* Reads text. Returns a pointer past the given end tag. + Wickedly complex options, but it keeps the (sensitive) code in one place. + */ + static const char* ReadText( const char* in, // where to start + TIXML_STRING* text, // the string read + bool ignoreWhiteSpace, // whether to keep the white space + const char* endTag, // what ends this text + bool ignoreCase, // whether to ignore case in the end tag + TiXmlEncoding encoding ); // the current encoding + + // If an entity has been found, transform it into a character. + static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding ); + + // Get a character, while interpreting entities. + // The length can be from 0 to 4 bytes. + inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding ) + { + assert( p ); + if ( encoding == TIXML_ENCODING_UTF8 ) + { + *length = utf8ByteTable[ *((const unsigned char*)p) ]; + assert( *length >= 0 && *length < 5 ); + } + else + { + *length = 1; + } + + if ( *length == 1 ) + { + if ( *p == '&' ) + return GetEntity( p, _value, length, encoding ); + *_value = *p; + return p+1; + } + else if ( *length ) + { + //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe), + // and the null terminator isn't needed + for( int i=0; p[i] && i<*length; ++i ) { + _value[i] = p[i]; + } + return p + (*length); + } + else + { + // Not valid text. + return 0; + } + } + + // Return true if the next characters in the stream are any of the endTag sequences. + // Ignore case only works for english, and should only be relied on when comparing + // to English words: StringEqual( p, "version", true ) is fine. + static bool StringEqual( const char* p, + const char* endTag, + bool ignoreCase, + TiXmlEncoding encoding ); + + static const char* errorString[ TIXML_ERROR_STRING_COUNT ]; + + TiXmlCursor location; + + /// Field containing a generic user pointer + void* userData; + + // None of these methods are reliable for any language except English. + // Good for approximation, not great for accuracy. + static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding ); + static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding ); + inline static int ToLower( int v, TiXmlEncoding encoding ) + { + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( v < 128 ) return tolower( v ); + return v; + } + else + { + return tolower( v ); + } + } + static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ); + +private: + TiXmlBase( const TiXmlBase& ); // not implemented. + void operator=( const TiXmlBase& base ); // not allowed. + + struct Entity + { + const char* str; + unsigned int strLength; + char chr; + }; + enum + { + NUM_ENTITY = 5, + MAX_ENTITY_LENGTH = 6 + + }; + static Entity entity[ NUM_ENTITY ]; + static bool condenseWhiteSpace; +}; + + +/** The parent class for everything in the Document Object Model. + (Except for attributes). + Nodes have siblings, a parent, and children. A node can be + in a document, or stand on its own. The type of a TiXmlNode + can be queried, and it can be cast to its more defined type. +*/ +class TiXmlNode : public TiXmlBase +{ + friend class TiXmlDocument; + friend class TiXmlElement; + +public: + #ifdef TIXML_USE_STL + + /** An input stream operator, for every class. Tolerant of newlines and + formatting, but doesn't expect them. + */ + friend std::istream& operator >> (std::istream& in, TiXmlNode& base); + + /** An output stream operator, for every class. Note that this outputs + without any newlines or formatting, as opposed to Print(), which + includes tabs and new lines. + + The operator<< and operator>> are not completely symmetric. Writing + a node to a stream is very well defined. You'll get a nice stream + of output, without any extra whitespace or newlines. + + But reading is not as well defined. (As it always is.) If you create + a TiXmlElement (for example) and read that from an input stream, + the text needs to define an element or junk will result. This is + true of all input streams, but it's worth keeping in mind. + + A TiXmlDocument will read nodes until it reads a root element, and + all the children of that root element. + */ + friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base); + + /// Appends the XML node or attribute to a std::string. + friend std::string& operator<< (std::string& out, const TiXmlNode& base ); + + #endif + + /** The types of XML nodes supported by TinyXml. (All the + unsupported types are picked up by UNKNOWN.) + */ + enum NodeType + { + DOCUMENT, + ELEMENT, + COMMENT, + UNKNOWN, + TEXT, + DECLARATION, + TYPECOUNT + }; + + virtual ~TiXmlNode(); + + /** The meaning of 'value' changes for the specific type of + TiXmlNode. + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + + The subclasses will wrap this function. + */ + const char *Value() const { return value.c_str (); } + + #ifdef TIXML_USE_STL + /** Return Value() as a std::string. If you only use STL, + this is more efficient than calling Value(). + Only available in STL mode. + */ + const std::string& ValueStr() const { return value; } + #endif + + const TIXML_STRING& ValueTStr() const { return value; } + + /** Changes the value of the node. Defined as: + @verbatim + Document: filename of the xml file + Element: name of the element + Comment: the comment text + Unknown: the tag contents + Text: the text string + @endverbatim + */ + void SetValue(const char * _value) { value = _value;} + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Delete all the children of this node. Does not affect 'this'. + void Clear(); + + /// One step up the DOM. + TiXmlNode* Parent() { return parent; } + const TiXmlNode* Parent() const { return parent; } + + const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children. + TiXmlNode* FirstChild() { return firstChild; } + const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found. + /// The first child of this node with the matching 'value'. Will be null if none found. + TiXmlNode* FirstChild( const char * _value ) { + // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe) + // call the method, cast the return back to non-const. + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value )); + } + const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children. + TiXmlNode* LastChild() { return lastChild; } + + const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children. + TiXmlNode* LastChild( const char * _value ) { + return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value )); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form. + #endif + + /** An alternate way to walk the children of a node. + One way to iterate over nodes is: + @verbatim + for( child = parent->FirstChild(); child; child = child->NextSibling() ) + @endverbatim + + IterateChildren does the same thing with the syntax: + @verbatim + child = 0; + while( child = parent->IterateChildren( child ) ) + @endverbatim + + IterateChildren takes the previous child as input and finds + the next one. If the previous child is null, it returns the + first. IterateChildren will return null when done. + */ + const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) ); + } + + /// This flavor of IterateChildren searches for children with a particular 'value' + const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const; + TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form. + #endif + + /** Add a new node related to this. Adds a child past the LastChild. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertEndChild( const TiXmlNode& addThis ); + + + /** Add a new node related to this. Adds a child past the LastChild. + + NOTE: the node to be added is passed by pointer, and will be + henceforth owned (and deleted) by tinyXml. This method is efficient + and avoids an extra copy, but should be used with care as it + uses a different memory model than the other insert functions. + + @sa InsertEndChild + */ + TiXmlNode* LinkEndChild( TiXmlNode* addThis ); + + /** Add a new node related to this. Adds a child before the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis ); + + /** Add a new node related to this. Adds a child after the specified child. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis ); + + /** Replace a child of this node. + Returns a pointer to the new object or NULL if an error occured. + */ + TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis ); + + /// Delete a child of this node. + bool RemoveChild( TiXmlNode* removeThis ); + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling() const { return prev; } + TiXmlNode* PreviousSibling() { return prev; } + + /// Navigate to a sibling node. + const TiXmlNode* PreviousSibling( const char * ) const; + TiXmlNode* PreviousSibling( const char *_prev ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form. + const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form. + TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Navigate to a sibling node. + const TiXmlNode* NextSibling() const { return next; } + TiXmlNode* NextSibling() { return next; } + + /// Navigate to a sibling node with the given 'value'. + const TiXmlNode* NextSibling( const char * ) const; + TiXmlNode* NextSibling( const char* _next ) { + return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement() const; + TiXmlElement* NextSiblingElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() ); + } + + /** Convenience function to get through elements. + Calls NextSibling and ToElement. Will skip all non-Element + nodes. Returns 0 if there is not another element. + */ + const TiXmlElement* NextSiblingElement( const char * ) const; + TiXmlElement* NextSiblingElement( const char *_next ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement() const; + TiXmlElement* FirstChildElement() { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() ); + } + + /// Convenience function to get through elements. + const TiXmlElement* FirstChildElement( const char * _value ) const; + TiXmlElement* FirstChildElement( const char * _value ) { + return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) ); + } + + #ifdef TIXML_USE_STL + const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form. + #endif + + /** Query the type (as an enumerated value, above) of this node. + The possible types are: DOCUMENT, ELEMENT, COMMENT, + UNKNOWN, TEXT, and DECLARATION. + */ + int Type() const { return type; } + + /** Return a pointer to the Document this node lives in. + Returns null if not in a document. + */ + const TiXmlDocument* GetDocument() const; + TiXmlDocument* GetDocument() { + return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() ); + } + + /// Returns true if this node has no children. + bool NoChildren() const { return !firstChild; } + + virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type. + + /** Create an exact duplicate of this node and return it. The memory must be deleted + by the caller. + */ + virtual TiXmlNode* Clone() const = 0; + + /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the + XML tree will be conditionally visited and the host will be called back + via the TiXmlVisitor interface. + + This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse + the XML for the callbacks, so the performance of TinyXML is unchanged by using this + interface versus any other.) + + The interface has been based on ideas from: + + - http://www.saxproject.org/ + - http://c2.com/cgi/wiki?HierarchicalVisitorPattern + + Which are both good references for "visiting". + + An example of using Accept(): + @verbatim + TiXmlPrinter printer; + tinyxmlDoc.Accept( &printer ); + const char* xmlcstr = printer.CStr(); + @endverbatim + */ + virtual bool Accept( TiXmlVisitor* visitor ) const = 0; + +protected: + TiXmlNode( NodeType _type ); + + // Copy to the allocated object. Shared functionality between Clone, Copy constructor, + // and the assignment operator. + void CopyTo( TiXmlNode* target ) const; + + #ifdef TIXML_USE_STL + // The real work of the input operator. + virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0; + #endif + + // Figure out what is at *p, and parse it. Returns null if it is not an xml node. + TiXmlNode* Identify( const char* start, TiXmlEncoding encoding ); + + TiXmlNode* parent; + NodeType type; + + TiXmlNode* firstChild; + TiXmlNode* lastChild; + + TIXML_STRING value; + + TiXmlNode* prev; + TiXmlNode* next; + +private: + TiXmlNode( const TiXmlNode& ); // not implemented. + void operator=( const TiXmlNode& base ); // not allowed. +}; + + +/** An attribute is a name-value pair. Elements have an arbitrary + number of attributes, each with a unique name. + + @note The attributes are not TiXmlNodes, since they are not + part of the tinyXML document object model. There are other + suggested ways to look at this problem. +*/ +class TiXmlAttribute : public TiXmlBase +{ + friend class TiXmlAttributeSet; + +public: + /// Construct an empty attribute. + TiXmlAttribute() : TiXmlBase() + { + document = 0; + prev = next = 0; + } + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlAttribute( const std::string& _name, const std::string& _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + #endif + + /// Construct an attribute with a name and value. + TiXmlAttribute( const char * _name, const char * _value ) + { + name = _name; + value = _value; + document = 0; + prev = next = 0; + } + + const char* Name() const { return name.c_str(); } ///< Return the name of this attribute. + const char* Value() const { return value.c_str(); } ///< Return the value of this attribute. + #ifdef TIXML_USE_STL + const std::string& ValueStr() const { return value; } ///< Return the value of this attribute. + #endif + int IntValue() const; ///< Return the value of this attribute, converted to an integer. + double DoubleValue() const; ///< Return the value of this attribute, converted to a double. + + // Get the tinyxml string representation + const TIXML_STRING& NameTStr() const { return name; } + + /** QueryIntValue examines the value string. It is an alternative to the + IntValue() method with richer error checking. + If the value is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. + + A specialized but useful call. Note that for success it returns 0, + which is the opposite of almost all other TinyXml calls. + */ + int QueryIntValue( int* _value ) const; + /// QueryDoubleValue examines the value string. See QueryIntValue(). + int QueryDoubleValue( double* _value ) const; + + void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute. + void SetValue( const char* _value ) { value = _value; } ///< Set the value. + + void SetIntValue( int _value ); ///< Set the value from an integer. + void SetDoubleValue( double _value ); ///< Set the value from a double. + + #ifdef TIXML_USE_STL + /// STL std::string form. + void SetName( const std::string& _name ) { name = _name; } + /// STL std::string form. + void SetValue( const std::string& _value ) { value = _value; } + #endif + + /// Get the next sibling attribute in the DOM. Returns null at end. + const TiXmlAttribute* Next() const; + TiXmlAttribute* Next() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); + } + + /// Get the previous sibling attribute in the DOM. Returns null at beginning. + const TiXmlAttribute* Previous() const; + TiXmlAttribute* Previous() { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); + } + + bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; } + bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; } + bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; } + + /* Attribute parsing starts: first letter of the name + returns: the next char after the value end quote + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + // Prints this Attribute to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const { + Print( cfile, depth, 0 ); + } + void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; + + // [internal use] + // Set the document pointer so the attribute can report errors. + void SetDocument( TiXmlDocument* doc ) { document = doc; } + +private: + TiXmlAttribute( const TiXmlAttribute& ); // not implemented. + void operator=( const TiXmlAttribute& base ); // not allowed. + + TiXmlDocument* document; // A pointer back to a document, for error reporting. + TIXML_STRING name; + TIXML_STRING value; + TiXmlAttribute* prev; + TiXmlAttribute* next; +}; + + +/* A class used to manage a group of attributes. + It is only used internally, both by the ELEMENT and the DECLARATION. + + The set can be changed transparent to the Element and Declaration + classes that use it, but NOT transparent to the Attribute + which has to implement a next() and previous() method. Which makes + it a bit problematic and prevents the use of STL. + + This version is implemented with circular lists because: + - I like circular lists + - it demonstrates some independence from the (typical) doubly linked list. +*/ +class TiXmlAttributeSet +{ +public: + TiXmlAttributeSet(); + ~TiXmlAttributeSet(); + + void Add( TiXmlAttribute* attribute ); + void Remove( TiXmlAttribute* attribute ); + + const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; } + const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; } + + const TiXmlAttribute* Find( const char* _name ) const; + TiXmlAttribute* Find( const char* _name ) { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); + } + #ifdef TIXML_USE_STL + const TiXmlAttribute* Find( const std::string& _name ) const; + TiXmlAttribute* Find( const std::string& _name ) { + return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) ); + } + + #endif + +private: + //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), + //*ME: this class must be also use a hidden/disabled copy-constructor !!! + TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed + void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute) + + TiXmlAttribute sentinel; +}; + + +/** The element is a container class. It has a value, the element name, + and can contain other elements, text, comments, and unknowns. + Elements also contain an arbitrary number of attributes. +*/ +class TiXmlElement : public TiXmlNode +{ +public: + /// Construct an element. + TiXmlElement (const char * in_value); + + #ifdef TIXML_USE_STL + /// std::string constructor. + TiXmlElement( const std::string& _value ); + #endif + + TiXmlElement( const TiXmlElement& ); + + void operator=( const TiXmlElement& base ); + + virtual ~TiXmlElement(); + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + */ + const char* Attribute( const char* name ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an integer, + the integer value will be put in the return 'i', if 'i' + is non-null. + */ + const char* Attribute( const char* name, int* i ) const; + + /** Given an attribute name, Attribute() returns the value + for the attribute of that name, or null if none exists. + If the attribute exists and can be converted to an double, + the double value will be put in the return 'd', if 'd' + is non-null. + */ + const char* Attribute( const char* name, double* d ) const; + + /** QueryIntAttribute examines the attribute - it is an alternative to the + Attribute() method with richer error checking. + If the attribute is an integer, it is stored in 'value' and + the call returns TIXML_SUCCESS. If it is not + an integer, it returns TIXML_WRONG_TYPE. If the attribute + does not exist, then TIXML_NO_ATTRIBUTE is returned. + */ + int QueryIntAttribute( const char* name, int* _value ) const; + /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute(). + int QueryDoubleAttribute( const char* name, double* _value ) const; + /// QueryFloatAttribute examines the attribute - see QueryIntAttribute(). + int QueryFloatAttribute( const char* name, float* _value ) const { + double d; + int result = QueryDoubleAttribute( name, &d ); + if ( result == TIXML_SUCCESS ) { + *_value = (float)d; + } + return result; + } + + #ifdef TIXML_USE_STL + /** Template form of the attribute query which will try to read the + attribute into the specified type. Very easy, very powerful, but + be careful to make sure to call this with the correct type. + + NOTE: This method doesn't work correctly for 'string' types. + + @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE + */ + template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + + std::stringstream sstream( node->ValueStr() ); + sstream >> *outValue; + if ( !sstream.fail() ) + return TIXML_SUCCESS; + return TIXML_WRONG_TYPE; + } + /* + This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string" + but template specialization is hard to get working cross-compiler. Leaving the bug for now. + + // The above will fail for std::string because the space character is used as a seperator. + // Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string + template<> int QueryValueAttribute( const std::string& name, std::string* outValue ) const + { + const TiXmlAttribute* node = attributeSet.Find( name ); + if ( !node ) + return TIXML_NO_ATTRIBUTE; + *outValue = node->ValueStr(); + return TIXML_SUCCESS; + } + */ + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char* name, const char * _value ); + + #ifdef TIXML_USE_STL + const std::string* Attribute( const std::string& name ) const; + const std::string* Attribute( const std::string& name, int* i ) const; + const std::string* Attribute( const std::string& name, double* d ) const; + int QueryIntAttribute( const std::string& name, int* _value ) const; + int QueryDoubleAttribute( const std::string& name, double* _value ) const; + + /// STL std::string form. + void SetAttribute( const std::string& name, const std::string& _value ); + ///< STL std::string form. + void SetAttribute( const std::string& name, int _value ); + #endif + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetAttribute( const char * name, int value ); + + /** Sets an attribute of name to a given value. The attribute + will be created if it does not exist, or changed if it does. + */ + void SetDoubleAttribute( const char * name, double value ); + + /** Deletes an attribute with the given name. + */ + void RemoveAttribute( const char * name ); + #ifdef TIXML_USE_STL + void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form. + #endif + + const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element. + TiXmlAttribute* FirstAttribute() { return attributeSet.First(); } + const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element. + TiXmlAttribute* LastAttribute() { return attributeSet.Last(); } + + /** Convenience function for easy access to the text inside an element. Although easy + and concise, GetText() is limited compared to getting the TiXmlText child + and accessing it directly. + + If the first child of 'this' is a TiXmlText, the GetText() + returns the character string of the Text node, else null is returned. + + This is a convenient method for getting the text of simple contained text: + @verbatim + <foo>This is text</foo> + const char* str = fooElement->GetText(); + @endverbatim + + 'str' will be a pointer to "This is text". + + Note that this function can be misleading. If the element foo was created from + this XML: + @verbatim + <foo><b>This is text</b></foo> + @endverbatim + + then the value of str would be null. The first child node isn't a text node, it is + another element. From this XML: + @verbatim + <foo>This is <b>text</b></foo> + @endverbatim + GetText() will return "This is ". + + WARNING: GetText() accesses a child node - don't become confused with the + similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are + safe type casts on the referenced node. + */ + const char* GetText() const; + + /// Creates a new Element and returns it - the returned element is a copy. + virtual TiXmlNode* Clone() const; + // Print the Element to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: next char past '<' + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + + void CopyTo( TiXmlElement* target ) const; + void ClearThis(); // like clear, but initializes 'this' object as well + + // Used to be public [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + /* [internal use] + Reads the "value" of the element -- another element, or text. + This should terminate with the current end tag. + */ + const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + +private: + + TiXmlAttributeSet attributeSet; +}; + + +/** An XML comment. +*/ +class TiXmlComment : public TiXmlNode +{ +public: + /// Constructs an empty comment. + TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {} + /// Construct a comment from text. + TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) { + SetValue( _value ); + } + TiXmlComment( const TiXmlComment& ); + void operator=( const TiXmlComment& base ); + + virtual ~TiXmlComment() {} + + /// Returns a copy of this Comment. + virtual TiXmlNode* Clone() const; + // Write this Comment to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /* Attribtue parsing starts: at the ! of the !-- + returns: next char past '>' + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + void CopyTo( TiXmlComment* target ) const; + + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif +// virtual void StreamOut( TIXML_OSTREAM * out ) const; + +private: + +}; + + +/** XML text. A text node can have 2 ways to output the next. "normal" output + and CDATA. It will default to the mode it was parsed from the XML file and + you generally want to leave it alone, but you can change the output mode with + SetCDATA() and query it with CDATA(). +*/ +class TiXmlText : public TiXmlNode +{ + friend class TiXmlElement; +public: + /** Constructor for text element. By default, it is treated as + normal, encoded text. If you want it be output as a CDATA text + element, set the parameter _cdata to 'true' + */ + TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT) + { + SetValue( initValue ); + cdata = false; + } + virtual ~TiXmlText() {} + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT) + { + SetValue( initValue ); + cdata = false; + } + #endif + + TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); } + void operator=( const TiXmlText& base ) { base.CopyTo( this ); } + + // Write this text object to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + /// Queries whether this represents text using a CDATA section. + bool CDATA() const { return cdata; } + /// Turns on or off a CDATA representation of text. + void SetCDATA( bool _cdata ) { cdata = _cdata; } + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected : + /// [internal use] Creates a new Element and returns it. + virtual TiXmlNode* Clone() const; + void CopyTo( TiXmlText* target ) const; + + bool Blank() const; // returns true if all white space and new lines + // [internal use] + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + bool cdata; // true if this should be input and output as a CDATA style text element +}; + + +/** In correct XML the declaration is the first entry in the file. + @verbatim + <?xml version="1.0" standalone="yes"?> + @endverbatim + + TinyXml will happily read or write files without a declaration, + however. There are 3 possible attributes to the declaration: + version, encoding, and standalone. + + Note: In this version of the code, the attributes are + handled as special cases, not generic attributes, simply + because there can only be at most 3 and they are always the same. +*/ +class TiXmlDeclaration : public TiXmlNode +{ +public: + /// Construct an empty declaration. + TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {} + +#ifdef TIXML_USE_STL + /// Constructor. + TiXmlDeclaration( const std::string& _version, + const std::string& _encoding, + const std::string& _standalone ); +#endif + + /// Construct. + TiXmlDeclaration( const char* _version, + const char* _encoding, + const char* _standalone ); + + TiXmlDeclaration( const TiXmlDeclaration& copy ); + void operator=( const TiXmlDeclaration& copy ); + + virtual ~TiXmlDeclaration() {} + + /// Version. Will return an empty string if none was found. + const char *Version() const { return version.c_str (); } + /// Encoding. Will return an empty string if none was found. + const char *Encoding() const { return encoding.c_str (); } + /// Is this a standalone document? + const char *Standalone() const { return standalone.c_str (); } + + /// Creates a copy of this Declaration and returns it. + virtual TiXmlNode* Clone() const; + // Print this declaration to a FILE stream. + virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const; + virtual void Print( FILE* cfile, int depth ) const { + Print( cfile, depth, 0 ); + } + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* visitor ) const; + +protected: + void CopyTo( TiXmlDeclaration* target ) const; + // used to be public + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + + TIXML_STRING version; + TIXML_STRING encoding; + TIXML_STRING standalone; +}; + + +/** Any tag that tinyXml doesn't recognize is saved as an + unknown. It is a tag of text, but should not be modified. + It will be written back to the XML, unchanged, when the file + is saved. + + DTD tags get thrown into TiXmlUnknowns. +*/ +class TiXmlUnknown : public TiXmlNode +{ +public: + TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {} + virtual ~TiXmlUnknown() {} + + TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); } + void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); } + + /// Creates a copy of this Unknown and returns it. + virtual TiXmlNode* Clone() const; + // Print this Unknown to a FILE stream. + virtual void Print( FILE* cfile, int depth ) const; + + virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ); + + virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected: + void CopyTo( TiXmlUnknown* target ) const; + + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + +}; + + +/** Always the top level node. A document binds together all the + XML pieces. It can be saved, loaded, and printed to the screen. + The 'value' of a document node is the xml file name. +*/ +class TiXmlDocument : public TiXmlNode +{ +public: + /// Create an empty document, that has no name. + TiXmlDocument(); + /// Create a document with a name. The name of the document is also the filename of the xml. + TiXmlDocument( const char * documentName ); + + #ifdef TIXML_USE_STL + /// Constructor. + TiXmlDocument( const std::string& documentName ); + #endif + + TiXmlDocument( const TiXmlDocument& copy ); + void operator=( const TiXmlDocument& copy ); + + virtual ~TiXmlDocument() {} + + /** Load a file using the current document value. + Returns true if successful. Will delete any existing + document data before loading. + */ + bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the current document value. Returns true if successful. + bool SaveFile() const; + /// Load a file using the given filename. Returns true if successful. + bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the given filename. Returns true if successful. + bool SaveFile( const char * filename ) const; + /** Load a file using the given FILE*. Returns true if successful. Note that this method + doesn't stream - the entire object pointed at by the FILE* + will be interpreted as an XML file. TinyXML doesn't stream in XML from the current + file location. Streaming may be added in the future. + */ + bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + /// Save a file using the given FILE*. Returns true if successful. + bool SaveFile( FILE* ) const; + + #ifdef TIXML_USE_STL + bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version. + { +// StringToBuffer f( filename ); +// return ( f.buffer && LoadFile( f.buffer, encoding )); + return LoadFile( filename.c_str(), encoding ); + } + bool SaveFile( const std::string& filename ) const ///< STL std::string version. + { +// StringToBuffer f( filename ); +// return ( f.buffer && SaveFile( f.buffer )); + return SaveFile( filename.c_str() ); + } + #endif + + /** Parse the given null terminated block of xml data. Passing in an encoding to this + method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml + to use that encoding, regardless of what TinyXml might otherwise try to detect. + */ + virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ); + + /** Get the root element -- the only top level element -- of the document. + In well formed XML, there should only be one. TinyXml is tolerant of + multiple elements at the document level. + */ + const TiXmlElement* RootElement() const { return FirstChildElement(); } + TiXmlElement* RootElement() { return FirstChildElement(); } + + /** If an error occurs, Error will be set to true. Also, + - The ErrorId() will contain the integer identifier of the error (not generally useful) + - The ErrorDesc() method will return the name of the error. (very useful) + - The ErrorRow() and ErrorCol() will return the location of the error (if known) + */ + bool Error() const { return error; } + + /// Contains a textual (english) description of the error if one occurs. + const char * ErrorDesc() const { return errorDesc.c_str (); } + + /** Generally, you probably want the error string ( ErrorDesc() ). But if you + prefer the ErrorId, this function will fetch it. + */ + int ErrorId() const { return errorId; } + + /** Returns the location (if known) of the error. The first column is column 1, + and the first row is row 1. A value of 0 means the row and column wasn't applicable + (memory errors, for example, have no row/column) or the parser lost the error. (An + error in the error reporting, in that case.) + + @sa SetTabSize, Row, Column + */ + int ErrorRow() const { return errorLocation.row+1; } + int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow() + + /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol()) + to report the correct values for row and column. It does not change the output + or input in any way. + + By calling this method, with a tab size + greater than 0, the row and column of each node and attribute is stored + when the file is loaded. Very useful for tracking the DOM back in to + the source file. + + The tab size is required for calculating the location of nodes. If not + set, the default of 4 is used. The tabsize is set per document. Setting + the tabsize to 0 disables row/column tracking. + + Note that row and column tracking is not supported when using operator>>. + + The tab size needs to be enabled before the parse or load. Correct usage: + @verbatim + TiXmlDocument doc; + doc.SetTabSize( 8 ); + doc.Load( "myfile.xml" ); + @endverbatim + + @sa Row, Column + */ + void SetTabSize( int _tabsize ) { tabsize = _tabsize; } + + int TabSize() const { return tabsize; } + + /** If you have handled the error, it can be reset with this call. The error + state is automatically cleared if you Parse a new XML block. + */ + void ClearError() { error = false; + errorId = 0; + errorDesc = ""; + errorLocation.row = errorLocation.col = 0; + //errorLocation.last = 0; + } + + /** Write the document to standard out using formatted printing ("pretty print"). */ + void Print() const { Print( stdout, 0 ); } + + /* Write the document to a string using formatted printing ("pretty print"). This + will allocate a character array (new char[]) and return it as a pointer. The + calling code pust call delete[] on the return char* to avoid a memory leak. + */ + //char* PrintToMemory() const; + + /// Print this Document to a FILE stream. + virtual void Print( FILE* cfile, int depth = 0 ) const; + // [internal use] + void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding ); + + virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type. + + /** Walk the XML tree visiting this node and all of its children. + */ + virtual bool Accept( TiXmlVisitor* content ) const; + +protected : + // [internal use] + virtual TiXmlNode* Clone() const; + #ifdef TIXML_USE_STL + virtual void StreamIn( std::istream * in, TIXML_STRING * tag ); + #endif + +private: + void CopyTo( TiXmlDocument* target ) const; + + bool error; + int errorId; + TIXML_STRING errorDesc; + int tabsize; + TiXmlCursor errorLocation; + bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write. +}; + + +/** + A TiXmlHandle is a class that wraps a node pointer with null checks; this is + an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml + DOM structure. It is a separate utility class. + + Take an example: + @verbatim + <Document> + <Element attributeA = "valueA"> + <Child attributeB = "value1" /> + <Child attributeB = "value2" /> + </Element> + <Document> + @endverbatim + + Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very + easy to write a *lot* of code that looks like: + + @verbatim + TiXmlElement* root = document.FirstChildElement( "Document" ); + if ( root ) + { + TiXmlElement* element = root->FirstChildElement( "Element" ); + if ( element ) + { + TiXmlElement* child = element->FirstChildElement( "Child" ); + if ( child ) + { + TiXmlElement* child2 = child->NextSiblingElement( "Child" ); + if ( child2 ) + { + // Finally do something useful. + @endverbatim + + And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity + of such code. A TiXmlHandle checks for null pointers so it is perfectly safe + and correct to use: + + @verbatim + TiXmlHandle docHandle( &document ); + TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement(); + if ( child2 ) + { + // do something useful + @endverbatim + + Which is MUCH more concise and useful. + + It is also safe to copy handles - internally they are nothing more than node pointers. + @verbatim + TiXmlHandle handleCopy = handle; + @endverbatim + + What they should not be used for is iteration: + + @verbatim + int i=0; + while ( true ) + { + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement(); + if ( !child ) + break; + // do something + ++i; + } + @endverbatim + + It seems reasonable, but it is in fact two embedded while loops. The Child method is + a linear walk to find the element, so this code would iterate much more than it needs + to. Instead, prefer: + + @verbatim + TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement(); + + for( child; child; child=child->NextSiblingElement() ) + { + // do something + } + @endverbatim +*/ +class TiXmlHandle +{ +public: + /// Create a handle from any node (at any depth of the tree.) This can be a null pointer. + TiXmlHandle( TiXmlNode* _node ) { this->node = _node; } + /// Copy constructor + TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; } + TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; } + + /// Return a handle to the first child node. + TiXmlHandle FirstChild() const; + /// Return a handle to the first child node with the given name. + TiXmlHandle FirstChild( const char * value ) const; + /// Return a handle to the first child element. + TiXmlHandle FirstChildElement() const; + /// Return a handle to the first child element with the given name. + TiXmlHandle FirstChildElement( const char * value ) const; + + /** Return a handle to the "index" child with the given name. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( const char* value, int index ) const; + /** Return a handle to the "index" child. + The first child is 0, the second 1, etc. + */ + TiXmlHandle Child( int index ) const; + /** Return a handle to the "index" child element with the given name. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( const char* value, int index ) const; + /** Return a handle to the "index" child element. + The first child element is 0, the second 1, etc. Note that only TiXmlElements + are indexed: other types are not counted. + */ + TiXmlHandle ChildElement( int index ) const; + + #ifdef TIXML_USE_STL + TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); } + TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); } + + TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); } + TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); } + #endif + + /** Return the handle as a TiXmlNode. This may return null. + */ + TiXmlNode* ToNode() const { return node; } + /** Return the handle as a TiXmlElement. This may return null. + */ + TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); } + /** Return the handle as a TiXmlText. This may return null. + */ + TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); } + /** Return the handle as a TiXmlUnknown. This may return null. + */ + TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); } + + /** @deprecated use ToNode. + Return the handle as a TiXmlNode. This may return null. + */ + TiXmlNode* Node() const { return ToNode(); } + /** @deprecated use ToElement. + Return the handle as a TiXmlElement. This may return null. + */ + TiXmlElement* Element() const { return ToElement(); } + /** @deprecated use ToText() + Return the handle as a TiXmlText. This may return null. + */ + TiXmlText* Text() const { return ToText(); } + /** @deprecated use ToUnknown() + Return the handle as a TiXmlUnknown. This may return null. + */ + TiXmlUnknown* Unknown() const { return ToUnknown(); } + +private: + TiXmlNode* node; +}; + + +/** Print to memory functionality. The TiXmlPrinter is useful when you need to: + + -# Print to memory (especially in non-STL mode) + -# Control formatting (line endings, etc.) + + When constructed, the TiXmlPrinter is in its default "pretty printing" mode. + Before calling Accept() you can call methods to control the printing + of the XML document. After TiXmlNode::Accept() is called, the printed document can + be accessed via the CStr(), Str(), and Size() methods. + + TiXmlPrinter uses the Visitor API. + @verbatim + TiXmlPrinter printer; + printer.SetIndent( "\t" ); + + doc.Accept( &printer ); + fprintf( stdout, "%s", printer.CStr() ); + @endverbatim +*/ +class TiXmlPrinter : public TiXmlVisitor +{ +public: + TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ), + buffer(), indent( " " ), lineBreak( "\n" ) {} + + virtual bool VisitEnter( const TiXmlDocument& doc ); + virtual bool VisitExit( const TiXmlDocument& doc ); + + virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ); + virtual bool VisitExit( const TiXmlElement& element ); + + virtual bool Visit( const TiXmlDeclaration& declaration ); + virtual bool Visit( const TiXmlText& text ); + virtual bool Visit( const TiXmlComment& comment ); + virtual bool Visit( const TiXmlUnknown& unknown ); + + /** Set the indent characters for printing. By default 4 spaces + but tab (\t) is also useful, or null/empty string for no indentation. + */ + void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; } + /// Query the indention string. + const char* Indent() { return indent.c_str(); } + /** Set the line breaking string. By default set to newline (\n). + Some operating systems prefer other characters, or can be + set to the null/empty string for no indenation. + */ + void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; } + /// Query the current line breaking string. + const char* LineBreak() { return lineBreak.c_str(); } + + /** Switch over to "stream printing" which is the most dense formatting without + linebreaks. Common when the XML is needed for network transmission. + */ + void SetStreamPrinting() { indent = ""; + lineBreak = ""; + } + /// Return the result. + const char* CStr() { return buffer.c_str(); } + /// Return the length of the result string. + size_t Size() { return buffer.size(); } + + #ifdef TIXML_USE_STL + /// Return the result. + const std::string& Str() { return buffer; } + #endif + +private: + void DoIndent() { + for( int i=0; i<depth; ++i ) + buffer += indent; + } + void DoLineBreak() { + buffer += lineBreak; + } + + int depth; + bool simpleTextPrint; + TIXML_STRING buffer; + TIXML_STRING indent; + TIXML_STRING lineBreak; +}; + + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + +#endif + diff --git a/shared/tinyxml/tinyxml.sln b/shared/tinyxml/tinyxml.sln new file mode 100644 index 00000000..16828c93 --- /dev/null +++ b/shared/tinyxml/tinyxml.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyXmlTest", "tinyXmlTest.vcproj", "{34719950-09E8-457E-BE23-8F1CE3A1F1F6}" + ProjectSection(ProjectDependencies) = postProject + {C406DAEC-0886-4771-8DEA-9D7329B46CC1} = {C406DAEC-0886-4771-8DEA-9D7329B46CC1} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyXmlTestSTL", "tinyXmlTestSTL.vcproj", "{53ED5965-5BCA-47B5-9EB0-EDD20882F22F}" + ProjectSection(ProjectDependencies) = postProject + {A3A84737-5017-4577-B8A2-79429A25B8B6} = {A3A84737-5017-4577-B8A2-79429A25B8B6} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml", "tinyxml_lib.vcproj", "{C406DAEC-0886-4771-8DEA-9D7329B46CC1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxmlSTL", "tinyxmlSTL.vcproj", "{A3A84737-5017-4577-B8A2-79429A25B8B6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Debug|Win32.ActiveCfg = Debug|Win32 + {34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Debug|Win32.Build.0 = Debug|Win32 + {34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Release|Win32.ActiveCfg = Release|Win32 + {34719950-09E8-457E-BE23-8F1CE3A1F1F6}.Release|Win32.Build.0 = Release|Win32 + {53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Debug|Win32.ActiveCfg = Debug|Win32 + {53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Debug|Win32.Build.0 = Debug|Win32 + {53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Release|Win32.ActiveCfg = Release|Win32 + {53ED5965-5BCA-47B5-9EB0-EDD20882F22F}.Release|Win32.Build.0 = Release|Win32 + {C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Debug|Win32.ActiveCfg = Debug|Win32 + {C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Debug|Win32.Build.0 = Debug|Win32 + {C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Release|Win32.ActiveCfg = Release|Win32 + {C406DAEC-0886-4771-8DEA-9D7329B46CC1}.Release|Win32.Build.0 = Release|Win32 + {A3A84737-5017-4577-B8A2-79429A25B8B6}.Debug|Win32.ActiveCfg = Debug|Win32 + {A3A84737-5017-4577-B8A2-79429A25B8B6}.Debug|Win32.Build.0 = Debug|Win32 + {A3A84737-5017-4577-B8A2-79429A25B8B6}.Release|Win32.ActiveCfg = Release|Win32 + {A3A84737-5017-4577-B8A2-79429A25B8B6}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/shared/tinyxml/tinyxmlSTL.dsp b/shared/tinyxml/tinyxmlSTL.dsp new file mode 100644 index 00000000..8f50e449 --- /dev/null +++ b/shared/tinyxml/tinyxmlSTL.dsp @@ -0,0 +1,126 @@ +# Microsoft Developer Studio Project File - Name="tinyxmlSTL" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=tinyxmlSTL - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tinyxmlSTL.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tinyxmlSTL.mak" CFG="tinyxmlSTL - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tinyxmlSTL - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "tinyxmlSTL - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tinyxmlSTL - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "tinyxmlSTL___Win32_Release" +# PROP BASE Intermediate_Dir "tinyxmlSTL___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_STL" +# PROP Intermediate_Dir "Release_STL" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "TIXML_USE_STL" /FR /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release_STL\tinyxml_STL.lib" + +!ELSEIF "$(CFG)" == "tinyxmlSTL - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "tinyxmlSTL___Win32_Debug0" +# PROP BASE Intermediate_Dir "tinyxmlSTL___Win32_Debug0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_STL" +# PROP Intermediate_Dir "Debug_STL" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "TIXML_USE_STL" /FR /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug_STL\tinyxmld_STL.lib" + +!ENDIF + +# Begin Target + +# Name "tinyxmlSTL - Win32 Release" +# Name "tinyxmlSTL - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tinystr.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlerror.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlparser.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\tinystr.h +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\changes.txt +# End Source File +# Begin Source File + +SOURCE=.\readme.txt +# End Source File +# End Target +# End Project diff --git a/shared/tinyxml/tinyxmlSTL.vcproj b/shared/tinyxml/tinyxmlSTL.vcproj new file mode 100644 index 00000000..e1e14a07 --- /dev/null +++ b/shared/tinyxml/tinyxmlSTL.vcproj @@ -0,0 +1,278 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="tinyxmlSTL" + ProjectGUID="{A3A84737-5017-4577-B8A2-79429A25B8B6}" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug_STL" + IntermediateDirectory=".\Debug_STL" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;TIXML_USE_STL;" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\Debug_STL/tinyxmlSTL.pch" + AssemblerListingLocation=".\Debug_STL/" + ObjectFile=".\Debug_STL/" + ProgramDataBaseFileName=".\Debug_STL/" + BrowseInformation="1" + WarningLevel="4" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="Debug_STL\tinyxmld_STL.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Debug_STL/tinyxmlSTL.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release_STL" + IntermediateDirectory=".\Release_STL" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;TIXML_USE_STL" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\Release_STL/tinyxmlSTL.pch" + AssemblerListingLocation=".\Release_STL/" + ObjectFile=".\Release_STL/" + ProgramDataBaseFileName=".\Release_STL/" + BrowseInformation="1" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="Release_STL\tinyxml_STL.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Release_STL/tinyxmlSTL.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + > + <File + RelativePath="tinystr.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxml.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxmlerror.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxmlparser.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + > + <File + RelativePath="tinystr.h" + > + </File> + <File + RelativePath="tinyxml.h" + > + </File> + </Filter> + <File + RelativePath="changes.txt" + > + </File> + <File + RelativePath="readme.txt" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/shared/tinyxml/tinyxml_lib.dsp b/shared/tinyxml/tinyxml_lib.dsp new file mode 100644 index 00000000..833d3436 --- /dev/null +++ b/shared/tinyxml/tinyxml_lib.dsp @@ -0,0 +1,130 @@ +# Microsoft Developer Studio Project File - Name="tinyxml" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=tinyxml - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "tinyxml_lib.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "tinyxml_lib.mak" CFG="tinyxml - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "tinyxml - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "tinyxml - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "tinyxml - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x407 /d "NDEBUG" +# ADD RSC /l 0x407 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Release\tinyxml.lib" + +!ELSEIF "$(CFG)" == "tinyxml - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x407 /d "_DEBUG" +# ADD RSC /l 0x407 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Debug\tinyxmld.lib" + +!ENDIF + +# Begin Target + +# Name "tinyxml - Win32 Release" +# Name "tinyxml - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\tinystr.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlerror.cpp +# End Source File +# Begin Source File + +SOURCE=.\tinyxmlparser.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\tinystr.h +# End Source File +# Begin Source File + +SOURCE=.\tinyxml.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\changes.txt +# End Source File +# Begin Source File + +SOURCE=.\readme.txt +# End Source File +# Begin Source File + +SOURCE=.\tutorial_gettingStarted.txt +# End Source File +# End Target +# End Project diff --git a/shared/tinyxml/tinyxml_lib.vcproj b/shared/tinyxml/tinyxml_lib.vcproj new file mode 100644 index 00000000..ced31169 --- /dev/null +++ b/shared/tinyxml/tinyxml_lib.vcproj @@ -0,0 +1,283 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="tinyxml" + ProjectGUID="{C406DAEC-0886-4771-8DEA-9D7329B46CC1}" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\Release/tinyxml_lib.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1031" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="Release\tinyxml.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Release/tinyxml_lib.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="4" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\Debug/tinyxml_lib.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + BrowseInformation="1" + WarningLevel="4" + SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1031" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + OutputFile="Debug\tinyxmld.lib" + SuppressStartupBanner="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Debug/tinyxml_lib.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="tinystr.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxml.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxmlerror.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="tinyxmlparser.cpp" + > + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="tinystr.h" + > + </File> + <File + RelativePath="tinyxml.h" + > + </File> + </Filter> + <File + RelativePath="changes.txt" + > + </File> + <File + RelativePath="readme.txt" + > + </File> + <File + RelativePath="tutorial_gettingStarted.txt" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/shared/tinyxml/tinyxmlerror.cpp b/shared/tinyxml/tinyxmlerror.cpp new file mode 100644 index 00000000..3f068f2b --- /dev/null +++ b/shared/tinyxml/tinyxmlerror.cpp @@ -0,0 +1,53 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include "tinyxml.h" + +// The goal of the seperate error file is to make the first +// step towards localization. tinyxml (currently) only supports +// english error messages, but the could now be translated. +// +// It also cleans up the code a bit. +// + +const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] = +{ + "No error", + "Error", + "Failed to open file", + "Memory allocation failed.", + "Error parsing Element.", + "Failed to read Element name", + "Error reading Element value.", + "Error reading Attributes.", + "Error: empty tag.", + "Error reading end tag.", + "Error parsing Unknown.", + "Error parsing Comment.", + "Error parsing Declaration.", + "Error document empty.", + "Error null (0) or unexpected EOF found in input stream.", + "Error parsing CDATA.", + "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.", +}; diff --git a/shared/tinyxml/tinyxmlparser.cpp b/shared/tinyxml/tinyxmlparser.cpp new file mode 100644 index 00000000..a601016a --- /dev/null +++ b/shared/tinyxml/tinyxmlparser.cpp @@ -0,0 +1,1660 @@ +/* +www.sourceforge.net/projects/tinyxml +Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com) + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any +damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must +not claim that you wrote the original software. If you use this +software in a product, an acknowledgment in the product documentation +would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and +must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source +distribution. +*/ + +#include <ctype.h> +#include <stddef.h> + +#include "tinyxml.h" + +//#define DEBUG_PARSER +#if defined( DEBUG_PARSER ) +# if defined( DEBUG ) && defined( _MSC_VER ) +# include <windows.h> +# define TIXML_LOG OutputDebugString +# else +# define TIXML_LOG printf +# endif +#endif + +// Note tha "PutString" hardcodes the same list. This +// is less flexible than it appears. Changing the entries +// or order will break putstring. +TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = +{ + { "&", 5, '&' }, + { "<", 4, '<' }, + { ">", 4, '>' }, + { """, 6, '\"' }, + { "'", 6, '\'' } +}; + +// Bunch of unicode info at: +// http://www.unicode.org/faq/utf_bom.html +// Including the basic of this table, which determines the #bytes in the +// sequence from the lead byte. 1 placed for invalid sequences -- +// although the result will be junk, pass it through as much as possible. +// Beware of the non-characters in UTF-8: +// ef bb bf (Microsoft "lead bytes") +// ef bf be +// ef bf bf + +const unsigned char TIXML_UTF_LEAD_0 = 0xefU; +const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; +const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; + +const int TiXmlBase::utf8ByteTable[256] = +{ + // 0 1 2 3 4 5 6 7 8 9 a b c d e f + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0 + 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid +}; + + +void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length ) +{ + const unsigned long BYTE_MASK = 0xBF; + const unsigned long BYTE_MARK = 0x80; + const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + + if (input < 0x80) + *length = 1; + else if ( input < 0x800 ) + *length = 2; + else if ( input < 0x10000 ) + *length = 3; + else if ( input < 0x200000 ) + *length = 4; + else + { + *length = 0; // This code won't covert this correctly anyway. + return; + } + + output += *length; + + // Scary scary fall throughs. + switch (*length) + { + case 4: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 3: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 2: + --output; + *output = (char)((input | BYTE_MARK) & BYTE_MASK); + input >>= 6; + case 1: + --output; + *output = (char)(input | FIRST_BYTE_MARK[*length]); + } +} + + +/*static*/ +int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) +{ + // This will only work for low-ascii, everything else is assumed to be a valid + // letter. I'm not sure this is the best approach, but it is quite tricky trying + // to figure out alhabetical vs. not across encoding. So take a very + // conservative approach. + +// if ( encoding == TIXML_ENCODING_UTF8 ) +// { + if ( anyByte < 127 ) + return isalpha( anyByte ); + else + return 1; // What else to do? The unicode set is huge...get the english ones right. +// } +// else +// { +// return isalpha( anyByte ); +// } +} + + +/*static*/ +int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ ) +{ + // This will only work for low-ascii, everything else is assumed to be a valid + // letter. I'm not sure this is the best approach, but it is quite tricky trying + // to figure out alhabetical vs. not across encoding. So take a very + // conservative approach. + +// if ( encoding == TIXML_ENCODING_UTF8 ) +// { + if ( anyByte < 127 ) + return isalnum( anyByte ); + else + return 1; // What else to do? The unicode set is huge...get the english ones right. +// } +// else +// { +// return isalnum( anyByte ); +// } +} + + +class TiXmlParsingData +{ + friend class TiXmlDocument; +public: + void Stamp( const char* now, TiXmlEncoding encoding ); + + const TiXmlCursor& Cursor() + { + return cursor; + } + +private: + // Only used by the document! + TiXmlParsingData( const char* start, int _tabsize, int row, int col ) + { + assert( start ); + stamp = start; + tabsize = _tabsize; + cursor.row = row; + cursor.col = col; + } + + TiXmlCursor cursor; + const char* stamp; + int tabsize; +}; + + +void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding ) +{ + assert( now ); + + // Do nothing if the tabsize is 0. + if ( tabsize < 1 ) + { + return; + } + + // Get the current row, column. + int row = cursor.row; + int col = cursor.col; + const char* p = stamp; + assert( p ); + + while ( p < now ) + { + // Treat p as unsigned, so we have a happy compiler. + const unsigned char* pU = (const unsigned char*)p; + + // Code contributed by Fletcher Dunn: (modified by lee) + switch (*pU) + { + case 0: + // We *should* never get here, but in case we do, don't + // advance past the terminating null character, ever + return; + + case '\r': + // bump down to the next line + ++row; + col = 0; + // Eat the character + ++p; + + // Check for \r\n sequence, and treat this as a single character + if (*p == '\n') + { + ++p; + } + break; + + case '\n': + // bump down to the next line + ++row; + col = 0; + + // Eat the character + ++p; + + // Check for \n\r sequence, and treat this as a single + // character. (Yes, this bizarre thing does occur still + // on some arcane platforms...) + if (*p == '\r') + { + ++p; + } + break; + + case '\t': + // Eat the character + ++p; + + // Skip to next tab stop + col = (col / tabsize + 1) * tabsize; + break; + + case TIXML_UTF_LEAD_0: + if ( encoding == TIXML_ENCODING_UTF8 ) + { + if ( *(p+1) && *(p+2) ) + { + // In these cases, don't advance the column. These are + // 0-width spaces. + if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 ) + p += 3; + else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU ) + p += 3; + else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU ) + p += 3; + else + { + p +=3; // A normal character. + ++col; + } + } + } + else + { + ++p; + ++col; + } + break; + + default: + if ( encoding == TIXML_ENCODING_UTF8 ) + { + // Eat the 1 to 4 byte utf8 character. + int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)]; + if ( step == 0 ) + step = 1; // Error case from bad encoding, but handle gracefully. + p += step; + + // Just advance one column, of course. + ++col; + } + else + { + ++p; + ++col; + } + break; + } + } + cursor.row = row; + cursor.col = col; + assert( cursor.row >= -1 ); + assert( cursor.col >= -1 ); + stamp = p; + assert( stamp ); +} + + +const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding ) +{ + if ( !p || !*p ) + { + return 0; + } + if ( encoding == TIXML_ENCODING_UTF8 ) + { + while ( *p ) + { + const unsigned char* pU = (const unsigned char*)p; + + // Skip the stupid Microsoft UTF-8 Byte order marks + if ( *(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==TIXML_UTF_LEAD_1 + && *(pU+2)==TIXML_UTF_LEAD_2 ) + { + p += 3; + continue; + } + else if (*(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==0xbfU + && *(pU+2)==0xbeU ) + { + p += 3; + continue; + } + else if (*(pU+0)==TIXML_UTF_LEAD_0 + && *(pU+1)==0xbfU + && *(pU+2)==0xbfU ) + { + p += 3; + continue; + } + + if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space. + ++p; + else + break; + } + } + else + { + while ( *p && (IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' )) + ++p; + } + + return p; +} + +#ifdef TIXML_USE_STL +/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag ) +{ + for ( ;; ) + { + if ( !in->good() ) return false; + + int c = in->peek(); + // At this scope, we can't get to a document. So fail silently. + if ( !IsWhiteSpace( c ) || c <= 0 ) + return true; + + *tag += (char) in->get(); + } +} + +/*static*/ +bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag ) +{ + //assert( character > 0 && character < 128 ); // else it won't work in utf-8 + while ( in->good() ) + { + int c = in->peek(); + if ( c == character ) + return true; + if ( c <= 0 ) // Silent failure: can't get document at this scope + return false; + + in->get(); + *tag += (char) c; + } + return false; +} +#endif + +// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The +// "assign" optimization removes over 10% of the execution time. +// +const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding ) +{ + // Oddly, not supported on some comilers, + //name->clear(); + // So use this: + *name = ""; + assert( p ); + + // Names start with letters or underscores. + // Of course, in unicode, tinyxml has no idea what a letter *is*. The + // algorithm is generous. + // + // After that, they can be letters, underscores, numbers, + // hyphens, or colons. (Colons are valid ony for namespaces, + // but tinyxml can't tell namespaces from names.) + if ( p && *p + && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) ) + { + const char* start = p; + while ( p && *p + && ( IsAlphaNum( (unsigned char ) *p, encoding ) + || *p == '_' + || *p == '-' + || *p == '.' + || *p == ':' ) ) + { + //(*name) += *p; // expensive + ++p; + } + if ( p-start > 0 ) + { + name->assign( start, p-start ); + } + return p; + } + return 0; +} + +const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding ) +{ + // Presume an entity, and pull it out. + TIXML_STRING ent; + int i; + *length = 0; + + if ( *(p+1) && *(p+1) == '#' && *(p+2) ) + { + unsigned long ucs = 0; + ptrdiff_t delta = 0; + unsigned mult = 1; + + if ( *(p+2) == 'x' ) + { + // Hexadecimal. + if ( !*(p+3) ) return 0; + + const char* q = p+3; + q = strchr( q, ';' ); + + if ( !q || !*q ) return 0; + + delta = q-p; + --q; + + while ( *q != 'x' ) + { + if ( *q >= '0' && *q <= '9' ) + ucs += mult * (*q - '0'); + else if ( *q >= 'a' && *q <= 'f' ) + ucs += mult * (*q - 'a' + 10); + else if ( *q >= 'A' && *q <= 'F' ) + ucs += mult * (*q - 'A' + 10 ); + else + return 0; + mult *= 16; + --q; + } + } + else + { + // Decimal. + if ( !*(p+2) ) return 0; + + const char* q = p+2; + q = strchr( q, ';' ); + + if ( !q || !*q ) return 0; + + delta = q-p; + --q; + + while ( *q != '#' ) + { + if ( *q >= '0' && *q <= '9' ) + ucs += mult * (*q - '0'); + else + return 0; + mult *= 10; + --q; + } + } + if ( encoding == TIXML_ENCODING_UTF8 ) + { + // convert the UCS to UTF-8 + ConvertUTF32ToUTF8( ucs, value, length ); + } + else + { + *value = (char)ucs; + *length = 1; + } + return p + delta + 1; + } + + // Now try to match it. + for ( i=0; i<NUM_ENTITY; ++i ) + { + if ( strncmp( entity[i].str, p, entity[i].strLength ) == 0 ) + { + assert( strlen( entity[i].str ) == entity[i].strLength ); + *value = entity[i].chr; + *length = 1; + return ( p + entity[i].strLength ); + } + } + + // So it wasn't an entity, its unrecognized, or something like that. + *value = *p; // Don't put back the last one, since we return it! + //*length = 1; // Leave unrecognized entities - this doesn't really work. + // Just writes strange XML. + return p+1; +} + + +bool TiXmlBase::StringEqual( const char* p, + const char* tag, + bool ignoreCase, + TiXmlEncoding encoding ) +{ + assert( p ); + assert( tag ); + if ( !p || !*p ) + { + assert( 0 ); + return false; + } + + const char* q = p; + + if ( ignoreCase ) + { + while ( *q && *tag && ToLower( *q, encoding ) == ToLower( *tag, encoding ) ) + { + ++q; + ++tag; + } + + if ( *tag == 0 ) + return true; + } + else + { + while ( *q && *tag && *q == *tag ) + { + ++q; + ++tag; + } + + if ( *tag == 0 ) // Have we found the end of the tag, and everything equal? + return true; + } + return false; +} + +const char* TiXmlBase::ReadText( const char* p, + TIXML_STRING * text, + bool trimWhiteSpace, + const char* endTag, + bool caseInsensitive, + TiXmlEncoding encoding ) +{ + *text = ""; + if ( !trimWhiteSpace // certain tags always keep whitespace + || !condenseWhiteSpace ) // if true, whitespace is always kept + { + // Keep all the white space. + while ( p && *p + && !StringEqual( p, endTag, caseInsensitive, encoding ) + ) + { + int len; + char cArr[4] = { 0, 0, 0, 0 }; + p = GetChar( p, cArr, &len, encoding ); + text->append( cArr, len ); + } + } + else + { + bool whitespace = false; + + // Remove leading white space: + p = SkipWhiteSpace( p, encoding ); + while ( p && *p + && !StringEqual( p, endTag, caseInsensitive, encoding ) ) + { + if ( *p == '\r' || *p == '\n' ) + { + whitespace = true; + ++p; + } + else if ( IsWhiteSpace( *p ) ) + { + whitespace = true; + ++p; + } + else + { + // If we've found whitespace, add it before the + // new character. Any whitespace just becomes a space. + if ( whitespace ) + { + (*text) += ' '; + whitespace = false; + } + int len; + char cArr[4] = { 0, 0, 0, 0 }; + p = GetChar( p, cArr, &len, encoding ); + if ( len == 1 ) + (*text) += cArr[0]; // more efficient + else + text->append( cArr, len ); + } + } + } + if ( p ) + p += strlen( endTag ); + return p; +} + +#ifdef TIXML_USE_STL + +void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + // The basic issue with a document is that we don't know what we're + // streaming. Read something presumed to be a tag (and hope), then + // identify it, and call the appropriate stream method on the tag. + // + // This "pre-streaming" will never read the closing ">" so the + // sub-tag can orient itself. + + if ( !StreamTo( in, '<', tag ) ) + { + SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + while ( in->good() ) + { + int tagIndex = (int) tag->length(); + while ( in->good() && in->peek() != '>' ) + { + int c = in->get(); + if ( c <= 0 ) + { + SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + break; + } + (*tag) += (char) c; + } + + if ( in->good() ) + { + // We now have something we presume to be a node of + // some sort. Identify it, and call the node to + // continue streaming. + TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING ); + + if ( node ) + { + node->StreamIn( in, tag ); + bool isElement = node->ToElement() != 0; + delete node; + node = 0; + + // If this is the root element, we're done. Parsing will be + // done by the >> operator. + if ( isElement ) + { + return; + } + } + else + { + SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + } + } + // We should have returned sooner. + SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN ); +} + +#endif + +const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding ) +{ + ClearError(); + + // Parse away, at the document level. Since a document + // contains nothing but other tags, most of what happens + // here is skipping white space. + if ( !p || !*p ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + // Note that, for a document, this needs to come + // before the while space skip, so that parsing + // starts from the pointer we are given. + location.Clear(); + if ( prevData ) + { + location.row = prevData->cursor.row; + location.col = prevData->cursor.col; + } + else + { + location.row = 0; + location.col = 0; + } + TiXmlParsingData data( p, TabSize(), location.row, location.col ); + location = data.Cursor(); + + if ( encoding == TIXML_ENCODING_UNKNOWN ) + { + // Check for the Microsoft UTF-8 lead bytes. + const unsigned char* pU = (const unsigned char*)p; + if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0 + && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1 + && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 ) + { + encoding = TIXML_ENCODING_UTF8; + useMicrosoftBOM = true; + } + } + + p = SkipWhiteSpace( p, encoding ); + if ( !p ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN ); + return 0; + } + + while ( p && *p ) + { + TiXmlNode* node = Identify( p, encoding ); + if ( node ) + { + p = node->Parse( p, &data, encoding ); + LinkEndChild( node ); + } + else + { + break; + } + + // Did we get encoding info? + if ( encoding == TIXML_ENCODING_UNKNOWN + && node->ToDeclaration() ) + { + TiXmlDeclaration* dec = node->ToDeclaration(); + const char* enc = dec->Encoding(); + assert( enc ); + + if ( *enc == 0 ) + encoding = TIXML_ENCODING_UTF8; + else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) ) + encoding = TIXML_ENCODING_UTF8; + else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) ) + encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice + else + encoding = TIXML_ENCODING_LEGACY; + } + + p = SkipWhiteSpace( p, encoding ); + } + + // Was this empty? + if ( !firstChild ) + { + SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding ); + return 0; + } + + // All is well. + return p; +} + +void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + // The first error in a chain is more accurate - don't set again! + if ( error ) + return; + + assert( err > 0 && err < TIXML_ERROR_STRING_COUNT ); + error = true; + errorId = err; + errorDesc = errorString[ errorId ]; + + errorLocation.Clear(); + if ( pError && data ) + { + data->Stamp( pError, encoding ); + errorLocation = data->Cursor(); + } +} + + +TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding ) +{ + TiXmlNode* returnNode = 0; + + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p || *p != '<' ) + { + return 0; + } + + TiXmlDocument* doc = GetDocument(); + p = SkipWhiteSpace( p, encoding ); + + if ( !p || !*p ) + { + return 0; + } + + // What is this thing? + // - Elements start with a letter or underscore, but xml is reserved. + // - Comments: <!-- + // - Decleration: <?xml + // - Everthing else is unknown to tinyxml. + // + + const char* xmlHeader = { "<?xml" }; + const char* commentHeader = { "<!--" }; + const char* dtdHeader = { "<!" }; + const char* cdataHeader = { "<![CDATA[" }; + + if ( StringEqual( p, xmlHeader, true, encoding ) ) + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing Declaration\n" ); +#endif + returnNode = new TiXmlDeclaration(); + } + else if ( StringEqual( p, commentHeader, false, encoding ) ) + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing Comment\n" ); +#endif + returnNode = new TiXmlComment(); + } + else if ( StringEqual( p, cdataHeader, false, encoding ) ) + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing CDATA\n" ); +#endif + TiXmlText* text = new TiXmlText( "" ); + text->SetCDATA( true ); + returnNode = text; + } + else if ( StringEqual( p, dtdHeader, false, encoding ) ) + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing Unknown(1)\n" ); +#endif + returnNode = new TiXmlUnknown(); + } + else if ( IsAlpha( *(p+1), encoding ) + || *(p+1) == '_' ) + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing Element\n" ); +#endif + returnNode = new TiXmlElement( "" ); + } + else + { +#ifdef DEBUG_PARSER + TIXML_LOG( "XML parsing Unknown(2)\n" ); +#endif + returnNode = new TiXmlUnknown(); + } + + if ( returnNode ) + { + // Set the parent, so it can report errors + returnNode->parent = this; + } + else + { + if ( doc ) + doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN ); + } + return returnNode; +} + +#ifdef TIXML_USE_STL + +void TiXmlElement::StreamIn (std::istream * in, TIXML_STRING * tag) +{ + // We're called with some amount of pre-parsing. That is, some of "this" + // element is in "tag". Go ahead and stream to the closing ">" + while ( in->good() ) + { + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + (*tag) += (char) c ; + + if ( c == '>' ) + break; + } + + if ( tag->length() < 3 ) return; + + // Okay...if we are a "/>" tag, then we're done. We've read a complete tag. + // If not, identify and stream. + + if ( tag->at( tag->length() - 1 ) == '>' + && tag->at( tag->length() - 2 ) == '/' ) + { + // All good! + return; + } + else if ( tag->at( tag->length() - 1 ) == '>' ) + { + // There is more. Could be: + // text + // cdata text (which looks like another node) + // closing tag + // another node. + for ( ;; ) + { + StreamWhiteSpace( in, tag ); + + // Do we have text? + if ( in->good() && in->peek() != '<' ) + { + // Yep, text. + TiXmlText text( "" ); + text.StreamIn( in, tag ); + + // What follows text is a closing tag or another node. + // Go around again and figure it out. + continue; + } + + // We now have either a closing tag...or another node. + // We should be at a "<", regardless. + if ( !in->good() ) return; + assert( in->peek() == '<' ); + int tagIndex = (int) tag->length(); + + bool closingTag = false; + bool firstCharFound = false; + + for ( ;; ) + { + if ( !in->good() ) + return; + + int c = in->peek(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + if ( c == '>' ) + break; + + *tag += (char) c; + in->get(); + + // Early out if we find the CDATA id. + if ( c == '[' && tag->size() >= 9 ) + { + size_t len = tag->size(); + const char* start = tag->c_str() + len - 9; + if ( strcmp( start, "<![CDATA[" ) == 0 ) + { + assert( !closingTag ); + break; + } + } + + if ( !firstCharFound && c != '<' && !IsWhiteSpace( c ) ) + { + firstCharFound = true; + if ( c == '/' ) + closingTag = true; + } + } + // If it was a closing tag, then read in the closing '>' to clean up the input stream. + // If it was not, the streaming will be done by the tag. + if ( closingTag ) + { + if ( !in->good() ) + return; + + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + assert( c == '>' ); + *tag += (char) c; + + // We are done, once we've found our closing tag. + return; + } + else + { + // If not a closing tag, id it, and stream. + const char* tagloc = tag->c_str() + tagIndex; + TiXmlNode* node = Identify( tagloc, TIXML_DEFAULT_ENCODING ); + if ( !node ) + return; + node->StreamIn( in, tag ); + delete node; + node = 0; + + // No return: go around from the beginning: text, closing tag, or node. + } + } + } +} +#endif + +const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + p = SkipWhiteSpace( p, encoding ); + TiXmlDocument* document = GetDocument(); + + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding ); + return 0; + } + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + + if ( *p != '<' ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding ); + return 0; + } + + p = SkipWhiteSpace( p+1, encoding ); + + // Read the name. + const char* pErr = p; + + p = ReadName( p, &value, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding ); + return 0; + } + + TIXML_STRING endTag ("</"); + endTag += value; + endTag += ">"; + + // Check for and read attributes. Also look for an empty + // tag or an end tag. + while ( p && *p ) + { + pErr = p; + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); + return 0; + } + if ( *p == '/' ) + { + ++p; + // Empty tag. + if ( *p != '>' ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding ); + return 0; + } + return (p+1); + } + else if ( *p == '>' ) + { + // Done with attributes (if there were any.) + // Read the value -- which can include other + // elements -- read the end tag, and return. + ++p; + p = ReadValue( p, data, encoding ); // Note this is an Element method, and will set the error if one happens. + if ( !p || !*p ) + { + // We were looking for the end tag, but found nothing. + // Fix for [ 1663758 ] Failure to report error on bad XML + if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding ); + return 0; + } + + // We should find the end tag now + if ( StringEqual( p, endTag.c_str(), false, encoding ) ) + { + p += endTag.length(); + return p; + } + else + { + if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding ); + return 0; + } + } + else + { + // Try to read an attribute: + TiXmlAttribute* attrib = new TiXmlAttribute(); + if ( !attrib ) + { + if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, pErr, data, encoding ); + return 0; + } + + attrib->SetDocument( document ); + pErr = p; + p = attrib->Parse( p, data, encoding ); + + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding ); + delete attrib; + return 0; + } + + // Handle the strange case of double attributes: +#ifdef TIXML_USE_STL + TiXmlAttribute* node = attributeSet.Find( attrib->NameTStr() ); +#else + TiXmlAttribute* node = attributeSet.Find( attrib->Name() ); +#endif + if ( node ) + { + node->SetValue( attrib->Value() ); + delete attrib; + return 0; + } + + attributeSet.Add( attrib ); + } + } + return p; +} + + +const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + TiXmlDocument* document = GetDocument(); + + // Read in text and elements in any order. + const char* pWithWhiteSpace = p; + p = SkipWhiteSpace( p, encoding ); + + while ( p && *p ) + { + if ( *p != '<' ) + { + // Take what we have, make a text element. + TiXmlText* textNode = new TiXmlText( "" ); + + if ( !textNode ) + { + if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, encoding ); + return 0; + } + + if ( TiXmlBase::IsWhiteSpaceCondensed() ) + { + p = textNode->Parse( p, data, encoding ); + } + else + { + // Special case: we want to keep the white space + // so that leading spaces aren't removed. + p = textNode->Parse( pWithWhiteSpace, data, encoding ); + } + + if ( !textNode->Blank() ) + LinkEndChild( textNode ); + else + delete textNode; + } + else + { + // We hit a '<' + // Have we hit a new element or an end tag? This could also be + // a TiXmlText in the "CDATA" style. + if ( StringEqual( p, "</", false, encoding ) ) + { + return p; + } + else + { + TiXmlNode* node = Identify( p, encoding ); + if ( node ) + { + p = node->Parse( p, data, encoding ); + LinkEndChild( node ); + } + else + { + return 0; + } + } + } + pWithWhiteSpace = p; + p = SkipWhiteSpace( p, encoding ); + } + + if ( !p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ELEMENT_VALUE, 0, 0, encoding ); + } + return p; +} + + +#ifdef TIXML_USE_STL +void TiXmlUnknown::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + (*tag) += (char) c; + + if ( c == '>' ) + { + // All is well. + return; + } + } +} +#endif + + +const char* TiXmlUnknown::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + TiXmlDocument* document = GetDocument(); + p = SkipWhiteSpace( p, encoding ); + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + if ( !p || !*p || *p != '<' ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, p, data, encoding ); + return 0; + } + ++p; + value = ""; + + while ( p && *p && *p != '>' ) + { + value += *p; + ++p; + } + + if ( !p ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding ); + } + if ( *p == '>' ) + return p+1; + return p; +} + +#ifdef TIXML_USE_STL +void TiXmlComment::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + (*tag) += (char) c; + + if ( c == '>' + && tag->at( tag->length() - 2 ) == '-' + && tag->at( tag->length() - 3 ) == '-' ) + { + // All is well. + return; + } + } +} +#endif + + +const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + TiXmlDocument* document = GetDocument(); + value = ""; + + p = SkipWhiteSpace( p, encoding ); + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + const char* startTag = "<!--"; + const char* endTag = "-->"; + + if ( !StringEqual( p, startTag, false, encoding ) ) + { + document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding ); + return 0; + } + p += strlen( startTag ); + + // [ 1475201 ] TinyXML parses entities in comments + // Oops - ReadText doesn't work, because we don't want to parse the entities. + // p = ReadText( p, &value, false, endTag, false, encoding ); + // + // from the XML spec: + /* + [Definition: Comments may appear anywhere in a document outside other markup; in addition, + they may appear within the document type declaration at places allowed by the grammar. + They are not part of the document's character data; an XML processor MAY, but need not, + make it possible for an application to retrieve the text of comments. For compatibility, + the string "--" (double-hyphen) MUST NOT occur within comments.] Parameter entity + references MUST NOT be recognized within comments. + + An example of a comment: + + <!-- declarations for <head> & <body> --> + */ + + value = ""; + // Keep all the white space. + while ( p && *p && !StringEqual( p, endTag, false, encoding ) ) + { + value.append( p, 1 ); + ++p; + } + if ( p ) + p += strlen( endTag ); + + return p; +} + + +const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p ) return 0; + +// int tabsize = 4; +// if ( document ) +// tabsize = document->TabSize(); + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + // Read the name, the '=' and the value. + const char* pErr = p; + p = ReadName( p, &name, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding ); + return 0; + } + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p || *p != '=' ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + + ++p; // skip '=' + p = SkipWhiteSpace( p, encoding ); + if ( !p || !*p ) + { + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + + const char* end; + const char SINGLE_QUOTE = '\''; + const char DOUBLE_QUOTE = '\"'; + + if ( *p == SINGLE_QUOTE ) + { + ++p; + end = "\'"; // single quote in string + p = ReadText( p, &value, false, end, false, encoding ); + } + else if ( *p == DOUBLE_QUOTE ) + { + ++p; + end = "\""; // double quote in string + p = ReadText( p, &value, false, end, false, encoding ); + } + else + { + // All attribute values should be in single or double quotes. + // But this is such a common error that the parser will try + // its best, even without them. + value = ""; + while ( p && *p // existence + && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace + && *p != '/' && *p != '>' ) // tag end + { + if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) + { + // [ 1451649 ] Attribute values with trailing quotes not handled correctly + // We did not have an opening quote but seem to have a + // closing one. Give up and throw an error. + if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding ); + return 0; + } + value += *p; + ++p; + } + } + return p; +} + +#ifdef TIXML_USE_STL +void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->peek(); + if ( !cdata && (c == '<' ) ) + { + return; + } + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + + (*tag) += (char) c; + in->get(); // "commits" the peek made above + + if ( cdata && c == '>' && tag->size() >= 3 ) + { + size_t len = tag->size(); + if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) + { + // terminator of cdata. + return; + } + } + } +} +#endif + +const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding ) +{ + value = ""; + TiXmlDocument* document = GetDocument(); + + if ( data ) + { + data->Stamp( p, encoding ); + location = data->Cursor(); + } + + const char* const startTag = "<![CDATA["; + const char* const endTag = "]]>"; + + if ( cdata || StringEqual( p, startTag, false, encoding ) ) + { + cdata = true; + + if ( !StringEqual( p, startTag, false, encoding ) ) + { + document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding ); + return 0; + } + p += strlen( startTag ); + + // Keep all the white space, ignore the encoding, etc. + while ( p && *p + && !StringEqual( p, endTag, false, encoding ) + ) + { + value += *p; + ++p; + } + + TIXML_STRING dummy; + p = ReadText( p, &dummy, false, endTag, false, encoding ); + return p; + } + else + { + bool ignoreWhite = true; + + const char* end = "<"; + p = ReadText( p, &value, ignoreWhite, end, false, encoding ); + if ( p ) + return p-1; // don't truncate the '<' + return 0; + } +} + +#ifdef TIXML_USE_STL +void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag ) +{ + while ( in->good() ) + { + int c = in->get(); + if ( c <= 0 ) + { + TiXmlDocument* document = GetDocument(); + if ( document ) + document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); + return; + } + (*tag) += (char) c; + + if ( c == '>' ) + { + // All is well. + return; + } + } +} +#endif + +const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) +{ + p = SkipWhiteSpace( p, _encoding ); + // Find the beginning, find the end, and look for + // the stuff in-between. + TiXmlDocument* document = GetDocument(); + if ( !p || !*p || !StringEqual( p, "<?xml", true, _encoding ) ) + { + if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); + return 0; + } + if ( data ) + { + data->Stamp( p, _encoding ); + location = data->Cursor(); + } + p += 5; + + version = ""; + encoding = ""; + standalone = ""; + + while ( p && *p ) + { + if ( *p == '>' ) + { + ++p; + return p; + } + + p = SkipWhiteSpace( p, _encoding ); + if ( StringEqual( p, "version", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + version = attrib.Value(); + } + else if ( StringEqual( p, "encoding", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + encoding = attrib.Value(); + } + else if ( StringEqual( p, "standalone", true, _encoding ) ) + { + TiXmlAttribute attrib; + p = attrib.Parse( p, data, _encoding ); + standalone = attrib.Value(); + } + else + { + // Read over whatever it is. + while ( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) + ++p; + } + } + return 0; +} + +bool TiXmlText::Blank() const +{ + for ( unsigned i=0; i<value.length(); i++ ) + if ( !IsWhiteSpace( value[i] ) ) + return false; + return true; +} + diff --git a/shared/tinyxml/utf8test.gif b/shared/tinyxml/utf8test.gif Binary files differnew file mode 100644 index 00000000..0911070e --- /dev/null +++ b/shared/tinyxml/utf8test.gif diff --git a/shared/tinyxml/utf8test.xml b/shared/tinyxml/utf8test.xml new file mode 100644 index 00000000..4fd71ce8 --- /dev/null +++ b/shared/tinyxml/utf8test.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document> + <English name="name" value="value">The world has many languages</English> + <Russian name="название(имÑ)" value="ценноÑÑ‚ÑŒ">Мир имеет много Ñзыков</Russian> + <Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish> + <SimplifiedChinese name="åå—" value="价值">世界有很多è¯è¨€</SimplifiedChinese> + <РуÑÑкий название="name" ценноÑÑ‚ÑŒ="value"><имеет></РуÑÑкий> + <æ±‰è¯ åå—="name" 价值="value">世界有很多è¯è¨€</汉è¯> + <Heavy>"Mëtæl!"</Heavy> + <ä>Umlaut Element</ä> +</document> diff --git a/shared/tinyxml/utf8testverify.xml b/shared/tinyxml/utf8testverify.xml new file mode 100644 index 00000000..91a319df --- /dev/null +++ b/shared/tinyxml/utf8testverify.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<document> + <English name="name" value="value">The world has many languages</English> + <Russian name="название(имÑ)" value="ценноÑÑ‚ÑŒ">Мир имеет много Ñзыков</Russian> + <Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish> + <SimplifiedChinese name="åå—" value="价值">世界有很多è¯è¨€</SimplifiedChinese> + <РуÑÑкий название="name" ценноÑÑ‚ÑŒ="value"><имеет></РуÑÑкий> + <æ±‰è¯ åå—="name" 价值="value">世界有很多è¯è¨€</汉è¯> + <Heavy>"Mëtæl!"</Heavy> + <ä>Umlaut Element</ä> +</document> diff --git a/shared/tinyxml/xmltest.cpp b/shared/tinyxml/xmltest.cpp new file mode 100644 index 00000000..5ae3922c --- /dev/null +++ b/shared/tinyxml/xmltest.cpp @@ -0,0 +1,1294 @@ +/* + Test program for TinyXML. +*/ + + +#ifdef TIXML_USE_STL + #include <iostream> + #include <sstream> + using namespace std; +#else + #include <stdio.h> +#endif + +#if defined( WIN32 ) && defined( TUNE ) + #include <crtdbg.h> + _CrtMemState startMemState; + _CrtMemState endMemState; +#endif + +#include "tinyxml.h" + +static int gPass = 0; +static int gFail = 0; + + +bool XmlTest (const char* testString, const char* expected, const char* found, bool noEcho = false) +{ + bool pass = !strcmp( expected, found ); + if ( pass ) + printf ("[pass]"); + else + printf ("[fail]"); + + if ( noEcho ) + printf (" %s\n", testString); + else + printf (" %s [%s][%s]\n", testString, expected, found); + + if ( pass ) + ++gPass; + else + ++gFail; + return pass; +} + + +bool XmlTest( const char* testString, int expected, int found, bool noEcho = false ) +{ + bool pass = ( expected == found ); + if ( pass ) + printf ("[pass]"); + else + printf ("[fail]"); + + if ( noEcho ) + printf (" %s\n", testString); + else + printf (" %s [%d][%d]\n", testString, expected, found); + + if ( pass ) + ++gPass; + else + ++gFail; + return pass; +} + + +// +// This file demonstrates some basic functionality of TinyXml. +// Note that the example is very contrived. It presumes you know +// what is in the XML file. But it does test the basic operations, +// and show how to add and remove nodes. +// + +int main() +{ + // + // We start with the 'demoStart' todo list. Process it. And + // should hopefully end up with the todo list as illustrated. + // + const char* demoStart = + "<?xml version=\"1.0\" standalone='no' >\n" + "<!-- Our to do list data -->" + "<ToDo>\n" + "<!-- Do I need a secure PDA? -->\n" + "<Item priority=\"1\" distance='close'> Go to the <bold>Toy store!</bold></Item>" + "<Item priority=\"2\" distance='none'> Do bills </Item>" + "<Item priority=\"2\" distance='far & back'> Look for Evil Dinosaurs! </Item>" + "</ToDo>"; + + { + + #ifdef TIXML_USE_STL + /* What the todo list should look like after processing. + In stream (no formatting) representation. */ + const char* demoEnd = + "<?xml version=\"1.0\" standalone=\"no\" ?>" + "<!-- Our to do list data -->" + "<ToDo>" + "<!-- Do I need a secure PDA? -->" + "<Item priority=\"2\" distance=\"close\">Go to the" + "<bold>Toy store!" + "</bold>" + "</Item>" + "<Item priority=\"1\" distance=\"far\">Talk to:" + "<Meeting where=\"School\">" + "<Attendee name=\"Marple\" position=\"teacher\" />" + "<Attendee name=\"Voel\" position=\"counselor\" />" + "</Meeting>" + "<Meeting where=\"Lunch\" />" + "</Item>" + "<Item priority=\"2\" distance=\"here\">Do bills" + "</Item>" + "</ToDo>"; + #endif + + // The example parses from the character string (above): + #if defined( WIN32 ) && defined( TUNE ) + _CrtMemCheckpoint( &startMemState ); + #endif + + { + // Write to a file and read it back, to check file I/O. + + TiXmlDocument doc( "demotest.xml" ); + doc.Parse( demoStart ); + + if ( doc.Error() ) + { + printf( "Error in %s: %s\n", doc.Value(), doc.ErrorDesc() ); + exit( 1 ); + } + doc.SaveFile(); + } + + TiXmlDocument doc( "demotest.xml" ); + bool loadOkay = doc.LoadFile(); + + if ( !loadOkay ) + { + printf( "Could not load test file 'demotest.xml'. Error='%s'. Exiting.\n", doc.ErrorDesc() ); + exit( 1 ); + } + + printf( "** Demo doc read from disk: ** \n\n" ); + printf( "** Printing via doc.Print **\n" ); + doc.Print( stdout ); + + { + printf( "** Printing via TiXmlPrinter **\n" ); + TiXmlPrinter printer; + doc.Accept( &printer ); + fprintf( stdout, "%s", printer.CStr() ); + } + #ifdef TIXML_USE_STL + { + printf( "** Printing via operator<< **\n" ); + std::cout << doc; + } + #endif + TiXmlNode* node = 0; + TiXmlElement* todoElement = 0; + TiXmlElement* itemElement = 0; + + + // -------------------------------------------------------- + // An example of changing existing attributes, and removing + // an element from the document. + // -------------------------------------------------------- + + // Get the "ToDo" element. + // It is a child of the document, and can be selected by name. + node = doc.FirstChild( "ToDo" ); + assert( node ); + todoElement = node->ToElement(); + assert( todoElement ); + + // Going to the toy store is now our second priority... + // So set the "priority" attribute of the first item in the list. + node = todoElement->FirstChildElement(); // This skips the "PDA" comment. + assert( node ); + itemElement = node->ToElement(); + assert( itemElement ); + itemElement->SetAttribute( "priority", 2 ); + + // Change the distance to "doing bills" from + // "none" to "here". It's the next sibling element. + itemElement = itemElement->NextSiblingElement(); + assert( itemElement ); + itemElement->SetAttribute( "distance", "here" ); + + // Remove the "Look for Evil Dinosaurs!" item. + // It is 1 more sibling away. We ask the parent to remove + // a particular child. + itemElement = itemElement->NextSiblingElement(); + todoElement->RemoveChild( itemElement ); + + itemElement = 0; + + // -------------------------------------------------------- + // What follows is an example of created elements and text + // nodes and adding them to the document. + // -------------------------------------------------------- + + // Add some meetings. + TiXmlElement item( "Item" ); + item.SetAttribute( "priority", "1" ); + item.SetAttribute( "distance", "far" ); + + TiXmlText text( "Talk to:" ); + + TiXmlElement meeting1( "Meeting" ); + meeting1.SetAttribute( "where", "School" ); + + TiXmlElement meeting2( "Meeting" ); + meeting2.SetAttribute( "where", "Lunch" ); + + TiXmlElement attendee1( "Attendee" ); + attendee1.SetAttribute( "name", "Marple" ); + attendee1.SetAttribute( "position", "teacher" ); + + TiXmlElement attendee2( "Attendee" ); + attendee2.SetAttribute( "name", "Voel" ); + attendee2.SetAttribute( "position", "counselor" ); + + // Assemble the nodes we've created: + meeting1.InsertEndChild( attendee1 ); + meeting1.InsertEndChild( attendee2 ); + + item.InsertEndChild( text ); + item.InsertEndChild( meeting1 ); + item.InsertEndChild( meeting2 ); + + // And add the node to the existing list after the first child. + node = todoElement->FirstChild( "Item" ); + assert( node ); + itemElement = node->ToElement(); + assert( itemElement ); + + todoElement->InsertAfterChild( itemElement, item ); + + printf( "\n** Demo doc processed: ** \n\n" ); + doc.Print( stdout ); + + + #ifdef TIXML_USE_STL + printf( "** Demo doc processed to stream: ** \n\n" ); + cout << doc << endl << endl; + #endif + + // -------------------------------------------------------- + // Different tests...do we have what we expect? + // -------------------------------------------------------- + + int count = 0; + TiXmlElement* element; + + ////////////////////////////////////////////////////// + + #ifdef TIXML_USE_STL + cout << "** Basic structure. **\n"; + ostringstream outputStream( ostringstream::out ); + outputStream << doc; + XmlTest( "Output stream correct.", string( demoEnd ).c_str(), + outputStream.str().c_str(), true ); + #endif + + node = doc.RootElement(); + assert( node ); + XmlTest( "Root element exists.", true, ( node != 0 && node->ToElement() ) ); + XmlTest ( "Root element value is 'ToDo'.", "ToDo", node->Value()); + + node = node->FirstChild(); + XmlTest( "First child exists & is a comment.", true, ( node != 0 && node->ToComment() ) ); + node = node->NextSibling(); + XmlTest( "Sibling element exists & is an element.", true, ( node != 0 && node->ToElement() ) ); + XmlTest ( "Value is 'Item'.", "Item", node->Value() ); + + node = node->FirstChild(); + XmlTest ( "First child exists.", true, ( node != 0 && node->ToText() ) ); + XmlTest ( "Value is 'Go to the'.", "Go to the", node->Value() ); + + + ////////////////////////////////////////////////////// + printf ("\n** Iterators. **\n"); + + // Walk all the top level nodes of the document. + count = 0; + for( node = doc.FirstChild(); + node; + node = node->NextSibling() ) + { + count++; + } + XmlTest( "Top level nodes, using First / Next.", 3, count ); + + count = 0; + for( node = doc.LastChild(); + node; + node = node->PreviousSibling() ) + { + count++; + } + XmlTest( "Top level nodes, using Last / Previous.", 3, count ); + + // Walk all the top level nodes of the document, + // using a different syntax. + count = 0; + for( node = doc.IterateChildren( 0 ); + node; + node = doc.IterateChildren( node ) ) + { + count++; + } + XmlTest( "Top level nodes, using IterateChildren.", 3, count ); + + // Walk all the elements in a node. + count = 0; + for( element = todoElement->FirstChildElement(); + element; + element = element->NextSiblingElement() ) + { + count++; + } + XmlTest( "Children of the 'ToDo' element, using First / Next.", + 3, count ); + + // Walk all the elements in a node by value. + count = 0; + for( node = todoElement->FirstChild( "Item" ); + node; + node = node->NextSibling( "Item" ) ) + { + count++; + } + XmlTest( "'Item' children of the 'ToDo' element, using First/Next.", 3, count ); + + count = 0; + for( node = todoElement->LastChild( "Item" ); + node; + node = node->PreviousSibling( "Item" ) ) + { + count++; + } + XmlTest( "'Item' children of the 'ToDo' element, using Last/Previous.", 3, count ); + + #ifdef TIXML_USE_STL + { + cout << "\n** Parsing. **\n"; + istringstream parse0( "<Element0 attribute0='foo0' attribute1= noquotes attribute2 = '>' />" ); + TiXmlElement element0( "default" ); + parse0 >> element0; + + XmlTest ( "Element parsed, value is 'Element0'.", "Element0", element0.Value() ); + XmlTest ( "Reads attribute 'attribute0=\"foo0\"'.", "foo0", element0.Attribute( "attribute0" )); + XmlTest ( "Reads incorrectly formatted 'attribute1=noquotes'.", "noquotes", element0.Attribute( "attribute1" ) ); + XmlTest ( "Read attribute with entity value '>'.", ">", element0.Attribute( "attribute2" ) ); + } + #endif + + { + const char* error = "<?xml version=\"1.0\" standalone=\"no\" ?>\n" + "<passages count=\"006\" formatversion=\"20020620\">\n" + " <wrong error>\n" + "</passages>"; + + TiXmlDocument docTest; + docTest.Parse( error ); + XmlTest( "Error row", docTest.ErrorRow(), 3 ); + XmlTest( "Error column", docTest.ErrorCol(), 17 ); + //printf( "error=%d id='%s' row %d col%d\n", (int) doc.Error(), doc.ErrorDesc(), doc.ErrorRow()+1, doc.ErrorCol() + 1 ); + + } + + #ifdef TIXML_USE_STL + { + ////////////////////////////////////////////////////// + cout << "\n** Streaming. **\n"; + + // Round trip check: stream in, then stream back out to verify. The stream + // out has already been checked, above. We use the output + + istringstream inputStringStream( outputStream.str() ); + TiXmlDocument document0; + + inputStringStream >> document0; + + ostringstream outputStream0( ostringstream::out ); + outputStream0 << document0; + + XmlTest( "Stream round trip correct.", string( demoEnd ).c_str(), + outputStream0.str().c_str(), true ); + + std::string str; + str << document0; + + XmlTest( "String printing correct.", string( demoEnd ).c_str(), + str.c_str(), true ); + } + #endif + } + + { + const char* str = "<doc attr0='1' attr1='2.0' attr2='foo' />"; + + TiXmlDocument doc; + doc.Parse( str ); + + TiXmlElement* ele = doc.FirstChildElement(); + + int iVal, result; + double dVal; + + result = ele->QueryDoubleAttribute( "attr0", &dVal ); + XmlTest( "Query attribute: int as double", result, TIXML_SUCCESS ); + XmlTest( "Query attribute: int as double", (int)dVal, 1 ); + result = ele->QueryDoubleAttribute( "attr1", &dVal ); + XmlTest( "Query attribute: double as double", (int)dVal, 2 ); + result = ele->QueryIntAttribute( "attr1", &iVal ); + XmlTest( "Query attribute: double as int", result, TIXML_SUCCESS ); + XmlTest( "Query attribute: double as int", iVal, 2 ); + result = ele->QueryIntAttribute( "attr2", &iVal ); + XmlTest( "Query attribute: not a number", result, TIXML_WRONG_TYPE ); + result = ele->QueryIntAttribute( "bar", &iVal ); + XmlTest( "Query attribute: does not exist", result, TIXML_NO_ATTRIBUTE ); + } + + { + const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n" + "</room>"; + + TiXmlDocument doc; + doc.SetTabSize( 8 ); + doc.Parse( str ); + + TiXmlHandle docHandle( &doc ); + TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" ); + + assert( docHandle.Node() ); + assert( roomHandle.Element() ); + + TiXmlElement* room = roomHandle.Element(); + assert( room ); + TiXmlAttribute* doors = room->FirstAttribute(); + assert( doors ); + + XmlTest( "Location tracking: Tab 8: room row", room->Row(), 1 ); + XmlTest( "Location tracking: Tab 8: room col", room->Column(), 49 ); + XmlTest( "Location tracking: Tab 8: doors row", doors->Row(), 1 ); + XmlTest( "Location tracking: Tab 8: doors col", doors->Column(), 55 ); + } + + { + const char* str = "\t<?xml version=\"1.0\" standalone=\"no\" ?>\t<room doors='2'>\n" + " <!-- Silly example -->\n" + " <door wall='north'>A great door!</door>\n" + "\t<door wall='east'/>" + "</room>"; + + TiXmlDocument doc; + doc.Parse( str ); + + TiXmlHandle docHandle( &doc ); + TiXmlHandle roomHandle = docHandle.FirstChildElement( "room" ); + TiXmlHandle commentHandle = docHandle.FirstChildElement( "room" ).FirstChild(); + TiXmlHandle textHandle = docHandle.FirstChildElement( "room" ).ChildElement( "door", 0 ).FirstChild(); + TiXmlHandle door0Handle = docHandle.FirstChildElement( "room" ).ChildElement( 0 ); + TiXmlHandle door1Handle = docHandle.FirstChildElement( "room" ).ChildElement( 1 ); + + assert( docHandle.Node() ); + assert( roomHandle.Element() ); + assert( commentHandle.Node() ); + assert( textHandle.Text() ); + assert( door0Handle.Element() ); + assert( door1Handle.Element() ); + + TiXmlDeclaration* declaration = doc.FirstChild()->ToDeclaration(); + assert( declaration ); + TiXmlElement* room = roomHandle.Element(); + assert( room ); + TiXmlAttribute* doors = room->FirstAttribute(); + assert( doors ); + TiXmlText* text = textHandle.Text(); + TiXmlComment* comment = commentHandle.Node()->ToComment(); + assert( comment ); + TiXmlElement* door0 = door0Handle.Element(); + TiXmlElement* door1 = door1Handle.Element(); + + XmlTest( "Location tracking: Declaration row", declaration->Row(), 1 ); + XmlTest( "Location tracking: Declaration col", declaration->Column(), 5 ); + XmlTest( "Location tracking: room row", room->Row(), 1 ); + XmlTest( "Location tracking: room col", room->Column(), 45 ); + XmlTest( "Location tracking: doors row", doors->Row(), 1 ); + XmlTest( "Location tracking: doors col", doors->Column(), 51 ); + XmlTest( "Location tracking: Comment row", comment->Row(), 2 ); + XmlTest( "Location tracking: Comment col", comment->Column(), 3 ); + XmlTest( "Location tracking: text row", text->Row(), 3 ); + XmlTest( "Location tracking: text col", text->Column(), 24 ); + XmlTest( "Location tracking: door0 row", door0->Row(), 3 ); + XmlTest( "Location tracking: door0 col", door0->Column(), 5 ); + XmlTest( "Location tracking: door1 row", door1->Row(), 4 ); + XmlTest( "Location tracking: door1 col", door1->Column(), 5 ); + } + + + // -------------------------------------------------------- + // UTF-8 testing. It is important to test: + // 1. Making sure name, value, and text read correctly + // 2. Row, Col functionality + // 3. Correct output + // -------------------------------------------------------- + printf ("\n** UTF-8 **\n"); + { + TiXmlDocument doc( "utf8test.xml" ); + doc.LoadFile(); + if ( doc.Error() && doc.ErrorId() == TiXmlBase::TIXML_ERROR_OPENING_FILE ) { + printf( "WARNING: File 'utf8test.xml' not found.\n" + "(Are you running the test from the wrong directory?)\n" + "Could not test UTF-8 functionality.\n" ); + } + else + { + TiXmlHandle docH( &doc ); + // Get the attribute "value" from the "Russian" element and check it. + TiXmlElement* element = docH.FirstChildElement( "document" ).FirstChildElement( "Russian" ).Element(); + const unsigned char correctValue[] = { 0xd1U, 0x86U, 0xd0U, 0xb5U, 0xd0U, 0xbdU, 0xd0U, 0xbdU, + 0xd0U, 0xbeU, 0xd1U, 0x81U, 0xd1U, 0x82U, 0xd1U, 0x8cU, 0 }; + + XmlTest( "UTF-8: Russian value.", (const char*)correctValue, element->Attribute( "value" ), true ); + XmlTest( "UTF-8: Russian value row.", 4, element->Row() ); + XmlTest( "UTF-8: Russian value column.", 5, element->Column() ); + + const unsigned char russianElementName[] = { 0xd0U, 0xa0U, 0xd1U, 0x83U, + 0xd1U, 0x81U, 0xd1U, 0x81U, + 0xd0U, 0xbaU, 0xd0U, 0xb8U, + 0xd0U, 0xb9U, 0 }; + const char russianText[] = "<\xD0\xB8\xD0\xBC\xD0\xB5\xD0\xB5\xD1\x82>"; + + TiXmlText* text = docH.FirstChildElement( "document" ).FirstChildElement( (const char*) russianElementName ).Child( 0 ).Text(); + XmlTest( "UTF-8: Browsing russian element name.", + russianText, + text->Value(), + true ); + XmlTest( "UTF-8: Russian element name row.", 7, text->Row() ); + XmlTest( "UTF-8: Russian element name column.", 47, text->Column() ); + + TiXmlDeclaration* dec = docH.Child( 0 ).Node()->ToDeclaration(); + XmlTest( "UTF-8: Declaration column.", 1, dec->Column() ); + XmlTest( "UTF-8: Document column.", 1, doc.Column() ); + + // Now try for a round trip. + doc.SaveFile( "utf8testout.xml" ); + + // Check the round trip. + char savedBuf[256]; + char verifyBuf[256]; + int okay = 1; + + FILE* saved = fopen( "utf8testout.xml", "r" ); + FILE* verify = fopen( "utf8testverify.xml", "r" ); + if ( saved && verify ) + { + while ( fgets( verifyBuf, 256, verify ) ) + { + fgets( savedBuf, 256, saved ); + if ( strcmp( verifyBuf, savedBuf ) ) + { + okay = 0; + break; + } + } + fclose( saved ); + fclose( verify ); + } + XmlTest( "UTF-8: Verified multi-language round trip.", 1, okay ); + + // On most Western machines, this is an element that contains + // the word "resume" with the correct accents, in a latin encoding. + // It will be something else completely on non-wester machines, + // which is why TinyXml is switching to UTF-8. + const char latin[] = "<element>r\x82sum\x82</element>"; + + TiXmlDocument latinDoc; + latinDoc.Parse( latin, 0, TIXML_ENCODING_LEGACY ); + + text = latinDoc.FirstChildElement()->FirstChild()->ToText(); + XmlTest( "Legacy encoding: Verify text element.", "r\x82sum\x82", text->Value() ); + } + } + + ////////////////////// + // Copy and assignment + ////////////////////// + printf ("\n** Copy and Assignment **\n"); + { + TiXmlElement element( "foo" ); + element.Parse( "<element name='value' />", 0, TIXML_ENCODING_UNKNOWN ); + + TiXmlElement elementCopy( element ); + TiXmlElement elementAssign( "foo" ); + elementAssign.Parse( "<incorrect foo='bar'/>", 0, TIXML_ENCODING_UNKNOWN ); + elementAssign = element; + + XmlTest( "Copy/Assign: element copy #1.", "element", elementCopy.Value() ); + XmlTest( "Copy/Assign: element copy #2.", "value", elementCopy.Attribute( "name" ) ); + XmlTest( "Copy/Assign: element assign #1.", "element", elementAssign.Value() ); + XmlTest( "Copy/Assign: element assign #2.", "value", elementAssign.Attribute( "name" ) ); + XmlTest( "Copy/Assign: element assign #3.", true, ( 0 == elementAssign.Attribute( "foo" )) ); + + TiXmlComment comment; + comment.Parse( "<!--comment-->", 0, TIXML_ENCODING_UNKNOWN ); + TiXmlComment commentCopy( comment ); + TiXmlComment commentAssign; + commentAssign = commentCopy; + XmlTest( "Copy/Assign: comment copy.", "comment", commentCopy.Value() ); + XmlTest( "Copy/Assign: comment assign.", "comment", commentAssign.Value() ); + + TiXmlUnknown unknown; + unknown.Parse( "<[unknown]>", 0, TIXML_ENCODING_UNKNOWN ); + TiXmlUnknown unknownCopy( unknown ); + TiXmlUnknown unknownAssign; + unknownAssign.Parse( "incorrect", 0, TIXML_ENCODING_UNKNOWN ); + unknownAssign = unknownCopy; + XmlTest( "Copy/Assign: unknown copy.", "[unknown]", unknownCopy.Value() ); + XmlTest( "Copy/Assign: unknown assign.", "[unknown]", unknownAssign.Value() ); + + TiXmlText text( "TextNode" ); + TiXmlText textCopy( text ); + TiXmlText textAssign( "incorrect" ); + textAssign = text; + XmlTest( "Copy/Assign: text copy.", "TextNode", textCopy.Value() ); + XmlTest( "Copy/Assign: text assign.", "TextNode", textAssign.Value() ); + + TiXmlDeclaration dec; + dec.Parse( "<?xml version='1.0' encoding='UTF-8'?>", 0, TIXML_ENCODING_UNKNOWN ); + TiXmlDeclaration decCopy( dec ); + TiXmlDeclaration decAssign; + decAssign = dec; + + XmlTest( "Copy/Assign: declaration copy.", "UTF-8", decCopy.Encoding() ); + XmlTest( "Copy/Assign: text assign.", "UTF-8", decAssign.Encoding() ); + + TiXmlDocument doc; + elementCopy.InsertEndChild( textCopy ); + doc.InsertEndChild( decAssign ); + doc.InsertEndChild( elementCopy ); + doc.InsertEndChild( unknownAssign ); + + TiXmlDocument docCopy( doc ); + TiXmlDocument docAssign; + docAssign = docCopy; + + #ifdef TIXML_USE_STL + std::string original, copy, assign; + original << doc; + copy << docCopy; + assign << docAssign; + XmlTest( "Copy/Assign: document copy.", original.c_str(), copy.c_str(), true ); + XmlTest( "Copy/Assign: document assign.", original.c_str(), assign.c_str(), true ); + + #endif + } + + ////////////////////////////////////////////////////// +#ifdef TIXML_USE_STL + printf ("\n** Parsing, no Condense Whitespace **\n"); + TiXmlBase::SetCondenseWhiteSpace( false ); + { + istringstream parse1( "<start>This is \ntext</start>" ); + TiXmlElement text1( "text" ); + parse1 >> text1; + + XmlTest ( "Condense white space OFF.", "This is \ntext", + text1.FirstChild()->Value(), + true ); + } + TiXmlBase::SetCondenseWhiteSpace( true ); +#endif + + ////////////////////////////////////////////////////// + // GetText(); + { + const char* str = "<foo>This is text</foo>"; + TiXmlDocument doc; + doc.Parse( str ); + const TiXmlElement* element = doc.RootElement(); + + XmlTest( "GetText() normal use.", "This is text", element->GetText() ); + + str = "<foo><b>This is text</b></foo>"; + doc.Clear(); + doc.Parse( str ); + element = doc.RootElement(); + + XmlTest( "GetText() contained element.", element->GetText() == 0, true ); + + str = "<foo>This is <b>text</b></foo>"; + doc.Clear(); + TiXmlBase::SetCondenseWhiteSpace( false ); + doc.Parse( str ); + TiXmlBase::SetCondenseWhiteSpace( true ); + element = doc.RootElement(); + + XmlTest( "GetText() partial.", "This is ", element->GetText() ); + } + + + ////////////////////////////////////////////////////// + // CDATA + { + const char* str = "<xmlElement>" + "<![CDATA[" + "I am > the rules!\n" + "...since I make symbolic puns" + "]]>" + "</xmlElement>"; + TiXmlDocument doc; + doc.Parse( str ); + doc.Print(); + + XmlTest( "CDATA parse.", doc.FirstChildElement()->FirstChild()->Value(), + "I am > the rules!\n...since I make symbolic puns", + true ); + + #ifdef TIXML_USE_STL + //cout << doc << '\n'; + + doc.Clear(); + + istringstream parse0( str ); + parse0 >> doc; + //cout << doc << '\n'; + + XmlTest( "CDATA stream.", doc.FirstChildElement()->FirstChild()->Value(), + "I am > the rules!\n...since I make symbolic puns", + true ); + #endif + + TiXmlDocument doc1 = doc; + //doc.Print(); + + XmlTest( "CDATA copy.", doc1.FirstChildElement()->FirstChild()->Value(), + "I am > the rules!\n...since I make symbolic puns", + true ); + } + { + // [ 1482728 ] Wrong wide char parsing + char buf[256]; + buf[255] = 0; + for( int i=0; i<255; ++i ) { + buf[i] = (char)((i>=32) ? i : 32); + } + TIXML_STRING str( "<xmlElement><![CDATA[" ); + str += buf; + str += "]]></xmlElement>"; + + TiXmlDocument doc; + doc.Parse( str.c_str() ); + + TiXmlPrinter printer; + printer.SetStreamPrinting(); + doc.Accept( &printer ); + + XmlTest( "CDATA with all bytes #1.", str.c_str(), printer.CStr(), true ); + + #ifdef TIXML_USE_STL + doc.Clear(); + istringstream iss( printer.Str() ); + iss >> doc; + std::string out; + out << doc; + XmlTest( "CDATA with all bytes #2.", out.c_str(), printer.CStr(), true ); + #endif + } + { + // [ 1480107 ] Bug-fix for STL-streaming of CDATA that contains tags + // CDATA streaming had a couple of bugs, that this tests for. + const char* str = "<xmlElement>" + "<![CDATA[" + "<b>I am > the rules!</b>\n" + "...since I make symbolic puns" + "]]>" + "</xmlElement>"; + TiXmlDocument doc; + doc.Parse( str ); + doc.Print(); + + XmlTest( "CDATA parse. [ 1480107 ]", doc.FirstChildElement()->FirstChild()->Value(), + "<b>I am > the rules!</b>\n...since I make symbolic puns", + true ); + + #ifdef TIXML_USE_STL + + doc.Clear(); + + istringstream parse0( str ); + parse0 >> doc; + + XmlTest( "CDATA stream. [ 1480107 ]", doc.FirstChildElement()->FirstChild()->Value(), + "<b>I am > the rules!</b>\n...since I make symbolic puns", + true ); + #endif + + TiXmlDocument doc1 = doc; + //doc.Print(); + + XmlTest( "CDATA copy. [ 1480107 ]", doc1.FirstChildElement()->FirstChild()->Value(), + "<b>I am > the rules!</b>\n...since I make symbolic puns", + true ); + } + ////////////////////////////////////////////////////// + // Visit() + + + + ////////////////////////////////////////////////////// + printf( "\n** Fuzzing... **\n" ); + + const int FUZZ_ITERATION = 300; + + // The only goal is not to crash on bad input. + int len = (int) strlen( demoStart ); + for( int i=0; i<FUZZ_ITERATION; ++i ) + { + char* demoCopy = new char[ len+1 ]; + strcpy( demoCopy, demoStart ); + + demoCopy[ i%len ] = (char)((i+1)*3); + demoCopy[ (i*7)%len ] = '>'; + demoCopy[ (i*11)%len ] = '<'; + + TiXmlDocument xml; + xml.Parse( demoCopy ); + + delete [] demoCopy; + } + printf( "** Fuzzing Complete. **\n" ); + + ////////////////////////////////////////////////////// + printf ("\n** Bug regression tests **\n"); + + // InsertBeforeChild and InsertAfterChild causes crash. + { + TiXmlElement parent( "Parent" ); + TiXmlElement childText0( "childText0" ); + TiXmlElement childText1( "childText1" ); + TiXmlNode* childNode0 = parent.InsertEndChild( childText0 ); + TiXmlNode* childNode1 = parent.InsertBeforeChild( childNode0, childText1 ); + + XmlTest( "Test InsertBeforeChild on empty node.", ( childNode1 == parent.FirstChild() ), true ); + } + + { + // InsertBeforeChild and InsertAfterChild causes crash. + TiXmlElement parent( "Parent" ); + TiXmlElement childText0( "childText0" ); + TiXmlElement childText1( "childText1" ); + TiXmlNode* childNode0 = parent.InsertEndChild( childText0 ); + TiXmlNode* childNode1 = parent.InsertAfterChild( childNode0, childText1 ); + + XmlTest( "Test InsertAfterChild on empty node. ", ( childNode1 == parent.LastChild() ), true ); + } + + // Reports of missing constructors, irregular string problems. + { + // Missing constructor implementation. No test -- just compiles. + TiXmlText text( "Missing" ); + + #ifdef TIXML_USE_STL + // Missing implementation: + TiXmlDocument doc; + string name = "missing"; + doc.LoadFile( name ); + + TiXmlText textSTL( name ); + #else + // verifying some basic string functions: + TiXmlString a; + TiXmlString b( "Hello" ); + TiXmlString c( "ooga" ); + + c = " World!"; + a = b; + a += c; + a = a; + + XmlTest( "Basic TiXmlString test. ", "Hello World!", a.c_str() ); + #endif + } + + // Long filenames crashing STL version + { + TiXmlDocument doc( "midsummerNightsDreamWithAVeryLongFilenameToConfuseTheStringHandlingRoutines.xml" ); + bool loadOkay = doc.LoadFile(); + loadOkay = true; // get rid of compiler warning. + // Won't pass on non-dev systems. Just a "no crash" check. + //XmlTest( "Long filename. ", true, loadOkay ); + } + + { + // Entities not being written correctly. + // From Lynn Allen + + const char* passages = + "<?xml version=\"1.0\" standalone=\"no\" ?>" + "<passages count=\"006\" formatversion=\"20020620\">" + "<psg context=\"Line 5 has "quotation marks" and 'apostrophe marks'." + " It also has <, >, and &, as well as a fake copyright ©.\"> </psg>" + "</passages>"; + + TiXmlDocument doc( "passages.xml" ); + doc.Parse( passages ); + TiXmlElement* psg = doc.RootElement()->FirstChildElement(); + const char* context = psg->Attribute( "context" ); + const char* expected = "Line 5 has \"quotation marks\" and 'apostrophe marks'. It also has <, >, and &, as well as a fake copyright \xC2\xA9."; + + XmlTest( "Entity transformation: read. ", expected, context, true ); + + FILE* textfile = fopen( "textfile.txt", "w" ); + if ( textfile ) + { + psg->Print( textfile, 0 ); + fclose( textfile ); + } + textfile = fopen( "textfile.txt", "r" ); + assert( textfile ); + if ( textfile ) + { + char buf[ 1024 ]; + fgets( buf, 1024, textfile ); + XmlTest( "Entity transformation: write. ", + "<psg context=\'Line 5 has "quotation marks" and 'apostrophe marks'." + " It also has <, >, and &, as well as a fake copyright \xC2\xA9.' />", + buf, + true ); + } + fclose( textfile ); + } + + { + FILE* textfile = fopen( "test5.xml", "w" ); + if ( textfile ) + { + fputs("<?xml version='1.0'?><a.elem xmi.version='2.0'/>", textfile); + fclose(textfile); + + TiXmlDocument doc; + doc.LoadFile( "test5.xml" ); + XmlTest( "dot in element attributes and names", doc.Error(), 0); + } + } + + { + FILE* textfile = fopen( "test6.xml", "w" ); + if ( textfile ) + { + fputs("<element><Name>1.1 Start easy ignore fin thickness
</Name></element>", textfile ); + fclose(textfile); + + TiXmlDocument doc; + bool result = doc.LoadFile( "test6.xml" ); + XmlTest( "Entity with one digit.", result, true ); + + TiXmlText* text = doc.FirstChildElement()->FirstChildElement()->FirstChild()->ToText(); + XmlTest( "Entity with one digit.", + text->Value(), "1.1 Start easy ignore fin thickness\n" ); + } + } + + { + // DOCTYPE not preserved (950171) + // + const char* doctype = + "<?xml version=\"1.0\" ?>" + "<!DOCTYPE PLAY SYSTEM 'play.dtd'>" + "<!ELEMENT title (#PCDATA)>" + "<!ELEMENT books (title,authors)>" + "<element />"; + + TiXmlDocument doc; + doc.Parse( doctype ); + doc.SaveFile( "test7.xml" ); + doc.Clear(); + doc.LoadFile( "test7.xml" ); + + TiXmlHandle docH( &doc ); + TiXmlUnknown* unknown = docH.Child( 1 ).Unknown(); + XmlTest( "Correct value of unknown.", "!DOCTYPE PLAY SYSTEM 'play.dtd'", unknown->Value() ); + #ifdef TIXML_USE_STL + TiXmlNode* node = docH.Child( 2 ).Node(); + std::string str; + str << (*node); + XmlTest( "Correct streaming of unknown.", "<!ELEMENT title (#PCDATA)>", str.c_str() ); + #endif + } + + { + // [ 791411 ] Formatting bug + // Comments do not stream out correctly. + const char* doctype = + "<!-- Somewhat<evil> -->"; + TiXmlDocument doc; + doc.Parse( doctype ); + + TiXmlHandle docH( &doc ); + TiXmlComment* comment = docH.Child( 0 ).Node()->ToComment(); + + XmlTest( "Comment formatting.", " Somewhat<evil> ", comment->Value() ); + #ifdef TIXML_USE_STL + std::string str; + str << (*comment); + XmlTest( "Comment streaming.", "<!-- Somewhat<evil> -->", str.c_str() ); + #endif + } + + { + // [ 870502 ] White space issues + TiXmlDocument doc; + TiXmlText* text; + TiXmlHandle docH( &doc ); + + const char* doctype0 = "<element> This has leading and trailing space </element>"; + const char* doctype1 = "<element>This has internal space</element>"; + const char* doctype2 = "<element> This has leading, trailing, and internal space </element>"; + + TiXmlBase::SetCondenseWhiteSpace( false ); + doc.Clear(); + doc.Parse( doctype0 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space kept.", " This has leading and trailing space ", text->Value() ); + + doc.Clear(); + doc.Parse( doctype1 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space kept.", "This has internal space", text->Value() ); + + doc.Clear(); + doc.Parse( doctype2 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space kept.", " This has leading, trailing, and internal space ", text->Value() ); + + TiXmlBase::SetCondenseWhiteSpace( true ); + doc.Clear(); + doc.Parse( doctype0 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space condensed.", "This has leading and trailing space", text->Value() ); + + doc.Clear(); + doc.Parse( doctype1 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space condensed.", "This has internal space", text->Value() ); + + doc.Clear(); + doc.Parse( doctype2 ); + text = docH.FirstChildElement( "element" ).Child( 0 ).Text(); + XmlTest( "White space condensed.", "This has leading, trailing, and internal space", text->Value() ); + } + + { + // Double attributes + const char* doctype = "<element attr='red' attr='blue' />"; + + TiXmlDocument doc; + doc.Parse( doctype ); + + XmlTest( "Parsing repeated attributes.", 0, (int)doc.Error() ); // not an error to tinyxml + XmlTest( "Parsing repeated attributes.", "blue", doc.FirstChildElement( "element" )->Attribute( "attr" ) ); + } + + { + // Embedded null in stream. + const char* doctype = "<element att\0r='red' attr='blue' />"; + + TiXmlDocument doc; + doc.Parse( doctype ); + XmlTest( "Embedded null throws error.", true, doc.Error() ); + + #ifdef TIXML_USE_STL + istringstream strm( doctype ); + doc.Clear(); + doc.ClearError(); + strm >> doc; + XmlTest( "Embedded null throws error.", true, doc.Error() ); + #endif + } + + { + // Legacy mode test. (This test may only pass on a western system) + const char* str = + "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<ä>" + "CöntäntßäöüÄÖÜ" + "</ä>"; + + TiXmlDocument doc; + doc.Parse( str ); + + TiXmlHandle docHandle( &doc ); + TiXmlHandle aHandle = docHandle.FirstChildElement( "ä" ); + TiXmlHandle tHandle = aHandle.Child( 0 ); + assert( aHandle.Element() ); + assert( tHandle.Text() ); + XmlTest( "ISO-8859-1 Parsing.", "CöntäntßäöüÄÖÜ", tHandle.Text()->Value() ); + } + + { + // Empty documents should return TIXML_ERROR_PARSING_EMPTY, bug 1070717 + const char* str = " "; + TiXmlDocument doc; + doc.Parse( str ); + XmlTest( "Empty document error TIXML_ERROR_DOCUMENT_EMPTY", TiXmlBase::TIXML_ERROR_DOCUMENT_EMPTY, doc.ErrorId() ); + } + #ifndef TIXML_USE_STL + { + // String equality. [ 1006409 ] string operator==/!= no worky in all cases + TiXmlString temp; + XmlTest( "Empty tinyxml string compare equal", ( temp == "" ), true ); + + TiXmlString foo; + TiXmlString bar( "" ); + XmlTest( "Empty tinyxml string compare equal", ( foo == bar ), true ); + } + + #endif + { + // Bug [ 1195696 ] from marlonism + TiXmlBase::SetCondenseWhiteSpace(false); + TiXmlDocument xml; + xml.Parse("<text><break/>This hangs</text>"); + XmlTest( "Test safe error return.", xml.Error(), false ); + } + + { + // Bug [ 1243992 ] - another infinite loop + TiXmlDocument doc; + doc.SetCondenseWhiteSpace(false); + doc.Parse("<p><pb></pb>test</p>"); + } + { + // Low entities + TiXmlDocument xml; + xml.Parse( "<test></test>" ); + const char result[] = { 0x0e, 0 }; + XmlTest( "Low entities.", xml.FirstChildElement()->GetText(), result ); + xml.Print(); + } + { + // Bug [ 1451649 ] Attribute values with trailing quotes not handled correctly + TiXmlDocument xml; + xml.Parse( "<foo attribute=bar\" />" ); + XmlTest( "Throw error with bad end quotes.", xml.Error(), true ); + } + #ifdef TIXML_USE_STL + { + // Bug [ 1449463 ] Consider generic query + TiXmlDocument xml; + xml.Parse( "<foo bar='3' barStr='a string'/>" ); + + TiXmlElement* ele = xml.FirstChildElement(); + double d; + int i; + float f; + bool b; + //std::string str; + + XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "bar", &d ), TIXML_SUCCESS ); + XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "bar", &i ), TIXML_SUCCESS ); + XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "bar", &f ), TIXML_SUCCESS ); + XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "bar", &b ), TIXML_WRONG_TYPE ); + XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "nobar", &b ), TIXML_NO_ATTRIBUTE ); + //XmlTest( "QueryValueAttribute", ele->QueryValueAttribute( "barStr", &str ), TIXML_SUCCESS ); + + XmlTest( "QueryValueAttribute", (d==3.0), true ); + XmlTest( "QueryValueAttribute", (i==3), true ); + XmlTest( "QueryValueAttribute", (f==3.0f), true ); + //XmlTest( "QueryValueAttribute", (str==std::string( "a string" )), true ); + } + #endif + + #ifdef TIXML_USE_STL + { + // [ 1505267 ] redundant malloc in TiXmlElement::Attribute + TiXmlDocument xml; + xml.Parse( "<foo bar='3' />" ); + TiXmlElement* ele = xml.FirstChildElement(); + double d; + int i; + + std::string bar = "bar"; + + const std::string* atrrib = ele->Attribute( bar ); + ele->Attribute( bar, &d ); + ele->Attribute( bar, &i ); + + XmlTest( "Attribute", atrrib->empty(), false ); + XmlTest( "Attribute", (d==3.0), true ); + XmlTest( "Attribute", (i==3), true ); + } + #endif + + { + // [ 1356059 ] Allow TiXMLDocument to only be at the top level + TiXmlDocument xml, xml2; + xml.InsertEndChild( xml2 ); + XmlTest( "Document only at top level.", xml.Error(), true ); + XmlTest( "Document only at top level.", xml.ErrorId(), TiXmlBase::TIXML_ERROR_DOCUMENT_TOP_ONLY ); + } + + { + // [ 1663758 ] Failure to report error on bad XML + TiXmlDocument xml; + xml.Parse("<x>"); + XmlTest("Missing end tag at end of input", xml.Error(), true); + xml.Parse("<x> "); + XmlTest("Missing end tag with trailing whitespace", xml.Error(), true); + } + + { + // [ 1635701 ] fail to parse files with a tag separated into two lines + // I'm not sure this is a bug. Marked 'pending' for feedback. + TiXmlDocument xml; + xml.Parse( "<title><p>text</p\n><title>" ); + //xml.Print(); + //XmlTest( "Tag split by newline", xml.Error(), false ); + } + + #ifdef TIXML_USE_STL + { + // [ 1475201 ] TinyXML parses entities in comments + TiXmlDocument xml; + istringstream parse1( "<!-- declarations for <head> & <body> -->" + "<!-- far & away -->" ); + parse1 >> xml; + + TiXmlNode* e0 = xml.FirstChild(); + TiXmlNode* e1 = e0->NextSibling(); + TiXmlComment* c0 = e0->ToComment(); + TiXmlComment* c1 = e1->ToComment(); + + XmlTest( "Comments ignore entities.", " declarations for <head> & <body> ", c0->Value(), true ); + XmlTest( "Comments ignore entities.", " far & away ", c1->Value(), true ); + } + #endif + + { + // [ 1475201 ] TinyXML parses entities in comments + TiXmlDocument xml; + xml.Parse("<!-- declarations for <head> & <body> -->" + "<!-- far & away -->" ); + + TiXmlNode* e0 = xml.FirstChild(); + TiXmlNode* e1 = e0->NextSibling(); + TiXmlComment* c0 = e0->ToComment(); + TiXmlComment* c1 = e1->ToComment(); + + XmlTest( "Comments ignore entities.", " declarations for <head> & <body> ", c0->Value(), true ); + XmlTest( "Comments ignore entities.", " far & away ", c1->Value(), true ); + } + /* + { + TiXmlDocument xml; + xml.Parse( "<tag>/</tag>" ); + xml.Print(); + xml.FirstChild()->Print( stdout, 0 ); + xml.FirstChild()->Type(); + } + */ + + /* 1417717 experiment + { + TiXmlDocument xml; + xml.Parse("<text>Dan & Tracie</text>"); + xml.Print(stdout); + } + { + TiXmlDocument xml; + xml.Parse("<text>Dan &foo; Tracie</text>"); + xml.Print(stdout); + } + */ + #if defined( WIN32 ) && defined( TUNE ) + _CrtMemCheckpoint( &endMemState ); + //_CrtMemDumpStatistics( &endMemState ); + + _CrtMemState diffMemState; + _CrtMemDifference( &diffMemState, &startMemState, &endMemState ); + _CrtMemDumpStatistics( &diffMemState ); + #endif + + printf ("\nPass %d, Fail %d\n", gPass, gFail); + return gFail; +} + + diff --git a/shared/xmlBase.cpp b/shared/xmlBase.cpp new file mode 100644 index 00000000..19ec0ab6 --- /dev/null +++ b/shared/xmlBase.cpp @@ -0,0 +1,387 @@ +#include "xmlBase.h" +#include "globalFunctions.h" +#include <wx/ffile.h> +#include <wx/intl.h> + + +std::string getTypeName(xmlAccess::XmlType type) +{ + switch (type) + { + case xmlAccess::XML_GUI_CONFIG: + return "GUI"; + case xmlAccess::XML_BATCH_CONFIG: + return "BATCH"; + case xmlAccess::XML_GLOBAL_SETTINGS: + return "GLOBAL"; + case xmlAccess::XML_REAL_CONFIG: + return "REAL"; + case xmlAccess::XML_OTHER: + break; + } + assert(false); + return "OTHER"; +} + + +xmlAccess::XmlType xmlAccess::getXmlType(const wxString& filename) +{ + if (!wxFileExists(filename)) + return XML_OTHER; + + //workaround to get a FILE* from a unicode filename + wxFFile configFile(filename, wxT("rb")); + if (!configFile.IsOpened()) + return XML_OTHER; + + FILE* inputFile = configFile.fp(); + + TiXmlDocument doc; + if (!doc.LoadFile(inputFile)) //fails if inputFile is no proper XML + return XML_OTHER; + + TiXmlElement* root = doc.RootElement(); + + if (!root || (root->ValueStr() != std::string("FreeFileSync"))) //check for FFS configuration xml + return XML_OTHER; + + const char* cfgType = root->Attribute("XmlType"); + if (!cfgType) + return XML_OTHER; + + const std::string type(cfgType); + + if (type == getTypeName(XML_GUI_CONFIG)) + return XML_GUI_CONFIG; + else if (type == getTypeName(XML_BATCH_CONFIG)) + return XML_BATCH_CONFIG; + else if (type == getTypeName(XML_GLOBAL_SETTINGS)) + return XML_GLOBAL_SETTINGS; + else if (type == getTypeName(XML_REAL_CONFIG)) + return XML_REAL_CONFIG; + + return XML_OTHER; +} + + +bool xmlAccess::loadXmlDocument(const wxString& fileName, const xmlAccess::XmlType type, TiXmlDocument& document) +{ + if (!wxFileExists(fileName)) //avoid wxWidgets error message when wxFFile receives not existing file + return false; + + //workaround to get a FILE* from a unicode filename + wxFFile dummyFile(fileName, wxT("rb")); //binary mode needed for TiXml to work correctly in this case + if (dummyFile.IsOpened()) + { + FILE* inputFile = dummyFile.fp(); + + TiXmlBase::SetCondenseWhiteSpace(false); //do not condense whitespace characters + + if (document.LoadFile(inputFile)) //load XML; fails if inputFile is no proper XML + { + TiXmlElement* root = document.RootElement(); + + if (root && (root->ValueStr() == std::string("FreeFileSync"))) //check for FFS configuration xml + { + const char* cfgType = root->Attribute("XmlType"); + if (cfgType) + return std::string(cfgType) == getTypeName(type); + } + } + } + + return false; +} + + +void xmlAccess::getDefaultXmlDocument(const XmlType type, TiXmlDocument& document) +{ + TiXmlBase::SetCondenseWhiteSpace(false); //do not condense whitespace characters + + TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "UTF-8", ""); //delete won't be necessary later; ownership passed to TiXmlDocument! + document.LinkEndChild(decl); + + TiXmlElement* root = new TiXmlElement("FreeFileSync"); + + root->SetAttribute("XmlType", getTypeName(type)); //xml configuration type + + document.LinkEndChild(root); +} + + +bool xmlAccess::saveXmlDocument(const wxString& fileName, const TiXmlDocument& document) +{ + //workaround to get a FILE* from a unicode filename + wxFFile dummyFile(fileName, wxT("w")); //no need for "binary" mode here + if (!dummyFile.IsOpened()) + return false; + + FILE* outputFile = dummyFile.fp(); + + return document.SaveFile(outputFile); //save XML +} + + +//################################################################################################################ + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, std::string& output) +{ + if (parent) + { + const TiXmlElement* child = parent->FirstChildElement(name); + if (child) + { + const char* text = child->GetText(); + if (text) //may be NULL!! + output = text; + else //NULL means empty string + output.clear(); + return true; + } + } + + return false; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, wxString& output) +{ + std::string tempString; + if (!readXmlElement(name, parent, tempString)) + return false; + + output = wxString::FromUTF8(tempString.c_str()); + return true; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, int& output) +{ + std::string temp; + if (!readXmlElement(name, parent, temp)) + return false; + + output = globalFunctions::stringToInt(temp); + return true; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, unsigned int& output) +{ + int dummy = 0; + if (!xmlAccess::readXmlElement(name, parent, dummy)) + return false; + + output = static_cast<unsigned int>(dummy); + return true; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, long& output) +{ + std::string temp; + if (readXmlElement(name, parent, temp)) + { + output = globalFunctions::stringToLong(temp); + return true; + } + else + return false; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, bool& output) +{ + std::string dummy; + if (readXmlElement(name, parent, dummy)) + { + output = dummy == "true"; + return true; + } + else + return false; +} + + +bool xmlAccess::readXmlElement(const std::string& name, const TiXmlElement* parent, std::vector<wxString>& output) +{ + if (parent) + { + output.clear(); + + //load elements + const TiXmlElement* element = parent->FirstChildElement(name); + while (element) + { + const char* text = element->GetText(); + if (text) //may be NULL!! + output.push_back(wxString::FromUTF8(text)); + else + output.push_back(wxEmptyString); + + element = element->NextSiblingElement(); + } + return true; + } + + return false; +} + + +bool xmlAccess::readXmlAttribute(const std::string& name, const TiXmlElement* node, std::string& output) +{ + if (node) + { + const std::string* attrib = node->Attribute(name); + if (attrib) //may be NULL! + { + output = *attrib; + return true; + } + } + return false; +} + + +bool xmlAccess::readXmlAttribute(const std::string& name, const TiXmlElement* node, int& output) +{ + std::string dummy; + if (readXmlAttribute(name, node, dummy)) + { + output = globalFunctions::stringToInt(dummy); + return true; + } + else + return false; +} + + +bool xmlAccess::readXmlAttribute(const std::string& name, const TiXmlElement* node, unsigned int& output) +{ + std::string dummy; + if (readXmlAttribute(name, node, dummy)) + { + output = globalFunctions::stringToInt(dummy); + return true; + } + else + return false; +} + + +bool xmlAccess::readXmlAttribute(const std::string& name, const TiXmlElement* node, bool& output) +{ + std::string dummy; + if (readXmlAttribute(name, node, dummy)) + { + output = dummy == "true"; + return true; + } + else + return false; +} + + +//################################################################################################################ + + +void xmlAccess::addXmlElement(const std::string& name, const std::string& value, TiXmlElement* parent) +{ + if (parent) + { + TiXmlElement* subElement = new TiXmlElement(name); + parent->LinkEndChild(subElement); + subElement->LinkEndChild(new TiXmlText(value)); + } +} + + +void xmlAccess::addXmlElement(const std::string& name, const wxString& value, TiXmlElement* parent) +{ + addXmlElement(name, std::string(value.ToUTF8()), parent); +} + + +void xmlAccess::addXmlElement(const std::string& name, const int value, TiXmlElement* parent) +{ + addXmlElement(name, globalFunctions::numberToString(value), parent); +} + + +void xmlAccess::addXmlElement(const std::string& name, const unsigned int value, TiXmlElement* parent) +{ + addXmlElement(name, static_cast<int>(value), parent); +} + + +void xmlAccess::addXmlElement(const std::string& name, const long value, TiXmlElement* parent) +{ + addXmlElement(name, globalFunctions::numberToString(value), parent); +} + + +void xmlAccess::addXmlElement(const std::string& name, const bool value, TiXmlElement* parent) +{ + if (value) + addXmlElement(name, std::string("true"), parent); + else + addXmlElement(name, std::string("false"), parent); +} + + +void xmlAccess::addXmlElement(const std::string& name, const std::vector<wxString>& value, TiXmlElement* parent) +{ + for (std::vector<wxString>::const_iterator i = value.begin(); i != value.end(); ++i) + addXmlElement(name, std::string(i->ToUTF8()), parent); +} + + +void xmlAccess::addXmlAttribute(const std::string& name, const std::string& value, TiXmlElement* node) +{ + if (node) + node->SetAttribute(name, value); +} + + +void xmlAccess::addXmlAttribute(const std::string& name, const int value, TiXmlElement* node) +{ + addXmlAttribute(name, globalFunctions::numberToString(value), node); +} + + +void xmlAccess::addXmlAttribute(const std::string& name, const unsigned int value, TiXmlElement* node) +{ + addXmlAttribute(name, globalFunctions::numberToString(value), node); +} + + +void xmlAccess::addXmlAttribute(const std::string& name, const bool value, TiXmlElement* node) +{ + if (value) + addXmlAttribute(name, std::string("true"), node); + else + addXmlAttribute(name, std::string("false"), node); +} + + +using xmlAccess::XmlParser; + +void XmlParser::logError(const std::string& nodeName) +{ + failedNodes.push_back(wxString::FromUTF8(nodeName.c_str())); +} + +bool XmlParser::errorsOccured() const +{ + return !failedNodes.empty(); +} + +const wxString XmlParser::getErrorMessageFormatted() const +{ + wxString errorMessage = wxString(_("Could not read values for the following XML nodes:")) + wxT("\n"); + for (std::vector<wxString>::const_iterator i = failedNodes.begin(); i != failedNodes.end(); ++i) + errorMessage += wxString(wxT("<")) + *i + wxT(">") + ((i - failedNodes.begin() + 1) % 3 == 0 ? wxT("\n") : wxT(" ")); + return errorMessage; +} + diff --git a/shared/xmlBase.h b/shared/xmlBase.h new file mode 100644 index 00000000..5fc13b65 --- /dev/null +++ b/shared/xmlBase.h @@ -0,0 +1,136 @@ +#ifndef XMLBASE_H_INCLUDED +#define XMLBASE_H_INCLUDED + +#include "tinyxml/tinyxml.h" +#include <string> +#include <vector> +#include <wx/string.h> + + +namespace xmlAccess +{ + + enum XmlType + { + XML_GUI_CONFIG, + XML_BATCH_CONFIG, + XML_GLOBAL_SETTINGS, + XML_REAL_CONFIG, + XML_OTHER + }; + + XmlType getXmlType(const wxString& filename); + + bool loadXmlDocument(const wxString& fileName, const XmlType type, TiXmlDocument& document); + void getDefaultXmlDocument(const XmlType type, TiXmlDocument& document); + bool saveXmlDocument(const wxString& fileName, const TiXmlDocument& document); + + +//------------------------------------------------------------------------------------------ + + //small helper functions + bool readXmlElement(const std::string& name, const TiXmlElement* parent, std::string& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, wxString& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, int& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, unsigned int& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, long& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, bool& output); + bool readXmlElement(const std::string& name, const TiXmlElement* parent, std::vector<wxString>& output); + + bool readXmlAttribute(const std::string& name, const TiXmlElement* node, std::string& output); + bool readXmlAttribute(const std::string& name, const TiXmlElement* node, int& output); + bool readXmlAttribute(const std::string& name, const TiXmlElement* node, unsigned int& output); + bool readXmlAttribute(const std::string& name, const TiXmlElement* node, bool& output); + + void addXmlElement(const std::string& name, const std::string& value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const wxString& value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const int value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const unsigned int value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const long value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const bool value, TiXmlElement* parent); + void addXmlElement(const std::string& name, const std::vector<wxString>& value, TiXmlElement* parent); + + void addXmlAttribute(const std::string& name, const std::string& value, TiXmlElement* node); + void addXmlAttribute(const std::string& name, const int value, TiXmlElement* node); + void addXmlAttribute(const std::string& name, const unsigned int value, TiXmlElement* node); + void addXmlAttribute(const std::string& name, const bool value, TiXmlElement* node); + + + + class XmlParser + { + public: + XmlParser(const TiXmlElement* rootElement) : root(rootElement) {} + + void logError(const std::string& nodeName); + bool errorsOccured() const; + const wxString getErrorMessageFormatted() const; + + protected: + //another level of indirection: if errors occur during xml parsing they are logged + template <class T> + void readXmlElementLogging(const std::string& name, const TiXmlElement* parent, T& output) + { + if (!readXmlElement(name, parent, output)) + logError(name); + } + + template <class T> + void readXmlAttributeLogging(const std::string& name, const TiXmlElement* node, T& output) + { + if (!readXmlAttribute(name, node, output)) + logError(name); + } + + const TiXmlElement* const root; + std::vector<wxString> failedNodes; + }; + + + class XmlError //Exception class + { + public: + enum Severity + { + WARNING = 77, + FATAL + }; + + XmlError(const wxString& message, Severity sev = FATAL) : errorMessage(message), m_severity(sev) {} + + const wxString& show() const + { + return errorMessage; + } + Severity getSeverity() const + { + return m_severity; + } + private: + const wxString errorMessage; + const Severity m_severity; + }; +} + + +class TiXmlHandleConst //like TiXmlHandle but respecting "const TiXmlElement*" +{ +public: + TiXmlHandleConst(const TiXmlElement* element) : m_element(element) {} + + TiXmlHandleConst FirstChild(const char* name) const + { + return TiXmlHandleConst(m_element != NULL ? m_element->FirstChildElement(name) : NULL); + } + + const TiXmlElement* ToElement() const + { + return m_element; + } + +private: + const TiXmlElement* const m_element; +}; + + +#endif // XMLBASE_H_INCLUDED diff --git a/shared/zstring.cpp b/shared/zstring.cpp new file mode 100644 index 00000000..ba7292e3 --- /dev/null +++ b/shared/zstring.cpp @@ -0,0 +1,415 @@ +#include "zstring.h" +#include "globalFunctions.h" + +#ifdef FFS_WIN +#include <wx/msw/wrapwin.h> //includes "windows.h" +#endif //FFS_WIN + + + +#ifdef __WXDEBUG__ +AllocationCount::~AllocationCount() +{ + if (activeStrings.size() > 0) +#ifdef FFS_WIN + { + int rowCount = 0; + wxString leakingStrings; + for (std::set<const DefaultChar*>::const_iterator i = activeStrings.begin(); + i != activeStrings.end() && ++rowCount <= 10; + ++i) + { + leakingStrings += wxT("\""); + leakingStrings += *i; + leakingStrings += wxT("\"\n"); + } + + MessageBox(NULL, wxString(wxT("Memory leak detected! (No problem if it occurs while Unit testing only!)")) + wxT("\n\n") + + wxT("Candidates:\n") + leakingStrings, + wxString::Format(wxT("%i"), activeStrings.size()), 0); + } +#else + std::abort(); +#endif +} + + +AllocationCount& AllocationCount::getInstance() +{ + static AllocationCount global; + return global; +} +#endif + + +#ifdef FFS_WIN +int FreeFileSync::compareStringsWin32(const wchar_t* a, const wchar_t* b, const int aCount, const int bCount) +{ + //DON'T use lstrcmpi() here! It uses word sort, which unfortunately is NOT always a strict weak sorting function for some locales (e.g. swedish) + //Use CompareString() with "SORT_STRINGSORT" instead!!! + + const int rv = CompareString( + LOCALE_USER_DEFAULT, //locale identifier + NORM_IGNORECASE | SORT_STRINGSORT, //comparison-style options + a, //pointer to first string + aCount, //size, in bytes or characters, of first string + b, //pointer to second string + bCount); //size, in bytes or characters, of second string + + if (rv == 0) + throw RuntimeException(wxString(wxT("Error comparing strings!"))); + else + return rv - 2; //convert to C-style string compare result +} +#endif + + +Zstring& Zstring::Replace(const DefaultChar* old, const DefaultChar* replacement, bool replaceAll) +{ + const size_t oldLen = defaultLength(old); + const size_t replacementLen = defaultLength(replacement); + + size_t pos = 0; + while (true) + { + pos = find(old, pos); + if (pos == npos) + break; + + replace(pos, oldLen, replacement, replacementLen); + pos += replacementLen; //move past the string that was replaced + + // stop now? + if (!replaceAll) + break; + } + return *this; +} + + +bool matchesHelper(const DefaultChar* string, const DefaultChar* mask) +{ + for (DefaultChar ch; (ch = *mask) != 0; ++mask) + { + switch (ch) + { + case DefaultChar('?'): + if (*string == 0) + return false; + else + ++string; + break; + + case DefaultChar('*'): + //advance to next non-*/? char + do + { + ++mask; + ch = *mask; + } + while (ch == DefaultChar('*') || ch == DefaultChar('?')); + //if match ends with '*': + if (ch == DefaultChar(0)) + return true; + + ++mask; + while ((string = defaultStrFind(string, ch)) != NULL) + { + if (matchesHelper(string + 1, mask)) + return true; + ++string; + } + return false; + + default: + if (*string != ch) + return false; + else + ++string; + } + } + return *string == 0; +} + + +bool Zstring::Matches(const DefaultChar* mask) const +{ + return matchesHelper(c_str(), mask); +} + + +bool Zstring::Matches(const DefaultChar* name, const DefaultChar* mask) +{ + return matchesHelper(name, mask); +} + + +Zstring& Zstring::Trim(bool fromRight) +{ + const size_t thisLen = length(); + if (thisLen == 0) + return *this; + + if (fromRight) + { + const DefaultChar* cursor = data + thisLen - 1; + while (cursor != data - 1 && defaultIsWhiteSpace(*cursor)) //break when pointing one char further than last skipped element + --cursor; + ++cursor; + + const size_t newLength = cursor - data; + if (newLength != thisLen) + { + if (descr->refCount > 1) //allocate new string + *this = Zstring(data, newLength); + else //overwrite this strin + { + descr->length = newLength; + data[newLength] = DefaultChar(0); + } + } + } + else + { + DefaultChar* cursor = data; + DefaultChar ch; + while ((ch = *cursor) != 0 && defaultIsWhiteSpace(ch)) + ++cursor; + + const size_t diff = cursor - data; + if (diff) + { + if (descr->refCount > 1) //allocate new string + *this = Zstring(cursor, thisLen - diff); + else + { //overwrite this string + data = cursor; //no problem when deallocating data, since descr points to begin of allocated area + descr->capacity -= diff; + descr->length -= diff; + } + } + } + + return *this; +} + + +Zstring& Zstring::MakeLower() +{ + const size_t thisLen = length(); + if (thisLen == 0) + return *this; + + if (descr->refCount > 1) //allocate new string + { + StringDescriptor* newDescr; + DefaultChar* newData; + allocate(thisLen, newDescr, newData); + + for (unsigned int i = 0; i < thisLen; ++i) + newData[i] = defaultToLower(data[i]); + newData[thisLen] = 0; + + decRef(); + descr = newDescr; + data = newData; + } + else + { //overwrite this string + for (unsigned int i = 0; i < thisLen; ++i) + data[i] = defaultToLower(data[i]); + } + + return *this; +} + + +//############################################################### +//std::string functions +Zstring Zstring::substr(size_t pos, size_t len) const +{ + if (len == npos) + { + assert(pos <= length()); + return Zstring(c_str() + pos, length() - pos); //reference counting not used: different length + } + else + { + assert(length() - pos >= len); + return Zstring(c_str() + pos, len); + } +} + + +size_t Zstring::rfind(const DefaultChar ch, size_t pos) const +{ + const size_t thisLen = length(); + if (thisLen == 0) + return npos; + + if (pos == npos) + pos = thisLen - 1; + else + assert(pos <= length()); + + do //pos points to last char of the string + { + if (data[pos] == ch) + return pos; + } + while (--pos != static_cast<size_t>(-1)); + return npos; +} + + +Zstring& Zstring::replace(size_t pos1, size_t n1, const DefaultChar* str, size_t n2) +{ + assert(str < c_str() || c_str() + length() < str); //str mustn't point to data in this string + assert(n1 <= length() - pos1); + + const size_t oldLen = length(); + if (oldLen == 0) + { + assert(pos1 == 0 && n1 == 0); + return *this = Zstring(str, n2); + } + + const size_t newLen = oldLen - n1 + n2; + if (newLen > oldLen || descr->refCount > 1) + { //allocate a new string + StringDescriptor* newDescr; + DefaultChar* newData; + allocate(newLen, newDescr, newData); + + //assemble new string with replacement + memcpy(newData, data, pos1 * sizeof(DefaultChar)); + memcpy(newData + pos1, str, n2 * sizeof(DefaultChar)); + memcpy(newData + pos1 + n2, data + pos1 + n1, (oldLen - pos1 - n1) * sizeof(DefaultChar)); + newData[newLen] = 0; + + decRef(); + data = newData; + descr = newDescr; + } + else //overwrite current string: case "n2 == 0" is handled implicitly + { + memcpy(data + pos1, str, n2 * sizeof(DefaultChar)); + if (newLen < oldLen) + { + memmove(data + pos1 + n2, data + pos1 + n1, (oldLen - pos1 - n1) * sizeof(DefaultChar)); + data[newLen] = 0; + descr->length = newLen; + } + } + + return *this; +} + + +Zstring& Zstring::operator=(const DefaultChar* source) +{ + const size_t sourceLen = defaultLength(source); + if (sourceLen == 0) + return *this = Zstring(); + + if (descr->refCount > 1 || descr->capacity < sourceLen) //allocate new string + *this = Zstring(source, sourceLen); + else + { //overwrite this string + memcpy(data, source, sourceLen * sizeof(DefaultChar)); + data[sourceLen] = 0; + descr->length = sourceLen; + } + return *this; +} + + +Zstring& Zstring::operator+=(const Zstring& other) +{ + const size_t otherLen = other.length(); + if (otherLen != 0) + { + const size_t thisLen = length(); + const size_t newLen = thisLen + otherLen; + copyBeforeWrite(newLen); + + memcpy(data + thisLen, other.c_str(), otherLen * sizeof(DefaultChar)); + data[newLen] = 0; + descr->length = newLen; + } + return *this; +} + + +Zstring& Zstring::operator+=(const DefaultChar* other) +{ + const size_t otherLen = defaultLength(other); + if (otherLen != 0) + { + const size_t thisLen = length(); + const size_t newLen = thisLen + otherLen; + copyBeforeWrite(newLen); + + memcpy(data + thisLen, other, otherLen * sizeof(DefaultChar)); + data[newLen] = 0; + descr->length = newLen; + } + return *this; +} + + +Zstring& Zstring::operator+=(DefaultChar ch) +{ + const size_t oldLen = length(); + copyBeforeWrite(oldLen + 1); + data[oldLen] = ch; + data[oldLen + 1] = 0; + ++descr->length; + return *this; +} + + +void Zstring::copyBeforeWrite(const size_t capacityNeeded) +{ + assert(capacityNeeded != 0); + + if (descr->refCount > 1) + { //allocate a new string + const size_t oldLength = length(); + assert(oldLength <= getCapacityToAllocate(capacityNeeded)); + + StringDescriptor* newDescr; + DefaultChar* newData; + allocate(capacityNeeded, newDescr, newData); + newDescr->length = oldLength; + + if (oldLength) + { + memcpy(newData, data, oldLength * sizeof(DefaultChar)); + newData[oldLength] = 0; + } + decRef(); + descr = newDescr; + data = newData; + } + else if (descr->capacity < capacityNeeded) + { //try to resize the current string (allocate anew if necessary) + const size_t newCapacity = getCapacityToAllocate(capacityNeeded); + + descr = (StringDescriptor*) realloc(descr, sizeof(StringDescriptor) + (newCapacity + 1) * sizeof(DefaultChar)); + if (descr == NULL) + throw std::bad_alloc(); + +#ifdef __WXDEBUG__ + AllocationCount::getInstance().dec(data); //test Zstring for memory leaks +#endif + + data = (DefaultChar*)(descr + 1); + +#ifdef __WXDEBUG__ + AllocationCount::getInstance().inc(data); //test Zstring for memory leaks +#endif + + descr->capacity = newCapacity; + } +} diff --git a/shared/zstring.h b/shared/zstring.h new file mode 100644 index 00000000..0403a00c --- /dev/null +++ b/shared/zstring.h @@ -0,0 +1,734 @@ +/*************************************************************** + * Purpose: High performance string class + * Author: ZenJu (zhnmju123@gmx.de) + * Created: Jan. 2009 + **************************************************************/ + +#ifndef ZSTRING_H_INCLUDED +#define ZSTRING_H_INCLUDED + +#include <cstring> +#include <cctype> +#include <assert.h> +#include <new> +#ifdef __WXDEBUG__ +#include <set> +#endif + + +namespace FreeFileSync +{ +#ifdef FFS_WIN + //super fast case-insensitive string comparison: way faster than wxString::CmpNoCase()!!! + int compareStringsWin32(const wchar_t* a, const wchar_t* b, const int aCount = -1, const int bCount = -1); +#endif //FFS_WIN +} + + +#ifdef ZSTRING_CHAR +typedef char DefaultChar; //use char strings +#elif defined ZSTRING_WIDE_CHAR +typedef wchar_t DefaultChar; //use wide character strings +#endif + +class Zsubstr; + +class Zstring +{ +public: + Zstring(); + Zstring(const DefaultChar* source); //string is copied: O(length) + Zstring(const DefaultChar* source, size_t length); //string is copied: O(length) + Zstring(const Zstring& source); //reference-counting => O(1) + ~Zstring(); + + operator const DefaultChar*() const; //implicit conversion to C string + + //wxWidgets functions + bool StartsWith(const DefaultChar* begin) const; + bool StartsWith(const Zstring& begin) const; + bool EndsWith(const DefaultChar* end) const; + bool EndsWith(const DefaultChar end) const; + bool EndsWith(const Zstring& end) const; + Zstring& Truncate(size_t newLen); +#ifdef FFS_WIN + int CmpNoCase(const DefaultChar* other) const; + int CmpNoCase(const Zstring& other) const; +#endif + int Cmp(const DefaultChar* other) const; + int Cmp(const Zstring& other) const; + Zstring& Replace(const DefaultChar* old, const DefaultChar* replacement, bool replaceAll = true); + Zstring AfterLast(DefaultChar ch) const; //returns the whole string if ch not found + Zstring BeforeLast(DefaultChar ch) const; //returns empty string if ch not found + size_t Find(DefaultChar ch, bool fromEnd) const; + bool Matches(const DefaultChar* mask) const; + static bool Matches(const DefaultChar* name, const DefaultChar* mask); + Zstring& Trim(bool fromRight); //from right or left + Zstring& MakeLower(); + + //std::string functions + size_t length() const; + const DefaultChar* c_str() const; + Zstring substr(size_t pos = 0, size_t len = npos) const; //allocate new string + Zsubstr zsubstr(size_t pos = 0) const; //use ref-counting! + bool empty() const; + void clear(); + int compare(const DefaultChar* other) const; + int compare(const Zstring& other) const; + int compare(const size_t pos1, const size_t n1, const DefaultChar* other) const; + size_t find(const DefaultChar* str, const size_t pos = 0 ) const; + size_t find(const DefaultChar ch, const size_t pos = 0) const; + size_t rfind(const DefaultChar ch, size_t pos = npos) const; + Zstring& replace(size_t pos1, size_t n1, const DefaultChar* str, size_t n2); + size_t size() const; + + Zstring& operator=(const Zstring& source); + Zstring& operator=(const DefaultChar* source); + + bool operator == (const Zstring& other) const; + bool operator == (const DefaultChar* other) const; + bool operator < (const Zstring& other) const; + bool operator < (const DefaultChar* other) const; + bool operator != (const Zstring& other) const; + bool operator != (const DefaultChar* other) const; + + const DefaultChar operator[](const size_t pos) const; + + Zstring& operator+=(const Zstring& other); + Zstring& operator+=(const DefaultChar* other); + Zstring& operator+=(DefaultChar ch); + + const Zstring operator+(const Zstring& string2) const; + const Zstring operator+(const DefaultChar* string2) const; + const Zstring operator+(const DefaultChar ch) const; + + static const size_t npos = static_cast<size_t>(-1); + +private: + Zstring(int); //indicates usage error + + void initAndCopy(const DefaultChar* source, size_t length); + void incRef() const; //support for reference-counting + void decRef(); // + void copyBeforeWrite(const size_t capacityNeeded); //and copy-on-write + + struct StringDescriptor + { + mutable unsigned int refCount; + size_t length; + size_t capacity; //allocated length without null-termination + }; + static void allocate(const size_t newLength, StringDescriptor*& newDescr, DefaultChar*& newData); + + StringDescriptor* descr; + DefaultChar* data; +}; + + +class Zsubstr //ref-counted substring of a Zstring +{ +public: + Zsubstr(); + Zsubstr(const Zstring& ref, const size_t pos); + + const DefaultChar* c_str() const; + size_t length() const; + bool StartsWith(const Zstring& begin) const; + size_t findFromEnd(const DefaultChar ch) const; + +private: + Zstring m_ref; + const DefaultChar* m_data; + size_t m_length; +}; + + +//####################################################################################### +//begin of implementation + +#ifdef ZSTRING_CHAR +inline +size_t defaultLength(const char* input) +{ + return strlen(input); +} + +inline +int defaultCompare(const char* str1, const char* str2) +{ + return strcmp(str1, str2); +} + +inline +int defaultCompare(const char* str1, const char* str2, const size_t count) +{ + return strncmp(str1, str2, count); +} + +inline +char* defaultStrFind(const char* str1, const char* str2) +{ + return strstr(str1, str2); +} + +inline +char* defaultStrFind(const char* str1, int ch) +{ + return strchr(str1, ch); +} + +inline +bool defaultIsWhiteSpace(const char ch) +{ + // some compilers (e.g. VC++ 6.0) return true for a call to isspace('\xEA') => exclude char(128) to char(255) + return ((unsigned char)ch < 128) && isspace((unsigned char)ch) != 0; +} + +inline +char defaultToLower(const char ch) +{ + return tolower((unsigned char)ch); //caution: although tolower() has int as input parameter it expects unsigned chars! +} + +#elif defined ZSTRING_WIDE_CHAR +inline +size_t defaultLength(const wchar_t* input) +{ + return wcslen(input); +} + +inline +int defaultCompare(const wchar_t* str1, const wchar_t* str2) +{ + return wcscmp(str1, str2); +} + +inline +int defaultCompare(const wchar_t* str1, const wchar_t* str2, const size_t count) +{ + return wcsncmp(str1, str2, count); +} + +inline +const wchar_t* defaultStrFind(const wchar_t* str1, const wchar_t* str2) +{ + return wcsstr(str1, str2); +} + +inline +const wchar_t* defaultStrFind(const wchar_t* str1, wchar_t ch) +{ + return wcschr(str1, ch); +} + +inline +bool defaultIsWhiteSpace(const wchar_t ch) +{ + // some compilers (e.g. VC++ 6.0) return true for a call to isspace('\xEA') => exclude char(128) to char(255) + return (ch < 128 || ch > 255) && iswspace(ch) != 0; +} + +inline +wchar_t defaultToLower(const wchar_t ch) +{ + return towlower(ch); +} +#endif + + +#ifdef __WXDEBUG__ +class AllocationCount //small test for memory leaks in Zstring +{ +public: + void inc(const DefaultChar* object) + { + activeStrings.insert(object); + } + + void dec(const DefaultChar* object) + { + activeStrings.erase(object); + } + + static AllocationCount& getInstance(); + +private: + AllocationCount() {} + ~AllocationCount(); + + std::set<const DefaultChar*> activeStrings; +}; +#endif + + +inline +size_t getCapacityToAllocate(const size_t length) +{ + return (length + (19 - length % 16)); //allocate some additional length to speed up concatenation +} + + +inline +void Zstring::allocate(const size_t newLength, + StringDescriptor*& newDescr, + DefaultChar*& newData) +{ //allocate and set data for new string + const size_t newCapacity = getCapacityToAllocate(newLength); + assert(newCapacity); + + newDescr = static_cast<StringDescriptor*>(operator new [] (sizeof(StringDescriptor) + (newCapacity + 1) * sizeof(DefaultChar))); + newData = reinterpret_cast<DefaultChar*>(newDescr + 1); + + newDescr->refCount = 1; + newDescr->length = newLength; + newDescr->capacity = newCapacity; + +#ifdef __WXDEBUG__ + AllocationCount::getInstance().inc(newData); //test Zstring for memory leaks +#endif +} + + +inline +Zstring::Zstring() +{ + //static (dummy) empty Zstring +#ifdef ZSTRING_CHAR + static Zstring emptyString(""); +#elif defined ZSTRING_WIDE_CHAR + static Zstring emptyString(L""); +#endif + + emptyString.incRef(); + descr = emptyString.descr; + data = emptyString.data; +} + + +inline +Zstring::Zstring(const DefaultChar* source) +{ + initAndCopy(source, defaultLength(source)); +} + + +inline +Zstring::Zstring(const DefaultChar* source, size_t sourceLen) +{ + initAndCopy(source, sourceLen); +} + + +inline +Zstring::Zstring(const Zstring& source) +{ + descr = source.descr; + data = source.data; + incRef(); //reference counting! +} + + +inline +Zstring::~Zstring() +{ + decRef(); +} + + +inline +void Zstring::initAndCopy(const DefaultChar* source, size_t sourceLen) +{ + allocate(sourceLen, descr, data); + memcpy(data, source, sourceLen * sizeof(DefaultChar)); + data[sourceLen] = 0; +} + + +inline +void Zstring::incRef() const +{ + assert(descr); + ++descr->refCount; +} + + +inline +void Zstring::decRef() +{ + assert(descr && descr->refCount >= 1); //descr points to the begin of the allocated memory block + if (--descr->refCount == 0) + { + operator delete [] (descr); //this must NEVER be changed!! E.g. Trim() relies on descr being start of allocated memory block + descr = NULL; +#ifdef __WXDEBUG__ + AllocationCount::getInstance().dec(data); //test Zstring for memory leaks +#endif + } +} + + +#ifdef FFS_WIN +inline +int Zstring::CmpNoCase(const DefaultChar* other) const +{ + return FreeFileSync::compareStringsWin32(c_str(), other); //way faster than wxString::CmpNoCase()!! +} + + +inline +int Zstring::CmpNoCase(const Zstring& other) const +{ + return FreeFileSync::compareStringsWin32(c_str(), other.c_str(), length(), other.length()); //way faster than wxString::CmpNoCase()!! +} +#endif + + +inline +Zstring::operator const DefaultChar*() const +{ + return c_str(); +} + + +inline +Zstring& Zstring::operator=(const Zstring& source) +{ + source.incRef(); //implicitly handle case "this == &source" and avoid this check + decRef(); // + descr = source.descr; + data = source.data; + + return *this; +} + + +inline +size_t Zstring::Find(DefaultChar ch, bool fromEnd) const +{ + if (fromEnd) + return rfind(ch, npos); + else + return find(ch, 0); +} + + +// get all characters after the last occurence of ch +// (returns the whole string if ch not found) +inline +Zstring Zstring::AfterLast(DefaultChar ch) const +{ + size_t pos = rfind(ch, npos); + if (pos == npos ) + return *this; + else + return c_str() + pos + 1; +} + + +// get all characters before the last occurence of ch +// (returns empty string if ch not found) +inline +Zstring Zstring::BeforeLast(DefaultChar ch) const +{ + size_t pos = rfind(ch, npos); + + if (pos != npos && pos != 0 ) + return Zstring(data, pos); //data is non-empty string in this context: else ch would not have been found! + else + return Zstring(); +} + + +inline +bool Zstring::StartsWith(const DefaultChar* begin) const +{ + const size_t beginLength = defaultLength(begin); + if (length() < beginLength) + return false; + return compare(0, beginLength, begin) == 0; +} + + +inline +bool Zstring::StartsWith(const Zstring& begin) const +{ + const size_t beginLength = begin.length(); + if (length() < beginLength) + return false; + return compare(0, beginLength, begin) == 0; +} + + +inline +bool Zstring::EndsWith(const DefaultChar* end) const +{ + const size_t thisLength = length(); + const size_t endLength = defaultLength(end); + if (thisLength < endLength) + return false; + return compare(thisLength - endLength, endLength, end) == 0; +} + + +inline +bool Zstring::EndsWith(const DefaultChar end) const +{ + const size_t len = length(); + return len && (this->operator[](len - 1) == end); +} + + +inline +bool Zstring::EndsWith(const Zstring& end) const +{ + const size_t thisLength = length(); + const size_t endLength = end.length(); + if (thisLength < endLength) + return false; + return compare(thisLength - endLength, endLength, end) == 0; +} + + +inline +Zstring& Zstring::Truncate(size_t newLen) +{ + if (newLen < length()) + { + if (descr->refCount > 1) //allocate new string + return *this = Zstring(c_str(), newLen); + else //overwrite this string + { + descr->length = newLen; + data[newLen] = DefaultChar(0); + } + } + + return *this; +} + + +inline +size_t Zstring::find(const DefaultChar* str, const size_t pos) const +{ + assert(pos <= length()); + const DefaultChar* thisStr = c_str(); + const DefaultChar* found = defaultStrFind(thisStr + pos, str); + return found == NULL ? npos : found - thisStr; +} + + +inline +size_t Zstring::find(const DefaultChar ch, const size_t pos) const +{ + assert(pos <= length()); + const DefaultChar* thisStr = c_str(); + const DefaultChar* found = defaultStrFind(thisStr + pos, ch); + return found == NULL ? npos : found - thisStr; +} + + +inline +int Zstring::Cmp(const DefaultChar* other) const +{ + return compare(other); +} + + +inline +int Zstring::Cmp(const Zstring& other) const +{ + return defaultCompare(c_str(), other.c_str()); //overload using strcmp(char*, char*) should be fastest! +} + + +inline +bool Zstring::operator == (const Zstring& other) const +{ + return length() != other.length() ? false : defaultCompare(c_str(), other.c_str()) == 0; +} + + +inline +bool Zstring::operator == (const DefaultChar* other) const +{ + return defaultCompare(c_str(), other) == 0; //overload using strcmp(char*, char*) should be fastest! +} + + +inline +bool Zstring::operator < (const Zstring& other) const +{ + return defaultCompare(c_str(), other.c_str()) < 0; +} + + +inline +bool Zstring::operator < (const DefaultChar* other) const +{ + return defaultCompare(c_str(), other) < 0; //overload using strcmp(char*, char*) should be fastest! +} + + +inline +bool Zstring::operator != (const Zstring& other) const +{ + return length() != other.length() ? true: defaultCompare(c_str(), other.c_str()) != 0; +} + + +inline +bool Zstring::operator != (const DefaultChar* other) const +{ + return defaultCompare(c_str(), other) != 0; //overload using strcmp(char*, char*) should be fastest! +} + + +inline +int Zstring::compare(const Zstring& other) const +{ + return defaultCompare(c_str(), other.c_str()); //overload using strcmp(char*, char*) should be fastest! +} + + +inline +int Zstring::compare(const DefaultChar* other) const +{ + return defaultCompare(c_str(), other); //overload using strcmp(char*, char*) should be fastest! +} + + +inline +int Zstring::compare(const size_t pos1, const size_t n1, const DefaultChar* other) const +{ + assert(length() - pos1 >= n1); + return defaultCompare(c_str() + pos1, other, n1); +} + + +inline +size_t Zstring::length() const +{ + return descr->length; +} + + +inline +size_t Zstring::size() const +{ + return descr->length; +} + + +inline +const DefaultChar* Zstring::c_str() const +{ + return data; +} + + +inline +bool Zstring::empty() const +{ + return descr->length == 0; +} + + +inline +void Zstring::clear() +{ + *this = Zstring(); +} + + +inline +const DefaultChar Zstring::operator[](const size_t pos) const +{ + assert(pos < length()); + return data[pos]; +} + + +inline +const Zstring Zstring::operator+(const Zstring& string2) const +{ + return Zstring(*this)+=string2; +} + + +inline +const Zstring Zstring::operator+(const DefaultChar* string2) const +{ + return Zstring(*this)+=string2; +} + + +inline +const Zstring Zstring::operator+(const DefaultChar ch) const +{ + return Zstring(*this)+=ch; +} + +//##################### Zsubstr ############################# +inline +Zsubstr Zstring::zsubstr(size_t pos) const +{ + assert(pos <= length()); + return Zsubstr(*this, pos); //return reference counted string +} + + +inline +Zsubstr::Zsubstr() +{ + m_data = m_ref.c_str(); + m_length = 0; +} + + +inline +Zsubstr::Zsubstr(const Zstring& ref, const size_t pos) : + m_ref(ref), + m_data(ref.c_str() + pos), + m_length(ref.length() - pos) {} + + +inline +const DefaultChar* Zsubstr::c_str() const +{ + return m_data; +} + + +inline +size_t Zsubstr::length() const +{ + return m_length; +} + + +inline +bool Zsubstr::StartsWith(const Zstring& begin) const +{ + const size_t beginLength = begin.length(); + if (length() < beginLength) + return false; + + return defaultCompare(m_data, begin.c_str(), beginLength) == 0; +} + + +inline +size_t Zsubstr::findFromEnd(const DefaultChar ch) const +{ + size_t pos = length(); + while (--pos != static_cast<size_t>(-1)) + { + if (m_data[pos] == ch) + return pos; + } + return Zstring::npos; +} + + + +#endif // ZSTRING_H_INCLUDED diff --git a/structures.cpp b/structures.cpp index 6744a263..90dd0747 100644 --- a/structures.cpp +++ b/structures.cpp @@ -1,116 +1,56 @@ #include "structures.h" -#include "library/fileHandling.h" +#include "shared/fileHandling.h" #include <wx/intl.h> -#include <wx/stdpaths.h> -#include <wx/filename.h> +#include "shared/globalFunctions.h" -using namespace FreeFileSync; - -#ifdef FFS_WIN -const wxChar FreeFileSync::FILE_NAME_SEPARATOR = '\\'; -#elif defined FFS_LINUX -const wxChar FreeFileSync::FILE_NAME_SEPARATOR = '/'; -#else -assert(false); -#endif - -//these two global variables are language-dependent => cannot be set constant! See CustomLocale -const wxChar* FreeFileSync::DECIMAL_POINT = wxEmptyString; -const wxChar* FreeFileSync::THOUSANDS_SEPARATOR = wxEmptyString; +FreeFileSync::MainConfiguration::MainConfiguration() : + compareVar(CMP_BY_TIME_SIZE), + filterIsActive(false), //do not filter by default + includeFilter(wxT("*")), //include all files/folders + excludeFilter(wxEmptyString), //exclude nothing + handleDeletion(FreeFileSync::recycleBinExists() ? MOVE_TO_RECYCLE_BIN : DELETE_PERMANENTLY) {} //enable if OS supports it; else user will have to activate first and then get an error message -wxString assembleFileForUserData(const wxString fileName) +wxString FreeFileSync::getVariantName(CompareVariant var) { - static const bool isPortableVersion = !wxFileExists(wxT("uninstall.exe")); //this check is a bit lame... - - if (isPortableVersion) //use same directory as executable - return getInstallationDir() + FILE_NAME_SEPARATOR + fileName; - else //usen OS' standard paths + switch (var) { - wxString userDirectory = wxStandardPathsBase::Get().GetUserDataDir(); - - if (!userDirectory.EndsWith(wxString(FreeFileSync::FILE_NAME_SEPARATOR))) - userDirectory += FreeFileSync::FILE_NAME_SEPARATOR; - - if (!wxDirExists(userDirectory)) - try - { - FreeFileSync::createDirectory(userDirectory.c_str(), wxEmptyString, false); - } - catch (FreeFileSync::FileError&) - {} - - return userDirectory + fileName; + case CMP_BY_CONTENT: + return _("File content"); + case CMP_BY_TIME_SIZE: + return _("File size and date"); } -} - - -//save user configuration in OS' standard application folders -const wxString& FreeFileSync::getLastConfigFile() -{ - static wxString instance = assembleFileForUserData(wxT("LastRun.ffs_gui")); - return instance; -} - -const wxString& FreeFileSync::getGlobalConfigFile() -{ - static wxString instance = assembleFileForUserData(wxT("GlobalSettings.xml")); - return instance; -} - - -const wxString& FreeFileSync::getDefaultLogDirectory() -{ - static wxString instance = assembleFileForUserData(wxT("Logs")); - return instance; -} - - -const wxString& FreeFileSync::getLastErrorTxtFile() -{ - static wxString instance = assembleFileForUserData(wxT("LastError.txt")); - return instance; + assert(false); + return wxEmptyString; } -const wxString& FreeFileSync::getInstallationDir() -{ - static wxString instance = wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath(); - return instance; -} - - -MainConfiguration::MainConfiguration() : - compareVar(CMP_BY_TIME_SIZE), - filterIsActive(false), //do not filter by default - includeFilter(wxT("*")), //include all files/folders - excludeFilter(wxEmptyString), //exclude nothing - useRecycleBin(FreeFileSync::recycleBinExists()) {} //enable if OS supports it; else user will have to activate first and then get an error message +using FreeFileSync::SyncConfiguration; SyncConfiguration::Variant SyncConfiguration::getVariant() { - if ( exLeftSideOnly == SYNC_DIR_RIGHT && - exRightSideOnly == SYNC_DIR_RIGHT && - leftNewer == SYNC_DIR_RIGHT && - rightNewer == SYNC_DIR_RIGHT && - different == SYNC_DIR_RIGHT) + if ( exLeftSideOnly == SYNC_DIR_CFG_RIGHT && + exRightSideOnly == SYNC_DIR_CFG_RIGHT && + leftNewer == SYNC_DIR_CFG_RIGHT && + rightNewer == SYNC_DIR_CFG_RIGHT && + different == SYNC_DIR_CFG_RIGHT) return MIRROR; //one way -> - else if (exLeftSideOnly == SYNC_DIR_RIGHT && - exRightSideOnly == SYNC_DIR_NONE && - leftNewer == SYNC_DIR_RIGHT && - rightNewer == SYNC_DIR_NONE && - different == SYNC_DIR_NONE) + else if (exLeftSideOnly == SYNC_DIR_CFG_RIGHT && + exRightSideOnly == SYNC_DIR_CFG_NONE && + leftNewer == SYNC_DIR_CFG_RIGHT && + rightNewer == SYNC_DIR_CFG_NONE && + different == SYNC_DIR_CFG_NONE) return UPDATE; //Update -> - else if (exLeftSideOnly == SYNC_DIR_RIGHT && - exRightSideOnly == SYNC_DIR_LEFT && - leftNewer == SYNC_DIR_RIGHT && - rightNewer == SYNC_DIR_LEFT && - different == SYNC_DIR_NONE) + else if (exLeftSideOnly == SYNC_DIR_CFG_RIGHT && + exRightSideOnly == SYNC_DIR_CFG_LEFT && + leftNewer == SYNC_DIR_CFG_RIGHT && + rightNewer == SYNC_DIR_CFG_LEFT && + different == SYNC_DIR_CFG_NONE) return TWOWAY; //two way <-> else return CUSTOM; //other @@ -140,25 +80,25 @@ void SyncConfiguration::setVariant(const Variant var) switch (var) { case MIRROR: - exLeftSideOnly = SYNC_DIR_RIGHT; - exRightSideOnly = SYNC_DIR_RIGHT; - leftNewer = SYNC_DIR_RIGHT; - rightNewer = SYNC_DIR_RIGHT; - different = SYNC_DIR_RIGHT; + exLeftSideOnly = SYNC_DIR_CFG_RIGHT; + exRightSideOnly = SYNC_DIR_CFG_RIGHT; + leftNewer = SYNC_DIR_CFG_RIGHT; + rightNewer = SYNC_DIR_CFG_RIGHT; + different = SYNC_DIR_CFG_RIGHT; break; case UPDATE: - exLeftSideOnly = SYNC_DIR_RIGHT; - exRightSideOnly = SYNC_DIR_NONE; - leftNewer = SYNC_DIR_RIGHT; - rightNewer = SYNC_DIR_NONE; - different = SYNC_DIR_NONE; + exLeftSideOnly = SYNC_DIR_CFG_RIGHT; + exRightSideOnly = SYNC_DIR_CFG_NONE; + leftNewer = SYNC_DIR_CFG_RIGHT; + rightNewer = SYNC_DIR_CFG_NONE; + different = SYNC_DIR_CFG_NONE; break; case TWOWAY: - exLeftSideOnly = SYNC_DIR_RIGHT; - exRightSideOnly = SYNC_DIR_LEFT; - leftNewer = SYNC_DIR_RIGHT; - rightNewer = SYNC_DIR_LEFT; - different = SYNC_DIR_NONE; + exLeftSideOnly = SYNC_DIR_CFG_RIGHT; + exRightSideOnly = SYNC_DIR_CFG_LEFT; + leftNewer = SYNC_DIR_CFG_RIGHT; + rightNewer = SYNC_DIR_CFG_LEFT; + different = SYNC_DIR_CFG_NONE; break; case CUSTOM: assert(false); diff --git a/structures.h b/structures.h index 9c53eecd..daf502ad 100644 --- a/structures.h +++ b/structures.h @@ -4,59 +4,63 @@ #include <wx/string.h> #include <set> #include <vector> -#include "library/zstring.h" +#include "shared/zstring.h" #include <wx/longlong.h> +#include "shared/staticAssert.h" namespace FreeFileSync { -//------------------------------------------------------------------------------ -//global variables -//------------------------------------------------------------------------------ - extern const wxChar FILE_NAME_SEPARATOR; - - //language dependent global variables: need to be initialized by CustomLocale on program startup and language switch - extern const wxChar* DECIMAL_POINT; - extern const wxChar* THOUSANDS_SEPARATOR; - - const wxString& getLastConfigFile(); - const wxString& getGlobalConfigFile(); - const wxString& getDefaultLogDirectory(); - const wxString& getLastErrorTxtFile(); - const wxString& getInstallationDir(); //FreeFileSync installation directory without path separator -//------------------------------------------------------------------------------ - enum CompareVariant { - CMP_BY_CONTENT, - CMP_BY_TIME_SIZE + CMP_BY_TIME_SIZE, + CMP_BY_CONTENT }; + wxString getVariantName(CompareVariant var); + + enum SyncDirectionCfg + { + SYNC_DIR_CFG_LEFT = 0, + SYNC_DIR_CFG_RIGHT, + SYNC_DIR_CFG_NONE + }; + //attention make sure these /|\ \|/ two enums match!!! enum SyncDirection { - SYNC_DIR_LEFT, + SYNC_DIR_LEFT = 0, SYNC_DIR_RIGHT, SYNC_DIR_NONE, SYNC_UNRESOLVED_CONFLICT }; + inline + SyncDirection convertToSyncDirection(SyncDirectionCfg syncCfg) + { + assert_static(static_cast<SyncDirection>(SYNC_DIR_CFG_LEFT) == SYNC_DIR_LEFT); + assert_static(static_cast<SyncDirection>(SYNC_DIR_CFG_RIGHT) == SYNC_DIR_RIGHT); + assert_static(static_cast<SyncDirection>(SYNC_DIR_CFG_NONE) == SYNC_DIR_NONE); + + return static_cast<SyncDirection>(syncCfg); + } + struct SyncConfiguration { SyncConfiguration() : - exLeftSideOnly(SYNC_DIR_RIGHT), - exRightSideOnly(SYNC_DIR_LEFT), - leftNewer(SYNC_DIR_RIGHT), - rightNewer(SYNC_DIR_LEFT), - different(SYNC_DIR_NONE) {} - - SyncDirection exLeftSideOnly; - SyncDirection exRightSideOnly; - SyncDirection leftNewer; - SyncDirection rightNewer; - SyncDirection different; + exLeftSideOnly( SYNC_DIR_CFG_RIGHT), + exRightSideOnly(SYNC_DIR_CFG_LEFT), + leftNewer( SYNC_DIR_CFG_RIGHT), + rightNewer( SYNC_DIR_CFG_LEFT), + different( SYNC_DIR_CFG_NONE) {} + + SyncDirectionCfg exLeftSideOnly; + SyncDirectionCfg exRightSideOnly; + SyncDirectionCfg leftNewer; + SyncDirectionCfg rightNewer; + SyncDirectionCfg different; bool operator==(const SyncConfiguration& other) const { @@ -81,6 +85,14 @@ namespace FreeFileSync }; + enum DeletionPolicy + { + DELETE_PERMANENTLY = 5, + MOVE_TO_RECYCLE_BIN, + MOVE_TO_CUSTOM_DIRECTORY + }; + + struct MainConfiguration { MainConfiguration(); @@ -97,15 +109,18 @@ namespace FreeFileSync wxString excludeFilter; //misc options - bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing + DeletionPolicy handleDeletion; //use Recycle, delete permanently or move to user-defined location + wxString customDeletionDirectory; bool operator==(const MainConfiguration& other) const { - return compareVar == other.compareVar && + return compareVar == other.compareVar && syncConfiguration == other.syncConfiguration && - filterIsActive == other.filterIsActive && - includeFilter == other.includeFilter && - excludeFilter == other.excludeFilter; + filterIsActive == other.filterIsActive && + includeFilter == other.includeFilter && + excludeFilter == other.excludeFilter && + handleDeletion == other.handleDeletion && + customDeletionDirectory == other.customDeletionDirectory; } }; @@ -177,6 +192,35 @@ namespace FreeFileSync FILE_CONFLICT, }; + //quick workaround until tr1::shared_ptr is available + class OptionalString + { + public: + OptionalString() : str(NULL) {} + OptionalString(const wxString& other) : str(new wxString(other)) {} + OptionalString(const OptionalString& other) : str(other.str == NULL ? NULL : new wxString(*other.str)) {} + ~OptionalString() + { + delete str; + } + + OptionalString& operator=(const OptionalString& other) + { + wxString* newStr = other.str == NULL ? NULL : new wxString(*other.str); + delete str; + str = newStr; + return *this; + } + + const wxString& get() const + { + static const wxString emptyStr; + return str == NULL ? emptyStr : *str; + } + + private: + wxString* str; + }; struct FileCompareLine { @@ -184,32 +228,20 @@ namespace FreeFileSync const SyncDirection defaultDirection, const bool selected) : cmpResult(defaultCmpResult), - direction(defaultDirection), + syncDir(defaultDirection), selectedForSynchronization(selected) {} - typedef unsigned int FolderPairNr; - - FolderPairNr folderPairRef; - FileDescrLine fileDescrLeft; FileDescrLine fileDescrRight; CompareFilesResult cmpResult; - SyncDirection direction; + SyncDirection syncDir; bool selectedForSynchronization; - }; - typedef std::vector<FileCompareLine> FileComparison; - - - struct FileComparison2 - { - std::vector<FolderPair> directoryPairs; //directoryPairs - cmpLines 1:n + OptionalString conflictDescription; //filled only if cmpResult == FILE_CONFLICT - std::vector<FileCompareLine> cmpLines; }; - - + typedef std::vector<FileCompareLine> FileComparison; struct FolderCompareLine //support for multiple folder pairs diff --git a/synchronization.cpp b/synchronization.cpp index 0c49c3a1..a1c12784 100644 --- a/synchronization.cpp +++ b/synchronization.cpp @@ -2,136 +2,125 @@ #include <wx/intl.h> #include <wx/msgdlg.h> #include <wx/log.h> -#include "library/resources.h" #include "algorithm.h" -#include "library/globalFunctions.h" +#include "shared/globalFunctions.h" #include "library/statusHandler.h" -#include "library/fileHandling.h" -#include <utility> +#include "shared/fileHandling.h" using namespace FreeFileSync; -inline -bool getBytesToTransfer(const FileCompareLine& fileCmpLine, - int& objectsToCreate, - int& objectsToOverwrite, - int& objectsToDelete, - int& conflicts, - wxULongLong& dataToProcess) -{ //return false if nothing has to be done - - objectsToCreate = 0; //always initialize variables - objectsToOverwrite = 0; - objectsToDelete = 0; - conflicts = 0; - dataToProcess = 0; - - switch (FreeFileSync::getSyncOperation(fileCmpLine.cmpResult, fileCmpLine.selectedForSynchronization, fileCmpLine.direction)) //evaluate comparison result and sync direction - { - case SO_CREATE_NEW_LEFT: - dataToProcess = fileCmpLine.fileDescrRight.fileSize; - objectsToCreate = 1; - return true; +void SyncStatistics::init() +{ + createLeft = 0; + createRight = 0; + overwriteLeft = 0; + overwriteRight = 0; + deleteLeft = 0; + deleteRight = 0; + conflict = 0; +} - case SO_CREATE_NEW_RIGHT: - dataToProcess = fileCmpLine.fileDescrLeft.fileSize; - objectsToCreate = 1; - return true; - case SO_DELETE_LEFT: - case SO_DELETE_RIGHT: - dataToProcess = 0; - objectsToDelete = 1; - return true; +SyncStatistics::SyncStatistics(const FileComparison& fileCmp) +{ + init(); - case SO_OVERWRITE_RIGHT: - dataToProcess = fileCmpLine.fileDescrLeft.fileSize; - objectsToOverwrite = 1; - return true; + FileComparison::const_iterator start = fileCmp.begin(); + FileComparison::const_iterator end = fileCmp.end(); + for (; start != end; ++start) + getNumbers(*start); +} - case SO_OVERWRITE_LEFT: - dataToProcess = fileCmpLine.fileDescrRight.fileSize; - objectsToOverwrite = 1; - return true; - case SO_DO_NOTHING: - return false; +SyncStatistics::SyncStatistics(const FolderComparison& folderCmp) +{ + init(); - case SO_UNRESOLVED_CONFLICT: - conflicts = 1; - return true; + for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) + { + const FileComparison& fileCmp = j->fileCmp; + + FileComparison::const_iterator start = fileCmp.begin(); + FileComparison::const_iterator end = fileCmp.end(); + for (; start != end; ++start) + getNumbers(*start); } +} + - return false; //dummy +int SyncStatistics::getCreate(bool inclLeft, bool inclRight) const +{ + return (inclLeft ? createLeft : 0) + + (inclRight ? createRight : 0); } -//runs at folder pair level -void calcBytesToSync(const FileComparison& fileCmp, - int& objectsToCreate, - int& objectsToOverwrite, - int& objectsToDelete, - int& conflicts, - wxULongLong& dataToProcess) +int SyncStatistics::getOverwrite(bool inclLeft, bool inclRight) const { - objectsToCreate = 0; - objectsToOverwrite = 0; - objectsToDelete = 0; - conflicts = 0; - dataToProcess = 0; - - int toCreate = 0; - int toOverwrite = 0; - int toDelete = 0; - int newConflicts = 0; - wxULongLong data; + return (inclLeft ? overwriteLeft : 0) + + (inclRight ? overwriteRight : 0); +} - for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) - { //only sum up sizes of files AND directories - if (getBytesToTransfer(*i, toCreate, toOverwrite, toDelete, newConflicts, data)) - { - objectsToCreate += toCreate; - objectsToOverwrite += toOverwrite; - objectsToDelete += toDelete; - conflicts += newConflicts; - dataToProcess += data; - } - } + +int SyncStatistics::getDelete(bool inclLeft, bool inclRight) const +{ + return (inclLeft ? deleteLeft : 0) + + (inclRight ? deleteRight : 0); } -//aggregate over all folder pairs -void FreeFileSync::calcTotalBytesToSync(const FolderComparison& folderCmp, - int& objectsToCreate, - int& objectsToOverwrite, - int& objectsToDelete, - int& conflicts, - wxULongLong& dataToProcess) +int SyncStatistics::getConflict() const { - objectsToCreate = 0; - objectsToOverwrite = 0; - objectsToDelete = 0; - conflicts = 0; - dataToProcess = 0; + return conflict; +} - for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) + +wxULongLong SyncStatistics::getDataToProcess() const +{ + return dataToProcess; +} + + +inline +void SyncStatistics::getNumbers(const FileCompareLine& fileCmpLine) +{ + switch (FreeFileSync::getSyncOperation(fileCmpLine)) //evaluate comparison result and sync direction { - const FileComparison& fileCmp = j->fileCmp; + case SO_CREATE_NEW_LEFT: + ++createLeft; + dataToProcess += fileCmpLine.fileDescrRight.fileSize; + break; + + case SO_CREATE_NEW_RIGHT: + ++createRight; + dataToProcess += fileCmpLine.fileDescrLeft.fileSize; + break; + + case SO_DELETE_LEFT: + ++deleteLeft; + break; + + case SO_DELETE_RIGHT: + ++deleteRight; + break; - int toCreate = 0; - int toOverwrite = 0; - int toDelete = 0; - int newConflics = 0; - wxULongLong data; + case SO_OVERWRITE_LEFT: + ++overwriteLeft; + dataToProcess += fileCmpLine.fileDescrRight.fileSize; + break; - calcBytesToSync(fileCmp, toCreate, toOverwrite, toDelete, newConflics, data); + case SO_OVERWRITE_RIGHT: + ++overwriteRight; + dataToProcess += fileCmpLine.fileDescrLeft.fileSize; + break; + + case SO_DO_NOTHING: + break; - objectsToCreate += toCreate; - objectsToOverwrite += toOverwrite; - objectsToDelete += toDelete; - conflicts += newConflics; - dataToProcess += data; + case SO_UNRESOLVED_CONFLICT: + ++conflict; + break; } } @@ -147,7 +136,7 @@ std::pair<wxLongLong, wxLongLong> spaceNeededSub(const FileComparison& fileCmp) if (i->selectedForSynchronization) //do not add filtered entries { //get data to process - switch (i->direction) + switch (i->syncDir) { case SYNC_DIR_LEFT: //copy from right to left if (!recyclerUsed) @@ -172,70 +161,55 @@ std::pair<wxLongLong, wxLongLong> spaceNeededSub(const FileComparison& fileCmp) } -std::pair<wxLongLong, wxLongLong> freeDiskSpaceNeeded(const FileComparison& fileCmp, const bool recyclerUsed) +std::pair<wxLongLong, wxLongLong> freeDiskSpaceNeeded(const FileComparison& fileCmp, const DeletionPolicy handleDeletion) { - if (recyclerUsed) - return spaceNeededSub<true>(fileCmp); - else - return spaceNeededSub<false>(fileCmp); -} - - -bool unresolvedConflictsExisting(const FolderComparison& folderCmp) -{ - for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) + switch (handleDeletion) { - const FileComparison& fileCmp = j->fileCmp; - for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) - if (i->direction == SYNC_UNRESOLVED_CONFLICT) - return true; + case FreeFileSync::DELETE_PERMANENTLY: + return spaceNeededSub<false>(fileCmp); + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + return spaceNeededSub<true>(fileCmp); + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + return spaceNeededSub<true>(fileCmp); //this is not necessarily correct! it needs to be checked if user-def recycle bin dir and sync-dir are on same drive } - return false; + + assert(false); + return spaceNeededSub<true>(fileCmp); //dummy } bool FreeFileSync::synchronizationNeeded(const FolderComparison& folderCmp) { - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflicts = 0; - wxULongLong dataToProcess; - - FreeFileSync::calcTotalBytesToSync(folderCmp, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflicts, - dataToProcess); - - return objectsToCreate + objectsToOverwrite + objectsToDelete + conflicts != 0; + const SyncStatistics statisticsTotal(folderCmp); + return statisticsTotal.getCreate() + statisticsTotal.getOverwrite() + statisticsTotal.getDelete() != 0; } -//test if more then 50% of files will be deleted/overwritten +//test if user accidentally tries to sync the wrong folders bool significantDifferenceDetected(const FileComparison& fileCmp) { - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflicts = 0; - wxULongLong dataToProcess; - - calcBytesToSync(fileCmp, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflicts, - dataToProcess); - - const int changedFiles = objectsToCreate + objectsToOverwrite + objectsToDelete + conflicts; //include objectsToCreate also! - - return changedFiles >= 10 && changedFiles > 0.5 * fileCmp.size(); + const SyncStatistics st(fileCmp); + + //initial file copying shall not be detected as major difference + if ( st.getCreate(true, false) == 0 && + st.getOverwrite() == 0 && + st.getDelete() == 0 && + st.getConflict() == 0) return false; + if ( st.getCreate(false, true) == 0 && + st.getOverwrite() == 0 && + st.getDelete() == 0 && + st.getConflict() == 0) return false; + + const int changedRows = st.getCreate() + + st.getOverwrite() + + st.getDelete() + + st.getConflict(); + + return changedRows >= 10 && changedRows > 0.5 * fileCmp.size(); } -SyncOperation FreeFileSync::getSyncOperation( //evaluate comparison result and sync direction +FreeFileSync::SyncOperation FreeFileSync::getSyncOperation( //evaluate comparison result and sync direction const CompareFilesResult cmpResult, const bool selectedForSynchronization, const SyncDirection syncDir) @@ -275,6 +249,19 @@ SyncOperation FreeFileSync::getSyncOperation( //evaluate comparison result and s case FILE_LEFT_NEWER: case FILE_RIGHT_NEWER: case FILE_DIFFERENT: + switch (syncDir) + { + case SYNC_DIR_LEFT: + return SO_OVERWRITE_LEFT; //copy from right to left + case SYNC_DIR_RIGHT: + return SO_OVERWRITE_RIGHT; //copy from left to right + case SYNC_DIR_NONE: + return SO_DO_NOTHING; + case SYNC_UNRESOLVED_CONFLICT: + assert(false); + } + break; + case FILE_CONFLICT: switch (syncDir) { @@ -298,40 +285,53 @@ SyncOperation FreeFileSync::getSyncOperation( //evaluate comparison result and s } -const wxBitmap& FreeFileSync::getSyncOpImage(const CompareFilesResult cmpResult, - const bool selectedForSynchronization, - const SyncDirection syncDir) +SyncOperation FreeFileSync::getSyncOperation(const FileCompareLine& line) //convenience function +{ + return getSyncOperation(line.cmpResult, line.selectedForSynchronization, line.syncDir); +} + + +/*add some postfix to alternate deletion directory: customDir\2009-06-30 12-59-12\ */ +wxString getSessionDeletionDir(const wxString& customDeletionDirectory) { - switch (getSyncOperation(cmpResult, selectedForSynchronization, syncDir)) //evaluate comparison result and sync direction + wxString timeNow = wxDateTime::Now().FormatISOTime(); + timeNow.Replace(wxT(":"), wxT("-")); + + const wxString sessionDir = wxDateTime::Now().FormatISODate() + wxChar(' ') + timeNow; + + wxString formattedDirectory = FreeFileSync::getFormattedDirectoryName(customDeletionDirectory.c_str()).c_str(); + if (formattedDirectory.empty()) + return wxEmptyString; //no valid directory for deletion specified (checked later) + + if (!formattedDirectory.EndsWith(wxString(globalFunctions::FILE_NAME_SEPARATOR))) + formattedDirectory += globalFunctions::FILE_NAME_SEPARATOR; + + formattedDirectory += sessionDir; + + //ensure that session directory does not yet exist (must be unique) + if (FreeFileSync::dirExists(formattedDirectory)) { - case SO_CREATE_NEW_LEFT: - return *GlobalResources::getInstance().bitmapCreateLeftSmall; - case SO_CREATE_NEW_RIGHT: - return *GlobalResources::getInstance().bitmapCreateRightSmall; - case SO_DELETE_LEFT: - return *GlobalResources::getInstance().bitmapDeleteLeftSmall; - case SO_DELETE_RIGHT: - return *GlobalResources::getInstance().bitmapDeleteRightSmall; - case SO_OVERWRITE_RIGHT: - return *GlobalResources::getInstance().bitmapSyncDirRightSmall; - case SO_OVERWRITE_LEFT: - return *GlobalResources::getInstance().bitmapSyncDirLeftSmall; - case SO_DO_NOTHING: - return *GlobalResources::getInstance().bitmapSyncDirNoneSmall; - case SO_UNRESOLVED_CONFLICT: - return *GlobalResources::getInstance().bitmapConflictSmall; + //if it's not unique, add a postfix number + int postfix = 1; + while (FreeFileSync::dirExists(formattedDirectory + wxT("_") + globalFunctions::numberToWxString(postfix))) + ++postfix; + + formattedDirectory += wxT("_") + globalFunctions::numberToWxString(postfix); } - return wxNullBitmap; //dummy + formattedDirectory += globalFunctions::FILE_NAME_SEPARATOR; + return formattedDirectory; } -SyncProcess::SyncProcess(const bool useRecycler, +SyncProcess::SyncProcess(const DeletionPolicy handleDeletion, + const wxString& custDelFolder, const bool copyFileSymLinks, const bool traverseDirSymLinks, xmlAccess::WarningMessages& warnings, StatusHandler* handler) : - m_useRecycleBin(useRecycler), + m_handleDeletion(handleDeletion), + sessionDeletionDirectory(getSessionDeletionDir(custDelFolder).c_str()), m_copyFileSymLinks(copyFileSymLinks), m_traverseDirSymLinks(traverseDirSymLinks), m_warnings(warnings), @@ -341,98 +341,197 @@ SyncProcess::SyncProcess(const bool useRecycler, statusUpdater(handler), txtCopyingFile(Zstring(_("Copying file %x to %y")).Replace(wxT("%x"), wxT("\"%x\""), false).Replace(wxT("%y"), wxT("\n\"%y\""), false)), txtOverwritingFile(Zstring(_("Copying file %x to %y overwriting target")).Replace(wxT("%x"), wxT("\"%x\""), false).Replace(wxT("%y"), wxT("\n\"%y\""), false)), - txtCreatingFolder(Zstring(_("Creating folder %x")).Replace( wxT("%x"), wxT("\n\"%x\""), false)), - txtDeletingFile(useRecycler ? Zstring(_("Moving %x to Recycle Bin")).Replace(wxT("%x"), wxT("\"%x\""), false) : - Zstring(_("Deleting file %x")).Replace(wxT("%x"), wxT("\n\"%x\""), false)), - txtDeletingFolder(useRecycler ? Zstring(_("Moving %x to Recycle Bin")).Replace( wxT("%x"), wxT("\"%x\""), false) : - Zstring(_("Deleting folder %x")).Replace( wxT("%x"), wxT("\n\"%x\""), false)) {} + txtCreatingFolder(Zstring(_("Creating folder %x")).Replace(wxT("%x"), wxT("\n\"%x\""), false)), + + txtDeletingFile(m_handleDeletion == MOVE_TO_RECYCLE_BIN ? Zstring(_("Moving %x to Recycle Bin")).Replace(wxT("%x"), wxT("\"%x\""), false) : + m_handleDeletion == DELETE_PERMANENTLY ? Zstring(_("Deleting file %x")).Replace(wxT("%x"), wxT("\n\"%x\""), false) : + Zstring(_("Moving %x to custom directory")).Replace(wxT("%x"), wxT("\"%x\""), false)), + + txtDeletingFolder(m_handleDeletion == MOVE_TO_RECYCLE_BIN ? Zstring(_("Moving %x to Recycle Bin")).Replace( wxT("%x"), wxT("\"%x\""), false) : + m_handleDeletion == DELETE_PERMANENTLY ? Zstring(_("Deleting folder %x")).Replace( wxT("%x"), wxT("\n\"%x\""), false) : + Zstring(_("Moving %x to custom directory")).Replace(wxT("%x"), wxT("\"%x\""), false)) +{} + + +class MoveFileCallbackImpl : public MoveFileCallback //callback functionality +{ +public: + MoveFileCallbackImpl(StatusHandler* handler) : m_statusHandler(handler) {} + + virtual Response requestUiRefresh() //DON'T throw exceptions here, at least in Windows build! + { +#ifdef FFS_WIN + m_statusHandler->requestUiRefresh(false); //don't allow throwing exception within this call: windows copying callback can't handle this + if (m_statusHandler->abortIsRequested()) + return MoveFileCallback::CANCEL; +#elif defined FFS_LINUX + m_statusHandler->requestUiRefresh(); //exceptions may be thrown here! +#endif + return MoveFileCallback::CONTINUE; + } + +private: + StatusHandler* m_statusHandler; +}; inline -bool SyncProcess::synchronizeFile(const FileCompareLine& cmpLine, const FolderPair& folderPair) -{ //return false if nothing had to be done +void SyncProcess::removeFile(const FileDescrLine& fildesc, const Zstring& altDeletionDir) +{ + switch (m_handleDeletion) + { + case FreeFileSync::DELETE_PERMANENTLY: + FreeFileSync::removeFile(fildesc.fullName, false); + break; + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + FreeFileSync::removeFile(fildesc.fullName, true); + break; + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + if (FreeFileSync::fileExists(fildesc.fullName)) + { + const Zstring targetFile = altDeletionDir + fildesc.relativeName.c_str(); //altDeletionDir ends with path separator + const Zstring targetDir = targetFile.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + + if (!FreeFileSync::dirExists(targetDir)) + { + if (!targetDir.empty()) //kind of pathological ? + //lazy creation of alternate deletion directory (including super-directories of targetFile) + FreeFileSync::createDirectory(targetDir, Zstring(), false); + /*symbolic link handling: + if "not traversing symlinks": fullName == c:\syncdir<symlinks>\some\dirs\leaf<symlink> + => setting irrelevant + if "traversing symlinks": fullName == c:\syncdir<symlinks>\some\dirs<symlinks>\leaf<symlink> + => setting NEEDS to be false: We want to move leaf, therefore symlinks in "some\dirs" must not interfere */ + } + + MoveFileCallbackImpl callBack(statusUpdater); //if file needs to be copied we need callback functionality to update screen and offer abort + FreeFileSync::moveFile(fildesc.fullName, targetFile, &callBack); + } + break; + } +} + +void SyncProcess::synchronizeFile(const FileCompareLine& cmpLine, const FolderPair& folderPair, const Zstring& altDeletionDir) +{ Zstring statusText; Zstring target; - switch (getSyncOperation(cmpLine.cmpResult, cmpLine.selectedForSynchronization, cmpLine.direction)) //evaluate comparison result and sync direction + switch (getSyncOperation(cmpLine)) //evaluate comparison result and sync direction { case SO_CREATE_NEW_LEFT: target = folderPair.leftDirectory + cmpLine.fileDescrRight.relativeName.c_str(); statusText = txtCopyingFile; - statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR), false); - statusText.Replace(wxT("%y"), target.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%y"), target.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR), false); statusUpdater->updateStatusText(statusText); copyFileUpdating(cmpLine.fileDescrRight.fullName, target, cmpLine.fileDescrRight.fileSize); - return true; + break; case SO_CREATE_NEW_RIGHT: target = folderPair.rightDirectory + cmpLine.fileDescrLeft.relativeName.c_str(); statusText = txtCopyingFile; - statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR), false); - statusText.Replace(wxT("%y"), target.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%y"), target.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR), false); statusUpdater->updateStatusText(statusText); copyFileUpdating(cmpLine.fileDescrLeft.fullName, target, cmpLine.fileDescrLeft.fileSize); - return true; + break; case SO_DELETE_LEFT: statusText = txtDeletingFile; statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName, false); statusUpdater->updateStatusText(statusText); - removeFile(cmpLine.fileDescrLeft.fullName, m_useRecycleBin); - return true; + removeFile(cmpLine.fileDescrLeft, altDeletionDir); + break; case SO_DELETE_RIGHT: statusText = txtDeletingFile; statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName, false); statusUpdater->updateStatusText(statusText); - removeFile(cmpLine.fileDescrRight.fullName, m_useRecycleBin); - return true; + removeFile(cmpLine.fileDescrRight, altDeletionDir); + break; case SO_OVERWRITE_RIGHT: statusText = txtOverwritingFile; - statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR), false); - statusText.Replace(wxT("%y"), cmpLine.fileDescrRight.fullName.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%y"), cmpLine.fileDescrRight.fullName.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR), false); statusUpdater->updateStatusText(statusText); - removeFile(cmpLine.fileDescrRight.fullName, m_useRecycleBin); //only used if switch activated by user, else file is simply deleted + removeFile(cmpLine.fileDescrRight, altDeletionDir); copyFileUpdating(cmpLine.fileDescrLeft.fullName, cmpLine.fileDescrRight.fullName, cmpLine.fileDescrLeft.fileSize); - return true; + break; case SO_OVERWRITE_LEFT: statusText = txtOverwritingFile; - statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR), false); - statusText.Replace(wxT("%y"), cmpLine.fileDescrLeft.fullName.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR), false); + statusText.Replace(wxT("%y"), cmpLine.fileDescrLeft.fullName.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR), false); statusUpdater->updateStatusText(statusText); - removeFile(cmpLine.fileDescrLeft.fullName, m_useRecycleBin); //only used if switch activated by user, else file is simply deleted + removeFile(cmpLine.fileDescrLeft, altDeletionDir); copyFileUpdating(cmpLine.fileDescrRight.fullName, cmpLine.fileDescrLeft.fullName, cmpLine.fileDescrRight.fileSize); - return true; + break; case SO_DO_NOTHING: case SO_UNRESOLVED_CONFLICT: - return false; + return; //no update on processed data! } - return false; //dummy + //progress indicator update + //indicator is updated only if file is sync'ed correctly (and if some sync was done)! + statusUpdater->updateProcessedData(1, 0); //processed data is communicated in subfunctions! } inline -bool SyncProcess::synchronizeFolder(const FileCompareLine& cmpLine, const FolderPair& folderPair) -{ //return false if nothing had to be done +void SyncProcess::removeFolder(const FileDescrLine& fildesc, const Zstring& altDeletionDir) +{ + switch (m_handleDeletion) + { + case FreeFileSync::DELETE_PERMANENTLY: + FreeFileSync::removeDirectory(fildesc.fullName, false); + break; + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + FreeFileSync::removeDirectory(fildesc.fullName, true); + break; + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + if (FreeFileSync::dirExists(fildesc.fullName)) + { + const Zstring targetDir = altDeletionDir + fildesc.relativeName.c_str(); + const Zstring targetSuperDir = targetDir.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR);; + + if (!FreeFileSync::dirExists(targetSuperDir)) + { + if (!targetSuperDir.empty()) //kind of pathological ? + //lazy creation of alternate deletion directory (including super-directories of targetFile) + FreeFileSync::createDirectory(targetSuperDir, Zstring(), false); + /*symbolic link handling: + if "not traversing symlinks": fullName == c:\syncdir<symlinks>\some\dirs\leaf<symlink> + => setting irrelevant + if "traversing symlinks": fullName == c:\syncdir<symlinks>\some\dirs<symlinks>\leaf<symlink> + => setting NEEDS to be false: We want to move leaf, therefore symlinks in "some\dirs" must not interfere */ + } + + MoveFileCallbackImpl callBack(statusUpdater); //if files need to be copied, we need callback functionality to update screen and offer abort + FreeFileSync::moveDirectory(fildesc.fullName, targetDir, true, &callBack); + } + break; + } +} + +void SyncProcess::synchronizeFolder(const FileCompareLine& cmpLine, const FolderPair& folderPair, const Zstring& altDeletionDir) +{ Zstring statusText; Zstring target; //synchronize folders: - switch (getSyncOperation(cmpLine.cmpResult, cmpLine.selectedForSynchronization, cmpLine.direction)) //evaluate comparison result and sync direction + switch (getSyncOperation(cmpLine)) //evaluate comparison result and sync direction { case SO_CREATE_NEW_LEFT: target = folderPair.leftDirectory + cmpLine.fileDescrRight.relativeName.c_str(); @@ -442,10 +541,10 @@ bool SyncProcess::synchronizeFolder(const FileCompareLine& cmpLine, const Folder statusUpdater->updateStatusText(statusText); //some check to catch the error that directory on source has been deleted externally after "compare"... - if (!wxDirExists(cmpLine.fileDescrRight.fullName)) - throw FileError(Zstring(_("Error: Source directory does not exist anymore:")) + wxT("\n\"") + cmpLine.fileDescrRight.fullName + wxT("\"")); + if (!FreeFileSync::dirExists(cmpLine.fileDescrRight.fullName)) + throw FileError(wxString(_("Error: Source directory does not exist anymore:")) + wxT("\n\"") + cmpLine.fileDescrRight.fullName.c_str() + wxT("\"")); createDirectory(target, cmpLine.fileDescrRight.fullName, !m_traverseDirSymLinks); //traverse symlinks <=> !copy symlinks - return true; + break; case SO_CREATE_NEW_RIGHT: target = folderPair.rightDirectory + cmpLine.fileDescrLeft.relativeName.c_str(); @@ -455,47 +554,47 @@ bool SyncProcess::synchronizeFolder(const FileCompareLine& cmpLine, const Folder statusUpdater->updateStatusText(statusText); //some check to catch the error that directory on source has been deleted externally after "compare"... - if (!wxDirExists(cmpLine.fileDescrLeft.fullName)) - throw FileError(Zstring(_("Error: Source directory does not exist anymore:")) + wxT("\n\"") + cmpLine.fileDescrLeft.fullName + wxT("\"")); + if (!FreeFileSync::dirExists(cmpLine.fileDescrLeft.fullName)) + throw FileError(wxString(_("Error: Source directory does not exist anymore:")) + wxT("\n\"") + cmpLine.fileDescrLeft.fullName.c_str() + wxT("\"")); createDirectory(target, cmpLine.fileDescrLeft.fullName, !m_traverseDirSymLinks); //traverse symlinks <=> !copy symlinks - return true; + break; case SO_DELETE_LEFT: statusText = txtDeletingFolder; statusText.Replace(wxT("%x"), cmpLine.fileDescrLeft.fullName, false); statusUpdater->updateStatusText(statusText); - removeDirectory(cmpLine.fileDescrLeft.fullName, m_useRecycleBin); - return true; + removeFolder(cmpLine.fileDescrLeft, altDeletionDir); + break; case SO_DELETE_RIGHT: statusText = txtDeletingFolder; statusText.Replace(wxT("%x"), cmpLine.fileDescrRight.fullName, false); statusUpdater->updateStatusText(statusText); - removeDirectory(cmpLine.fileDescrRight.fullName, m_useRecycleBin); - return true; + removeFolder(cmpLine.fileDescrRight, altDeletionDir); + break; case SO_OVERWRITE_RIGHT: case SO_OVERWRITE_LEFT: case SO_UNRESOLVED_CONFLICT: assert(false); case SO_DO_NOTHING: - return false; + return; //no update on processed data! } - return false; //dummy + //progress indicator update + //indicator is updated only if directory is sync'ed correctly (and if some work was done)! + statusUpdater->updateProcessedData(1, 0); //each call represents one processed file } inline bool deletionImminent(const FileCompareLine& line) -{ //test if current sync-line will result in deletion of files -> used to avoid disc space bottlenecks - if ( (line.cmpResult == FILE_LEFT_SIDE_ONLY && line.direction == SYNC_DIR_LEFT) || - (line.cmpResult == FILE_RIGHT_SIDE_ONLY && line.direction == SYNC_DIR_RIGHT)) - return true; - else - return false; +{ + //test if current sync-line will result in deletion of files -> used to avoid disc space bottlenecks + const SyncOperation op = FreeFileSync::getSyncOperation(line); + return op == FreeFileSync::SO_DELETE_LEFT || op == FreeFileSync::SO_DELETE_RIGHT; } @@ -529,30 +628,33 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) #endif //inform about the total amount of data that will be processed from now on - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflicts = 0; - wxULongLong dataToProcess; - - FreeFileSync::calcTotalBytesToSync(folderCmp, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflicts, - dataToProcess); - - statusUpdater->initNewProcess(objectsToCreate + objectsToOverwrite + objectsToDelete, //keep at beginning so that all gui elements are initialized properly - globalFunctions::convertToSigned(dataToProcess), + const SyncStatistics statisticsTotal(folderCmp); + + //keep at beginning so that all gui elements are initialized properly + statusUpdater->initNewProcess(statisticsTotal.getCreate() + statisticsTotal.getOverwrite() + statisticsTotal.getDelete(), + globalFunctions::convertToSigned(statisticsTotal.getDataToProcess()), StatusHandler::PROCESS_SYNCHRONIZING); //-------------------some basic checks:------------------------------------------ - //test existence of Recycle Bin - if (m_useRecycleBin && !FreeFileSync::recycleBinExists()) + if (statisticsTotal.getOverwrite() + statisticsTotal.getDelete() > 0) { - statusUpdater->reportFatalError(_("Unable to initialize Recycle Bin!")); - return; //should be obsolete! + //test existence of Recycle Bin + if (m_handleDeletion == FreeFileSync::MOVE_TO_RECYCLE_BIN && !FreeFileSync::recycleBinExists()) + { + statusUpdater->reportFatalError(_("Unable to initialize Recycle Bin!")); + return; //should be obsolete! + } + + if (m_handleDeletion == FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY) + { + //check if alternate directory for deletion was specified + if (sessionDeletionDirectory.empty()) + { + statusUpdater->reportFatalError(_("Please specify alternate directory for deletion!")); + return; //should be obsolete! + } + } } for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) @@ -560,70 +662,45 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) const FileComparison& fileCmp = j->fileCmp; //check if more than 50% of total number of files/dirs are to be created/overwritten/deleted - if (m_warnings.warningSignificantDifference) //test if check should be executed + if (significantDifferenceDetected(fileCmp)) { - if (significantDifferenceDetected(fileCmp)) - { - bool dontShowAgain = false; - statusUpdater->reportWarning(Zstring(_("Significant difference detected:")) + wxT("\n") + - j->syncPair.leftDirectory + wxT(" <-> ") + j->syncPair.rightDirectory + wxT("\n\n") + - _("More than 50% of the total number of files will be copied or deleted!"), - dontShowAgain); - m_warnings.warningSignificantDifference = !dontShowAgain; - } + statusUpdater->reportWarning(wxString(_("Significant difference detected:")) + wxT("\n") + + j->syncPair.leftDirectory + wxT(" <-> ") + wxT("\n") + + j->syncPair.rightDirectory + wxT("\n\n") + + _("More than 50% of the total number of files will be copied or deleted!"), + m_warnings.warningSignificantDifference); } //check for sufficient free diskspace in left directory - if (m_warnings.warningNotEnoughDiskSpace) - { - const std::pair<wxLongLong, wxLongLong> spaceNeeded = freeDiskSpaceNeeded(fileCmp, m_useRecycleBin); - - wxLongLong freeDiskSpaceLeft; - if (wxGetDiskSpace(j->syncPair.leftDirectory.c_str(), NULL, &freeDiskSpaceLeft)) - { - if (freeDiskSpaceLeft < spaceNeeded.first) - { - bool dontShowAgain = false; - statusUpdater->reportWarning(Zstring(_("Not enough free disk space available in:")) + wxT("\n") + - j->syncPair.leftDirectory + wxT("\n\n") + - _("Total required free disk space:") + wxT(" ") + formatFilesizeToShortString(spaceNeeded.first).c_str(), - dontShowAgain); - m_warnings.warningNotEnoughDiskSpace = !dontShowAgain; - } - } + const std::pair<wxLongLong, wxLongLong> spaceNeeded = freeDiskSpaceNeeded(fileCmp, m_handleDeletion); - //check for sufficient free diskspace in right directory - if (m_warnings.warningNotEnoughDiskSpace) - { - wxLongLong freeDiskSpaceRight; - if (wxGetDiskSpace(j->syncPair.rightDirectory.c_str(), NULL, &freeDiskSpaceRight)) - { - if (freeDiskSpaceRight < spaceNeeded.second) - { - bool dontShowAgain = false; - statusUpdater->reportWarning(Zstring(_("Not enough free disk space available in:")) + wxT("\n") + - j->syncPair.rightDirectory + wxT("\n\n") + - _("Total required free disk space:") + wxT(" ") + formatFilesizeToShortString(spaceNeeded.second).c_str(), - dontShowAgain); - m_warnings.warningNotEnoughDiskSpace = !dontShowAgain; - } - } - } + wxLongLong freeDiskSpaceLeft; + if (wxGetDiskSpace(j->syncPair.leftDirectory.c_str(), NULL, &freeDiskSpaceLeft)) + { + if (freeDiskSpaceLeft < spaceNeeded.first) + statusUpdater->reportWarning(wxString(_("Not enough free disk space available in:")) + wxT("\n") + + j->syncPair.leftDirectory + wxT("\n\n") + + _("Total required free disk space:") + wxT(" ") + formatFilesizeToShortString(spaceNeeded.first).c_str(), + m_warnings.warningNotEnoughDiskSpace); } - } - //check if unresolved conflicts exist - if (m_warnings.warningUnresolvedConflicts) //test if check should be executed - { - if (conflicts > 0) + //check for sufficient free diskspace in right directory + wxLongLong freeDiskSpaceRight; + if (wxGetDiskSpace(j->syncPair.rightDirectory.c_str(), NULL, &freeDiskSpaceRight)) { - bool dontShowAgain = false; - statusUpdater->reportWarning(_("Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchronization."), - dontShowAgain); - m_warnings.warningUnresolvedConflicts = !dontShowAgain; + if (freeDiskSpaceRight < spaceNeeded.second) + statusUpdater->reportWarning(wxString(_("Not enough free disk space available in:")) + wxT("\n") + + j->syncPair.rightDirectory + wxT("\n\n") + + _("Total required free disk space:") + wxT(" ") + formatFilesizeToShortString(spaceNeeded.second).c_str(), + m_warnings.warningNotEnoughDiskSpace); } } + //check if unresolved conflicts exist + if (statisticsTotal.getConflict() > 0) + statusUpdater->reportWarning(_("Unresolved conflicts existing! \n\nYou can ignore conflicts and continue synchronization."), + m_warnings.warningUnresolvedConflicts); + //-------------------end of basic checks------------------------------------------ @@ -633,20 +710,24 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) for (FolderComparison::iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) { FileComparison& fileCmp = j->fileCmp; + const FolderPair& currentPair = j->syncPair; + + //generate name of alternate deletion directory (unique for session AND folder pair) + const Zstring alternateDeletionDir = folderCmp.size() > 1 ? //if multiple folder pairs are used create a subfolder for each pair + sessionDeletionDirectory + globalFunctions::numberToWxString(j - folderCmp.begin() + 1).c_str() + globalFunctions::FILE_NAME_SEPARATOR : + sessionDeletionDirectory; //ensure that folderCmp is always written to, even if method is left via exceptions RemoveAtExit removeRowsAtExit(fileCmp); //note: running at individual folder pair level! - const FolderPair& currentPair = j->syncPair; - // it should never happen, that a directory on left side has same name as file on right side. startCompareProcess() should take care of this // and split into two "exists on one side only" cases - // Note: this case is not handled by this tool as this is considered to be a bug and must be solved by the user + // Note: this case is not handled by this tool and must be solved by the user //synchronize folders first; advantage: in case of deletions the whole folder is moved to recycle bin instead of single files for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) { - if ( i->fileDescrLeft.objType == FileDescrLine::TYPE_DIRECTORY || + if ( i->fileDescrLeft.objType == FileDescrLine::TYPE_DIRECTORY || i->fileDescrRight.objType == FileDescrLine::TYPE_DIRECTORY) { while (true) @@ -655,19 +736,22 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) try { - if (synchronizeFolder(*i, currentPair)) - //progress indicator update - //indicator is updated only if directory is sync'ed correctly (and if some work was done)! - statusUpdater->updateProcessedData(1, 0); //each call represents one processed file/directory + synchronizeFolder(*i, currentPair, alternateDeletionDir); removeRowsAtExit.markRow(i - fileCmp.begin()); break; } catch (FileError& error) { + //User abort when copying files or moving files/directories into custom deletion directory: + //windows build: abort if requested, don't show error message if cancelled by user! + //linux build: this refresh is not necessary, because user abort triggers an AbortThisProcess() exception without a FileError() + statusUpdater->requestUiRefresh(true); + + ErrorHandler::Response rv = statusUpdater->reportError(error.show()); - if ( rv == ErrorHandler::IGNORE_ERROR) + if (rv == ErrorHandler::IGNORE_ERROR) break; else if (rv == ErrorHandler::RETRY) ; //continue with loop @@ -683,16 +767,15 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) //synchronize files: for (int k = 0; k < 2; ++k) //loop over all files twice; reason: first delete, then copy (no sorting necessary: performance) { - bool deleteLoop = true; - deleteLoop = k == 0; //-> first loop: delete files, second loop: copy files + const bool deleteLoop = k == 0; //-> first loop: delete files, second loop: copy files for (FileComparison::const_iterator i = fileCmp.begin(); i != fileCmp.end(); ++i) { //skip processing of unresolved errors (do not remove row from GUI grid) - if (i->direction == SYNC_UNRESOLVED_CONFLICT && i->selectedForSynchronization) + if (getSyncOperation(*i) == SO_UNRESOLVED_CONFLICT) continue; - if ( i->fileDescrLeft.objType == FileDescrLine::TYPE_FILE || + if ( i->fileDescrLeft.objType == FileDescrLine::TYPE_FILE || i->fileDescrRight.objType == FileDescrLine::TYPE_FILE) { if ( (deleteLoop && deletionImminent(*i)) || @@ -704,30 +787,19 @@ void SyncProcess::startSynchronizationProcess(FolderComparison& folderCmp) try { - if (synchronizeFile(*i, currentPair)) - { - //progress indicator update - //indicator is updated only if file is sync'ed correctly (and if some sync was done)! - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflictDummy = 0; - wxULongLong dataToProcess; - - if (getBytesToTransfer(*i, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflictDummy, - dataToProcess)) //update status if some work was done (answer is always "yes" in this context) - statusUpdater->updateProcessedData(objectsToCreate + objectsToOverwrite + objectsToDelete, 0); //processed data is communicated in subfunctions! - } + synchronizeFile(*i, currentPair, alternateDeletionDir); removeRowsAtExit.markRow(i - fileCmp.begin()); break; } catch (FileError& error) { + //User abort when copying files or moving files/directories into custom deletion directory: + //windows build: abort if requested, don't show error message if cancelled by user! + //linux build: this refresh is not necessary, because user abort triggers an AbortThisProcess() exception without a FileError() + statusUpdater->requestUiRefresh(true); + + ErrorHandler::Response rv = statusUpdater->reportError(error.show()); if ( rv == ErrorHandler::IGNORE_ERROR) @@ -773,7 +845,7 @@ public: m_bytesTransferredLast = totalBytes; #ifdef FFS_WIN - m_statusHandler->requestUiRefresh(false); //don't allow throwing exception within this call + m_statusHandler->requestUiRefresh(false); //don't allow throwing exception within this call: windows copying callback can't handle this if (m_statusHandler->abortIsRequested()) return CopyFileCallback::CANCEL; #elif defined FFS_LINUX @@ -792,11 +864,16 @@ private: void SyncProcess::copyFileUpdating(const Zstring& source, const Zstring& target, const wxULongLong& totalBytesToCpy) { //create folders first (see http://sourceforge.net/tracker/index.php?func=detail&aid=2628943&group_id=234430&atid=1093080) - const Zstring targetDir = target.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); - if (!wxDirExists(targetDir.c_str())) + const Zstring targetDir = target.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + if (!FreeFileSync::dirExists(targetDir)) { - const Zstring templateDir = source.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); - FreeFileSync::createDirectory(targetDir, templateDir, !m_traverseDirSymLinks); //might throw FileError() exception + if (!targetDir.empty()) //kind of pathological, but empty target might happen + { + const Zstring templateDir = source.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + FreeFileSync::createDirectory(targetDir, templateDir, false); + //symbolic link setting: If traversing into links => don't create + //if not traversing into links => copy dir symlink of leaf-dir, not relevant here => actually: setting doesn't matter + } } //start of (possibly) long-running copy process: ensure status updates are performed regularly @@ -815,7 +892,6 @@ void SyncProcess::copyFileUpdating(const Zstring& source, const Zstring& target, { //error situation: undo communication of processed amount of data statusUpdater->updateProcessedData(0, totalBytesTransferred * -1 ); - statusUpdater->requestUiRefresh(true); //windows build: abort if requested, don't show error message if cancelled by user! throw; } @@ -860,10 +936,10 @@ private: void copyFileUpdating(const Zstring& source, const Zstring& target, const wxULongLong& totalBytesToCpy, StatusHandler* updateClass) { //create folders first (see http://sourceforge.net/tracker/index.php?func=detail&aid=2628943&group_id=234430&atid=1093080) - const Zstring targetDir = target.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + const Zstring targetDir = target.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); if (!wxDirExists(targetDir.c_str())) { - const Zstring templateDir = source.BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); + const Zstring templateDir = source.BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); FreeFileSync::createDirectory(targetDir, templateDir); //might throw FileError() exception } diff --git a/synchronization.h b/synchronization.h index b837812a..de8884c0 100644 --- a/synchronization.h +++ b/synchronization.h @@ -6,7 +6,7 @@ #include <memory> #ifdef FFS_WIN -#include "library/shadow.h" +#include "shared/shadow.h" #endif class StatusHandler; @@ -15,12 +15,28 @@ class wxBitmap; namespace FreeFileSync { - void calcTotalBytesToSync(const FolderComparison& folderCmp, - int& objectsToCreate, - int& objectsToOverwrite, - int& objectsToDelete, - int& conflicts, - wxULongLong& dataToProcess); + class SyncStatistics + { + public: + SyncStatistics(const FileComparison& fileCmp); + SyncStatistics(const FolderComparison& folderCmp); + + int getCreate( bool inclLeft = true, bool inclRight = true) const; + int getOverwrite(bool inclLeft = true, bool inclRight = true) const; + int getDelete( bool inclLeft = true, bool inclRight = true) const; + int getConflict() const; + wxULongLong getDataToProcess() const; + + private: + void init(); + void getNumbers(const FileCompareLine& fileCmpLine); + + int createLeft, createRight; + int overwriteLeft, overwriteRight; + int deleteLeft, deleteRight; + int conflict; + wxULongLong dataToProcess; + }; bool synchronizationNeeded(const FolderComparison& folderCmp); @@ -31,8 +47,8 @@ namespace FreeFileSync SO_CREATE_NEW_RIGHT, SO_DELETE_LEFT, SO_DELETE_RIGHT, - SO_OVERWRITE_RIGHT, SO_OVERWRITE_LEFT, + SO_OVERWRITE_RIGHT, SO_DO_NOTHING, SO_UNRESOLVED_CONFLICT }; @@ -40,15 +56,15 @@ namespace FreeFileSync const bool selectedForSynchronization, const SyncDirection syncDir); //evaluate comparison result and sync direction - const wxBitmap& getSyncOpImage(const CompareFilesResult cmpResult, - const bool selectedForSynchronization, - const SyncDirection syncDir); + SyncOperation getSyncOperation(const FileCompareLine& line); //convenience function + //class handling synchronization process class SyncProcess { public: - SyncProcess(const bool useRecycler, + SyncProcess(const DeletionPolicy handleDeletion, + const wxString& custDelFolder, const bool copyFileSymLinks, const bool traverseDirSymLinks, xmlAccess::WarningMessages& warnings, @@ -57,12 +73,17 @@ namespace FreeFileSync void startSynchronizationProcess(FolderComparison& folderCmp); private: - bool synchronizeFile(const FileCompareLine& cmpLine, const FolderPair& folderPair); //false if nothing was done - bool synchronizeFolder(const FileCompareLine& cmpLine, const FolderPair& folderPair); //false if nothing was done + void synchronizeFile(const FileCompareLine& cmpLine, const FolderPair& folderPair, const Zstring& altDeletionDir); //false if nothing was done + void synchronizeFolder(const FileCompareLine& cmpLine, const FolderPair& folderPair, const Zstring& altDeletionDir); //false if nothing was done + + void removeFile(const FileDescrLine& fildesc, const Zstring& altDeletionDir); + void removeFolder(const FileDescrLine& fildesc, const Zstring& altDeletionDir); void copyFileUpdating(const Zstring& source, const Zstring& target, const wxULongLong& sourceFileSize); - const bool m_useRecycleBin; + const DeletionPolicy m_handleDeletion; + const Zstring sessionDeletionDirectory; //ends with path separator + const bool m_copyFileSymLinks; const bool m_traverseDirSymLinks; diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index e9119fea..5f078cda 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -1,12 +1,11 @@ #include "mainDialog.h" #include <wx/filename.h> -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" #include <wx/clipbrd.h> #include <wx/dataobj.h> #include <wx/ffile.h> #include "../library/customGrid.h" -#include "../library/customButton.h" -#include <algorithm> +#include "../shared/customButton.h" #include <wx/msgdlg.h> #include "../comparison.h" #include "../synchronization.h" @@ -14,14 +13,21 @@ #include "checkVersion.h" #include "guiStatusHandler.h" #include "syncDialog.h" -#include "../library/localization.h" +#include "../shared/localization.h" #include "smallDialogs.h" -#include "dragAndDrop.h" +#include "../shared/dragAndDrop.h" #include "../library/filter.h" #include "../structures.h" #include <wx/imaglist.h> +#include <wx/wupdlock.h> +#include "gridView.h" +#include "../library/resources.h" +#include "../shared/fileHandling.h" +#include "../shared/xmlBase.h" +#include "../shared/standardPaths.h" using namespace FreeFileSync; +using FreeFileSync::CustomLocale; class FolderPairPanel : public FolderPairGenerated @@ -71,7 +77,7 @@ public: } //disable the sync button - mainDlg_->syncPreview->enableSynchronization(false); + mainDlg_->syncPreview.enableSynchronization(false); //clear grids mainDlg_->currentGridData.clear(); @@ -127,40 +133,43 @@ private: //################################################################################################################################## -MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale* language, xmlAccess::XmlGlobalSettings& settings) : +MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, xmlAccess::XmlGlobalSettings& settings) : MainDialogGenerated(frame), globalSettings(settings), - gridDataView(currentGridData), contextMenu(new wxMenu), //initialize right-click context menu; will be dynamically re-created on each R-mouse-click - programLanguage(language), - cmpStatusHandlerTmp(0), cleanedUp(false), lastSortColumn(-1), lastSortGrid(NULL), #ifdef FFS_WIN updateFileIcons(new IconUpdater(m_gridLeft, m_gridRight)), #endif - syncPreview(new SyncPreview(this)) + syncPreview(this) { - m_bpButtonRemoveTopPair->Hide(); + wxWindowUpdateLocker dummy(this); //avoid display distortion + + gridDataView.reset(new FreeFileSync::GridView(currentGridData)); + m_bpButtonRemoveTopPair->Hide(); //initialize and load configuration readGlobalSettings(); - readConfigurationFromXml(cfgFileName, true); + + if (cfgFileName.empty()) + readConfigurationFromXml(lastConfigFileName(), true); + else + readConfigurationFromXml(cfgFileName, true); //set icons for this dialog m_bpButton10->SetBitmapLabel(*GlobalResources::getInstance().bitmapExit); m_bpButtonSwapSides->SetBitmapLabel(*GlobalResources::getInstance().bitmapSwap); m_buttonCompare->setBitmapFront(*GlobalResources::getInstance().bitmapCompare); m_bpButtonSyncConfig->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncCfg); - m_bpButton14->SetBitmapLabel(*GlobalResources::getInstance().bitmapHelp); + m_bpButtonCmpConfig->SetBitmapLabel(*GlobalResources::getInstance().bitmapCmpCfg); m_bpButtonSave->SetBitmapLabel(*GlobalResources::getInstance().bitmapSave); m_bpButtonLoad->SetBitmapLabel(*GlobalResources::getInstance().bitmapLoad); m_bpButtonAddPair->SetBitmapLabel(*GlobalResources::getInstance().bitmapAddFolderPair); m_bpButtonRemoveTopPair->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); m_bitmap15->SetBitmap(*GlobalResources::getInstance().bitmapStatusEdge); - m_bitmapShift->SetBitmap(*GlobalResources::getInstance().bitmapShift); m_bitmapCreate->SetBitmap(*GlobalResources::getInstance().bitmapCreate); m_bitmapUpdate->SetBitmap(*GlobalResources::getInstance().bitmapUpdate); @@ -186,7 +195,8 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale for (std::vector<LocInfoLine>::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) { wxMenuItem* newItem = new wxMenuItem(m_menuLanguages, wxID_ANY, i->languageName, wxEmptyString, wxITEM_NORMAL ); - newItem->SetBitmap(*i->languageFlag); + + newItem->SetBitmap(GlobalResources::getInstance().getImageByName(i->languageFlag)); //map menu item IDs with language IDs: evaluated when processing event handler languageMenuItemMap.insert(std::map<MenuItemID, LanguageID>::value_type(newItem->GetId(), i->languageID)); @@ -219,20 +229,23 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale m_gridMiddle->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridMiddleButtonEvent), NULL, this); Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), NULL, this); - Connect(wxEVT_SIZE, wxEventHandler(MainDialog::onResizeMainWindow), NULL, this); - Connect(wxEVT_MOVE, wxEventHandler(MainDialog::onResizeMainWindow), NULL, this); + Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); + Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); + + //calculate witdh of folder pair manually (if scrollbars are visible) + m_scrolledWindowFolderPairs->Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResizeFolderPairs), NULL, this); //event handler for manual (un-)checking of rows and setting of sync direction m_gridMiddle->Connect(FFS_CHECK_ROWS_EVENT, FFSCheckRowsEventHandler(MainDialog::OnCheckRows), NULL, this); m_gridMiddle->Connect(FFS_SYNC_DIRECTION_EVENT, FFSSyncDirectionEventHandler(MainDialog::OnSetSyncDirection), NULL, this); //init grid settings - m_gridLeft ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, &gridDataView); - m_gridMiddle->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, &gridDataView); - m_gridRight ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, &gridDataView); + m_gridLeft ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); + m_gridMiddle->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); + m_gridRight ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); //disable sync button as long as "compare" hasn't been triggered. - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); //mainly to update row label sizes... updateGuiGrid(); @@ -270,10 +283,10 @@ void MainDialog::cleanUp() { cleanedUp = true; - //no need for event Disconnect() here; done automatically + //no need for wxEventHandler::Disconnect() here; done automatically when window is destoyed! //save configuration - writeConfigurationToXml(FreeFileSync::getLastConfigFile()); //don't trow exceptions in destructors + writeConfigurationToXml(lastConfigFileName()); //don't trow exceptions in destructors writeGlobalSettings(); } } @@ -365,8 +378,8 @@ void MainDialog::setSyncDirManually(const std::set<int>& rowsToSetOnUiTable, con { for (std::set<int>::const_iterator i = rowsToSetOnUiTable.begin(); i != rowsToSetOnUiTable.end(); ++i) { - gridDataView[*i].direction = dir; - gridDataView[*i].selectedForSynchronization = true; + (*gridDataView)[*i].syncDir = dir; + (*gridDataView)[*i].selectedForSynchronization = true; } updateGuiGrid(); @@ -381,15 +394,15 @@ void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable, bool newSelection = false; //default: deselect range //leadingRow determines de-/selection of all other rows - if (0 <= leadingRow && leadingRow < int(gridDataView.elementsOnView())) - newSelection = !gridDataView[leadingRow].selectedForSynchronization; + if (0 <= leadingRow && leadingRow < int(gridDataView->elementsOnView())) + newSelection = !(*gridDataView)[leadingRow].selectedForSynchronization; //if hidefiltered is active, there should be no filtered elements on screen => current element was filtered out - assert(!hideFilteredElements || !newSelection); + assert(!currentCfg.hideFilteredElements || !newSelection); //get all lines that need to be filtered (e.g. if a folder is marked, then its subelements should be marked as well) FolderCompRef compRef; - gridDataView.viewRefToFolderRef(rowsToFilterOnUiTable, compRef); + gridDataView->viewRefToFolderRef(rowsToFilterOnUiTable, compRef); assert(compRef.size() == currentGridData.size()); //GridView::viewRefToFolderRef() should ensure this! @@ -399,15 +412,15 @@ void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable, const std::set<int>& markedRows = compRef[i - currentGridData.begin()]; std::set<int> markedRowsTotal; //retrieve additional rows that need to be filtered, too - for (std::set<int>::const_iterator i = markedRows.begin(); i != markedRows.end(); ++i) + for (std::set<int>::const_iterator j = markedRows.begin(); j != markedRows.end(); ++j) { - markedRowsTotal.insert(*i); - FreeFileSync::addSubElements(fileCmp, fileCmp[*i], markedRowsTotal); + markedRowsTotal.insert(*j); + FreeFileSync::addSubElements(fileCmp, fileCmp[*j], markedRowsTotal); } //toggle selection of filtered rows - for (std::set<int>::iterator i = markedRowsTotal.begin(); i != markedRowsTotal.end(); ++i) - fileCmp[*i].selectedForSynchronization = newSelection; + for (std::set<int>::iterator k = markedRowsTotal.begin(); k != markedRowsTotal.end(); ++k) + fileCmp[*k].selectedForSynchronization = newSelection; } refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts @@ -484,7 +497,7 @@ std::set<int> MainDialog::getSelectedRows(const CustomGrid* grid) const { std::set<int> output = grid->getAllSelectedRows(); - removeInvalidRows(output, gridDataView.elementsOnView()); + removeInvalidRows(output, gridDataView->elementsOnView()); return output; } @@ -502,42 +515,92 @@ std::set<int> MainDialog::getSelectedRows() const } -class DeleteErrorHandler : public ErrorHandler +class ManualDeletionHandler : private wxEvtHandler, public DeleteFilesHandler { public: - DeleteErrorHandler() : - ignoreErrors(false) {} + ManualDeletionHandler(MainDialog* main, int totalObjToDel) : + mainDlg(main), + totalObjToDelete(totalObjToDel), + abortRequested(false), + ignoreErrors(false), + deletionCount(0) + { + mainDlg->disableAllElements(); //disable everything except abort button + mainDlg->clearStatusBar(); + + //register abort button + mainDlg->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); + } - ~DeleteErrorHandler() {} + ~ManualDeletionHandler() + { + //de-register abort button + mainDlg->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); - Response reportError(const Zstring& errorMessage) + mainDlg->enableAllElements(); + } + + virtual Response reportError(const wxString& errorMessage) { + if (abortRequested) + throw FreeFileSync::AbortThisProcess(); + if (ignoreErrors) - return ErrorHandler::IGNORE_ERROR; + return DeleteFilesHandler::IGNORE_ERROR; bool ignoreNextErrors = false; ErrorDlg* errorDlg = new ErrorDlg(NULL, ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - errorMessage.c_str(), ignoreNextErrors); - int rv = errorDlg->ShowModal(); + errorMessage, ignoreNextErrors); + const int rv = errorDlg->ShowModal(); errorDlg->Destroy(); - switch (rv) + switch (static_cast<ErrorDlg::ReturnCodes>(rv)) { case ErrorDlg::BUTTON_IGNORE: ignoreErrors = ignoreNextErrors; - return ErrorHandler::IGNORE_ERROR; + return DeleteFilesHandler::IGNORE_ERROR; case ErrorDlg::BUTTON_RETRY: - return ErrorHandler::RETRY; + return DeleteFilesHandler::RETRY; case ErrorDlg::BUTTON_ABORT: throw FreeFileSync::AbortThisProcess(); - default: - assert (false); - return ErrorHandler::IGNORE_ERROR; //dummy return value } + + assert (false); + return DeleteFilesHandler::IGNORE_ERROR; //dummy return value + } + + virtual void deletionSuccessful() //called for each file/folder that has been deleted + { + ++deletionCount; + + if (updateUiIsAllowed()) //test if specific time span between ui updates is over + { + wxString statusMessage = _("%x / %y objects deleted successfully"); + statusMessage.Replace(wxT("%x"), globalFunctions::numberToWxString(deletionCount), false); + statusMessage.Replace(wxT("%y"), globalFunctions::numberToWxString(totalObjToDelete), false); + + mainDlg->m_staticTextStatusMiddle->SetLabel(statusMessage); + mainDlg->m_panel7->Layout(); + + updateUiNow(); + } + + if (abortRequested) //test after (implicit) call to wxApp::Yield() + throw FreeFileSync::AbortThisProcess(); } private: + void OnAbortCompare(wxCommandEvent& event) //handle abort button click + { + abortRequested = true; //don't throw exceptions in a GUI-Callback!!! (throw FreeFileSync::AbortThisProcess()) + } + + MainDialog* const mainDlg; + const int totalObjToDelete; + + bool abortRequested; bool ignoreErrors; + unsigned int deletionCount; }; @@ -551,18 +614,20 @@ void MainDialog::deleteSelectedFiles() { //map lines from GUI view to grid line references for "currentGridData" FolderCompRef compRefLeft; - gridDataView.viewRefToFolderRef(viewSelectionLeft, compRefLeft); + gridDataView->viewRefToFolderRef(viewSelectionLeft, compRefLeft); FolderCompRef compRefRight; - gridDataView.viewRefToFolderRef(viewSelectionRight, compRefRight); + gridDataView->viewRefToFolderRef(viewSelectionRight, compRefRight); + int totalDeleteCount = 0; DeleteDialog* confirmDeletion = new DeleteDialog(this, //no destruction needed; attached to main window currentGridData, compRefLeft, compRefRight, globalSettings.gui.deleteOnBothSides, - globalSettings.gui.useRecyclerForManualDeletion); + globalSettings.gui.useRecyclerForManualDeletion, + totalDeleteCount); if (confirmDeletion->ShowModal() == DeleteDialog::BUTTON_OKAY) { if (globalSettings.gui.useRecyclerForManualDeletion && !FreeFileSync::recycleBinExists()) @@ -574,10 +639,11 @@ void MainDialog::deleteSelectedFiles() //Attention! Modifying the grid is highly critical! There MUST NOT BE any accesses to gridDataView until this reference table is updated //by updateGuiGrid()!! This is easily missed, e.g. when ClearSelection() or ShowModal() or possibly any other wxWidgets function is called //that might want to redraw the UI (which implicitly uses the information in gridDataView (see CustomGrid) + gridDataView->clearView(); //no superfluous precaution: e.g. consider grid update when error message is shown in multiple folder pair scenario! try { //handle errors when deleting files/folders - DeleteErrorHandler errorHandler; + ManualDeletionHandler statusHandler(this, totalDeleteCount); assert(compRefLeft.size() == currentGridData.size()); //GridView::viewRefToFolderRef() should ensure this! assert(compRefRight.size() == currentGridData.size()); @@ -594,8 +660,8 @@ void MainDialog::deleteSelectedFiles() rowsToDeleteOnRight, globalSettings.gui.deleteOnBothSides, globalSettings.gui.useRecyclerForManualDeletion, - cfg.syncConfiguration, - &errorHandler); + currentCfg.mainCfg.syncConfiguration, + &statusHandler); } } @@ -612,83 +678,80 @@ void MainDialog::deleteSelectedFiles() } -void MainDialog::openWithFileManager(const int rowNumber, const bool leftSide) +void exstractNames(const FileDescrLine& fileDescr, wxString& name, wxString& dir) { - wxString command; - - if (0 <= rowNumber && rowNumber < int(gridDataView.elementsOnView())) + switch (fileDescr.objType) { - const FileDescrLine* fileDescr = leftSide ? - &gridDataView[rowNumber].fileDescrLeft : - &gridDataView[rowNumber].fileDescrRight; + case FileDescrLine::TYPE_FILE: + name = fileDescr.fullName.c_str(); + dir = wxString(fileDescr.fullName.c_str()).BeforeLast(globalFunctions::FILE_NAME_SEPARATOR); + break; - switch (fileDescr->objType) - { - case FileDescrLine::TYPE_FILE: - command = globalSettings.gui.commandLineFileManager; - command.Replace(wxT("%name"), fileDescr->fullName.c_str()); - command.Replace(wxT("%path"), wxString(fileDescr->fullName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR)); - break; - case FileDescrLine::TYPE_DIRECTORY: - command = globalSettings.gui.commandLineFileManager; - command.Replace(wxT("%name"), fileDescr->fullName.c_str()); - command.Replace(wxT("%path"), fileDescr->fullName.c_str()); - break; - case FileDescrLine::TYPE_NOTHING: - { - //use path from other side - const FileDescrLine* fileDescrOther = leftSide ? - &gridDataView[rowNumber].fileDescrRight : - &gridDataView[rowNumber].fileDescrLeft; + case FileDescrLine::TYPE_DIRECTORY: + name = fileDescr.fullName.c_str(); + dir = fileDescr.fullName.c_str(); + break; - const wxString syncFolder = leftSide ? - gridDataView.getFolderPair(rowNumber).leftDirectory.c_str() : - gridDataView.getFolderPair(rowNumber).rightDirectory.c_str(); + case FileDescrLine::TYPE_NOTHING: + name.clear(); + dir.clear(); + break; + } +} - wxString alternateFolder; - switch (fileDescrOther->objType) - { - case FileDescrLine::TYPE_FILE: - alternateFolder = syncFolder + wxString(fileDescrOther->relativeName.c_str()).BeforeLast(FreeFileSync::FILE_NAME_SEPARATOR); - break; - case FileDescrLine::TYPE_DIRECTORY: - alternateFolder = syncFolder + wxString(fileDescrOther->relativeName.c_str()); - break; - case FileDescrLine::TYPE_NOTHING: - assert(false); - break; - } - if (!wxDirExists(alternateFolder)) - alternateFolder = syncFolder; +void MainDialog::openWithFileManager(const int rowNumber, const bool leftSide) +{ + wxString command = globalSettings.gui.commandLineFileManager; -#ifdef FFS_WIN - command = wxString(wxT("explorer ")) + alternateFolder; //default -#elif defined FFS_LINUX - command = globalSettings.gui.commandLineFileManager; - command.Replace(wxT("%name"), alternateFolder); - command.Replace(wxT("%path"), alternateFolder); -#endif + wxString name; + wxString dir; + wxString nameCo; + wxString dirCo; + + if (0 <= rowNumber && rowNumber < int(gridDataView->elementsOnView())) + { + if (leftSide) + { + exstractNames((*gridDataView)[rowNumber].fileDescrLeft, name, dir); + exstractNames((*gridDataView)[rowNumber].fileDescrRight, nameCo, dirCo); } - break; + else + { + exstractNames((*gridDataView)[rowNumber].fileDescrRight, name, dir); + exstractNames((*gridDataView)[rowNumber].fileDescrLeft, nameCo, dirCo); + } +#ifdef FFS_WIN + if (name.empty()) + { + if (leftSide) + wxExecute(wxString(wxT("explorer ")) + gridDataView->getFolderPair(rowNumber).leftDirectory); + else + wxExecute(wxString(wxT("explorer ")) + gridDataView->getFolderPair(rowNumber).rightDirectory); + return; } +#endif } else { //fallback - const wxString defaultFolder = leftSide ? - FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()).c_str() : - FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()).c_str(); + dir = FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()).c_str(); + dirCo = FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()).c_str(); + + if (!leftSide) + std::swap(dir, dirCo); + #ifdef FFS_WIN - command = wxString(wxT("explorer ")) + defaultFolder; //default -#elif defined FFS_LINUX - command = globalSettings.gui.commandLineFileManager; - command.Replace(wxT("%name"), defaultFolder); - command.Replace(wxT("%path"), defaultFolder); + wxExecute(wxString(wxT("explorer ")) + dir); //default + return; #endif } - if (!command.empty()) - wxExecute(command.c_str()); + command.Replace(wxT("%name"), name, true); + command.Replace(wxT("%dir"), dir, true); + command.Replace(wxT("%nameCo"), nameCo, true); + command.Replace(wxT("%dirCo"), dirCo, true); + + wxExecute(command); } @@ -712,7 +775,80 @@ void MainDialog::clearStatusBar() } -void MainDialog::onResizeMainWindow(wxEvent& event) +void MainDialog::disableAllElements() +{ //disenables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion + m_bpButtonCmpConfig-> Disable(); + m_notebookBottomLeft->Disable(); + m_checkBoxHideFilt-> Disable(); + m_bpButtonSyncConfig->Disable(); + m_buttonStartSync-> Disable(); + m_dirPickerLeft-> Disable(); + m_dirPickerRight-> Disable(); + m_bpButtonSwapSides-> Disable(); + m_bpButtonLeftOnly-> Disable(); + m_bpButtonLeftNewer-> Disable(); + m_bpButtonEqual-> Disable(); + m_bpButtonDifferent-> Disable(); + m_bpButtonRightNewer->Disable(); + m_bpButtonRightOnly-> Disable(); + m_panelLeft-> Disable(); + m_panelMiddle-> Disable(); + m_panelRight-> Disable(); + m_panelTopLeft-> Disable(); + m_panelTopMiddle-> Disable(); + m_panelTopRight-> Disable(); + m_bpButton10-> Disable(); + m_scrolledWindowFolderPairs->Disable(); + m_menubar1->EnableTop(0, false); + m_menubar1->EnableTop(1, false); + m_menubar1->EnableTop(2, false); + + //show abort button + m_buttonAbort->Enable(); + m_buttonAbort->Show(); + m_buttonCompare->Disable(); + m_buttonCompare->Hide(); + m_buttonAbort->SetFocus(); +} + + +void MainDialog::enableAllElements() +{ + m_bpButtonCmpConfig-> Enable(); + m_notebookBottomLeft->Enable(); + m_checkBoxHideFilt-> Enable(); + m_bpButtonSyncConfig->Enable(); + m_buttonStartSync-> Enable(); + m_dirPickerLeft-> Enable(); + m_dirPickerRight-> Enable(); + m_bpButtonSwapSides-> Enable(); + m_bpButtonLeftOnly-> Enable(); + m_bpButtonLeftNewer-> Enable(); + m_bpButtonEqual-> Enable(); + m_bpButtonDifferent-> Enable(); + m_bpButtonRightNewer->Enable(); + m_bpButtonRightOnly-> Enable(); + m_panelLeft-> Enable(); + m_panelMiddle-> Enable(); + m_panelRight-> Enable(); + m_panelTopLeft-> Enable(); + m_panelTopMiddle-> Enable(); + m_panelTopRight-> Enable(); + m_bpButton10-> Enable(); + m_scrolledWindowFolderPairs->Enable(); + m_menubar1->EnableTop(0, true); + m_menubar1->EnableTop(1, true); + m_menubar1->EnableTop(2, true); + + //show compare button + m_buttonAbort->Disable(); + m_buttonAbort->Hide(); + m_buttonCompare->Enable(); + m_buttonCompare->Show(); +} + + +void MainDialog::OnResize(wxSizeEvent& event) { if (!IsMaximized()) { @@ -733,6 +869,22 @@ void MainDialog::onResizeMainWindow(wxEvent& event) posYNotMaximized = y; } } + + event.Skip(); +} + + +void MainDialog::OnResizeFolderPairs(wxSizeEvent& event) +{ + //adapt left-shift display distortion caused by scrollbars for multiple folder pairs + if (additionalFolderPairs.size() > 0) + { + const int width = m_panelTopLeft->GetSize().GetWidth(); + + for (std::vector<FolderPairPanel*>::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + (*i)->m_panelLeft->SetMinSize(wxSize(width, -1)); + } + event.Skip(); } @@ -747,6 +899,8 @@ void MainDialog::onGridLeftButtonEvent(wxKeyEvent& event) copySelectionToClipboard(m_gridLeft); else if (keyCode == 65) //CTRL + A m_gridLeft->SelectAll(); + else if (keyCode == WXK_NUMPAD_ADD) //CTRL + '+' + m_gridLeft->AutoSizeColumns(false); } else if (keyCode == WXK_DELETE || keyCode == WXK_NUMPAD_DELETE) deleteSelectedFiles(); @@ -779,6 +933,8 @@ void MainDialog::onGridRightButtonEvent(wxKeyEvent& event) copySelectionToClipboard(m_gridRight); else if (keyCode == 65) //CTRL + A m_gridRight->SelectAll(); + else if (keyCode == WXK_NUMPAD_ADD) //CTRL + '+' + m_gridRight->AutoSizeColumns(false); } else if (keyCode == WXK_DELETE || keyCode == WXK_NUMPAD_DELETE) deleteSelectedFiles(); @@ -821,23 +977,23 @@ void MainDialog::OnContextRim(wxGridEvent& event) //re-create context menu contextMenu.reset(new wxMenu); - if (syncPreview->previewIsEnabled()) + if (syncPreview.previewIsEnabled()) { if (selectionLeft.size() + selectionRight.size() > 0) { //CONTEXT_SYNC_DIR_LEFT wxMenuItem* menuItemSyncDirLeft = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_LEFT, _("Change direction")); - menuItemSyncDirLeft->SetBitmap(getSyncOpImage(gridDataView[selectionBegin].cmpResult, true, SYNC_DIR_LEFT)); + menuItemSyncDirLeft->SetBitmap(getSyncOpImage((*gridDataView)[selectionBegin].cmpResult, true, SYNC_DIR_LEFT)); contextMenu->Append(menuItemSyncDirLeft); //CONTEXT_SYNC_DIR_NONE wxMenuItem* menuItemSyncDirNone = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_NONE, _("Change direction")); - menuItemSyncDirNone->SetBitmap(getSyncOpImage(gridDataView[selectionBegin].cmpResult, true, SYNC_DIR_NONE)); + menuItemSyncDirNone->SetBitmap(getSyncOpImage((*gridDataView)[selectionBegin].cmpResult, true, SYNC_DIR_NONE)); contextMenu->Append(menuItemSyncDirNone); //CONTEXT_SYNC_DIR_RIGHT wxMenuItem* menuItemSyncDirRight = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_RIGHT, _("Change direction")); - menuItemSyncDirRight->SetBitmap(getSyncOpImage(gridDataView[selectionBegin].cmpResult, true, SYNC_DIR_RIGHT)); + menuItemSyncDirRight->SetBitmap(getSyncOpImage((*gridDataView)[selectionBegin].cmpResult, true, SYNC_DIR_RIGHT)); contextMenu->Append(menuItemSyncDirRight); contextMenu->AppendSeparator(); @@ -848,7 +1004,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) //CONTEXT_FILTER_TEMP if (selectionLeft.size() + selectionRight.size() > 0) { - if (gridDataView[selectionBegin].selectedForSynchronization) //valid access, as getSelectedRows returns valid references only + if ((*gridDataView)[selectionBegin].selectedForSynchronization) //valid access, as getSelectedRows returns valid references only { wxMenuItem* menuItemExclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, _("Exclude temporarily")); menuItemExclTemp->SetBitmap(*GlobalResources::getInstance().bitmapCheckBoxFalse); @@ -873,7 +1029,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) FilterObject newFilterEntry; for (std::set<int>::const_iterator i = selectionLeft.begin(); i != selectionLeft.end(); ++i) { - const FileCompareLine& line = gridDataView[*i]; + const FileCompareLine& line = (*gridDataView)[*i]; newFilterEntry.relativeName = line.fileDescrLeft.relativeName.c_str(); newFilterEntry.type = line.fileDescrLeft.objType; if (!newFilterEntry.relativeName.IsEmpty()) @@ -881,7 +1037,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) } for (std::set<int>::const_iterator i = selectionRight.begin(); i != selectionRight.end(); ++i) { - const FileCompareLine& line = gridDataView[*i]; + const FileCompareLine& line = (*gridDataView)[*i]; newFilterEntry.relativeName = line.fileDescrRight.relativeName.c_str(); newFilterEntry.type = line.fileDescrRight.objType; if (!newFilterEntry.relativeName.IsEmpty()) @@ -893,7 +1049,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) exFilterCandidateExtension.clear(); if (exFilterCandidateObj.size() > 0 && exFilterCandidateObj[0].type == FileDescrLine::TYPE_FILE) { - const wxString filename = exFilterCandidateObj[0].relativeName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR); + const wxString filename = exFilterCandidateObj[0].relativeName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR); if (filename.Find(wxChar('.')) != wxNOT_FOUND) //be careful: AfterLast will return the whole string if '.' is not found! { exFilterCandidateExtension = filename.AfterLast(wxChar('.')); @@ -909,7 +1065,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) //CONTEXT_EXCLUDE_OBJ wxMenuItem* menuItemExclObj = NULL; if (exFilterCandidateObj.size() == 1) - menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + exFilterCandidateObj[0].relativeName.AfterLast(FreeFileSync::FILE_NAME_SEPARATOR)); + menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + exFilterCandidateObj[0].relativeName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR)); else if (exFilterCandidateObj.size() > 1) menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + _("<multiple selection>")); @@ -1001,19 +1157,19 @@ void MainDialog::OnContextRimSelection(wxCommandEvent& event) case CONTEXT_EXCLUDE_EXT: if (!exFilterCandidateExtension.IsEmpty()) { - if (!cfg.excludeFilter.IsEmpty() && !cfg.excludeFilter.EndsWith(wxT(";"))) - cfg.excludeFilter+= wxT("\n"); + if (!currentCfg.mainCfg.excludeFilter.IsEmpty() && !currentCfg.mainCfg.excludeFilter.EndsWith(wxT(";"))) + currentCfg.mainCfg.excludeFilter+= wxT("\n"); - cfg.excludeFilter+= wxString(wxT("*.")) + exFilterCandidateExtension + wxT(";"); //';' is appended to 'mark' that next exclude extension entry won't write to new line + currentCfg.mainCfg.excludeFilter+= wxString(wxT("*.")) + exFilterCandidateExtension + wxT(";"); //';' is appended to 'mark' that next exclude extension entry won't write to new line - cfg.filterIsActive = true; - updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); + currentCfg.mainCfg.filterIsActive = true; + updateFilterButton(m_bpButtonFilter, currentCfg.mainCfg.filterIsActive); - FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter); filterInstance.filterGridData(currentGridData); updateGuiGrid(); - if (hideFilteredElements) + if (currentCfg.hideFilteredElements) { m_gridLeft->ClearSelection(); m_gridRight->ClearSelection(); @@ -1027,24 +1183,24 @@ void MainDialog::OnContextRimSelection(wxCommandEvent& event) { for (std::vector<FilterObject>::const_iterator i = exFilterCandidateObj.begin(); i != exFilterCandidateObj.end(); ++i) { - if (!cfg.excludeFilter.IsEmpty() && !cfg.excludeFilter.EndsWith(wxT("\n"))) - cfg.excludeFilter+= wxT("\n"); + if (!currentCfg.mainCfg.excludeFilter.IsEmpty() && !currentCfg.mainCfg.excludeFilter.EndsWith(wxT("\n"))) + currentCfg.mainCfg.excludeFilter+= wxT("\n"); if (i->type == FileDescrLine::TYPE_FILE) - cfg.excludeFilter+= wxString(FreeFileSync::FILE_NAME_SEPARATOR) + i->relativeName; + currentCfg.mainCfg.excludeFilter+= wxString(globalFunctions::FILE_NAME_SEPARATOR) + i->relativeName; else if (i->type == FileDescrLine::TYPE_DIRECTORY) - cfg.excludeFilter+= wxString(FreeFileSync::FILE_NAME_SEPARATOR) + i->relativeName + FreeFileSync::FILE_NAME_SEPARATOR + wxT("*"); + currentCfg.mainCfg.excludeFilter+= wxString(globalFunctions::FILE_NAME_SEPARATOR) + i->relativeName + globalFunctions::FILE_NAME_SEPARATOR + wxT("*"); else assert(false); } - cfg.filterIsActive = true; - updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); + currentCfg.mainCfg.filterIsActive = true; + updateFilterButton(m_bpButtonFilter, currentCfg.mainCfg.filterIsActive); - FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter); filterInstance.filterGridData(currentGridData); updateGuiGrid(); - if (hideFilteredElements) + if (currentCfg.hideFilteredElements) { m_gridLeft->ClearSelection(); m_gridRight->ClearSelection(); @@ -1088,7 +1244,14 @@ void MainDialog::OnContextRimSelection(wxCommandEvent& event) void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) { contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize columns")); + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize...")); + + contextMenu->AppendSeparator(); + + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_LEFT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + contextMenu->Append(itemAutoAdjust); + itemAutoAdjust->Check(globalSettings.gui.autoAdjustColumnsLeft); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextRimLabelSelection), NULL, this); PopupMenu(contextMenu.get()); //show context menu } @@ -1097,7 +1260,14 @@ void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) void MainDialog::OnContextRimLabelRight(wxGridEvent& event) { contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize columns")); + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize...")); + + contextMenu->AppendSeparator(); + + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + contextMenu->Append(itemAutoAdjust); + itemAutoAdjust->Check(globalSettings.gui.autoAdjustColumnsRight); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextRimLabelSelection), NULL, this); PopupMenu(contextMenu.get()); //show context menu } @@ -1125,6 +1295,7 @@ void MainDialog::OnContextRimLabelSelection(wxCommandEvent& event) } } break; + case CONTEXT_CUSTOMIZE_COLUMN_RIGHT: { xmlAccess::ColumnAttributes colAttr = m_gridRight->getColumnAttributes(); @@ -1142,6 +1313,16 @@ void MainDialog::OnContextRimLabelSelection(wxCommandEvent& event) } } break; + + case CONTEXT_AUTO_ADJUST_COLUMN_LEFT: + globalSettings.gui.autoAdjustColumnsLeft = !globalSettings.gui.autoAdjustColumnsLeft; + updateGuiGrid(); + break; + + case CONTEXT_AUTO_ADJUST_COLUMN_RIGHT: + globalSettings.gui.autoAdjustColumnsRight = !globalSettings.gui.autoAdjustColumnsRight; + updateGuiGrid(); + break; } } @@ -1153,7 +1334,7 @@ void MainDialog::OnContextMiddle(wxGridEvent& event) contextMenu->Append(CONTEXT_CHECK_ALL, _("Check all")); contextMenu->Append(CONTEXT_UNCHECK_ALL, _("Uncheck all")); - if (gridDataView.refGridIsEmpty()) + if (gridDataView->refGridIsEmpty()) { contextMenu->Enable(CONTEXT_CHECK_ALL, false); contextMenu->Enable(CONTEXT_UNCHECK_ALL, false); @@ -1188,7 +1369,7 @@ void MainDialog::OnContextMiddleLabel(wxGridEvent& event) wxMenuItem* itemSyncPreview = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_PREVIEW, _("Synchronization Preview")); wxMenuItem* itemCmpResult = new wxMenuItem(contextMenu.get(), CONTEXT_COMPARISON_RESULT, _("Comparison Result")); - if (syncPreview->previewIsEnabled()) + if (syncPreview.previewIsEnabled()) itemSyncPreview->SetBitmap(*GlobalResources::getInstance().bitmapSyncViewSmall); else itemCmpResult->SetBitmap(*GlobalResources::getInstance().bitmapCmpViewSmall); @@ -1208,11 +1389,11 @@ void MainDialog::OnContextMiddleLabelSelection(wxCommandEvent& event) { case CONTEXT_COMPARISON_RESULT: //change view - syncPreview->enablePreview(false); + syncPreview.enablePreview(false); break; case CONTEXT_SYNC_PREVIEW: //change view - syncPreview->enablePreview(true); + syncPreview.enablePreview(true); break; } } @@ -1223,7 +1404,7 @@ void MainDialog::OnDirSelected(wxFileDirPickerEvent& event) //left and right directory text-control and dirpicker are synchronized by MainFolderDragDrop automatically //disable the sync button - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); //clear grids currentGridData.clear(); @@ -1242,18 +1423,23 @@ wxString getFormattedHistoryElement(const wxString& filename) } +wxString getFullFilename(const wxString& name) +{ + //resolve relative names to avoid problems after working directory is changed + wxFileName filename(name); + if (!filename.Normalize()) + return name; //fallback + + return filename.GetFullPath(); +} + + //tests if the same filenames are specified, even if they are relative to the current working directory inline bool sameFileSpecified(const wxString& file1, const wxString& file2) { - wxString file1Full = file1; - wxString file2Full = file2; - - if (wxFileName(file1).GetPath() == wxEmptyString) - file1Full = wxFileName::GetCwd() + FreeFileSync::FILE_NAME_SEPARATOR + file1; - - if (wxFileName(file2).GetPath() == wxEmptyString) - file2Full = wxFileName::GetCwd() + FreeFileSync::FILE_NAME_SEPARATOR + file2; + const wxString file1Full = getFullFilename(file1); + const wxString file2Full = getFullFilename(file2); #ifdef FFS_WIN //don't respect case in windows build return FreeFileSync::compareStringsWin32(file1Full.c_str(), file2Full.c_str()) == 0; @@ -1284,8 +1470,8 @@ void MainDialog::addFileToCfgHistory(const wxString& filename) if (!wxFileExists(filename)) return; - std::vector<wxString>::const_iterator i; - if ((i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(filename))) != cfgFileNames.end()) + std::vector<wxString>::const_iterator i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(filename)); + if (i != cfgFileNames.end()) { //if entry is in the list, then jump to element m_choiceHistory->SetSelection(i - cfgFileNames.begin()); } @@ -1294,7 +1480,7 @@ void MainDialog::addFileToCfgHistory(const wxString& filename) cfgFileNames.insert(cfgFileNames.begin(), filename); //the default config file should receive another name on GUI - if (sameFileSpecified(FreeFileSync::getLastConfigFile(), filename)) + if (sameFileSpecified(lastConfigFileName(), filename)) m_choiceHistory->Insert(_("<Last session>"), 0); //insert at beginning of list else m_choiceHistory->Insert(getFormattedHistoryElement(filename), 0); //insert at beginning of list @@ -1407,18 +1593,6 @@ void MainDialog::OnLoadFromHistory(wxCommandEvent& event) } -void MainDialog::OnMenuSaveConfig(wxCommandEvent& event) -{ - OnSaveConfig(event); -} - - -void MainDialog::OnMenuLoadConfig(wxCommandEvent& event) -{ - OnLoadConfig(event); -} - - void MainDialog::loadConfiguration(const wxString& filename) { //notify user about changed settings @@ -1516,20 +1690,6 @@ void MainDialog::OnFolderHistoryKeyEvent(wxKeyEvent& event) } -void MainDialog::OnCompareByTimeSize(wxCommandEvent& event) -{ - cfg.compareVar = CMP_BY_TIME_SIZE; - updateCompareButtons(); -} - - -void MainDialog::OnCompareByContent(wxCommandEvent& event) -{ - cfg.compareVar = CMP_BY_CONTENT; - updateCompareButtons(); -} - - void MainDialog::OnClose(wxCloseEvent &event) { requestShutdown(); @@ -1584,7 +1744,7 @@ void MainDialog::OnCheckRows(FFSCheckRowsEvent& event) { std::set<int> selectedRowsOnView; - for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView.elementsOnView()) - 1); ++i) + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->elementsOnView()) - 1); ++i) selectedRowsOnView.insert(i); filterRangeManually(selectedRowsOnView, event.rowFrom); @@ -1599,10 +1759,10 @@ void MainDialog::OnSetSyncDirection(FFSSyncDirectionEvent& event) if (0 <= lowerBound) { - for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView.elementsOnView()) - 1); ++i) + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->elementsOnView()) - 1); ++i) { - gridDataView[i].direction = event.direction; - gridDataView[i].selectedForSynchronization = true; + (*gridDataView)[i].syncDir = event.direction; + (*gridDataView)[i].selectedForSynchronization = true; } updateGuiGrid(); @@ -1613,101 +1773,81 @@ void MainDialog::OnSetSyncDirection(FFSSyncDirectionEvent& event) bool MainDialog::readConfigurationFromXml(const wxString& filename, bool programStartup) { //load XML - xmlAccess::XmlGuiConfig guiCfg; //structure to receive gui settings, already defaulted!! + xmlAccess::XmlGuiConfig newGuiCfg; //structure to receive gui settings, already defaulted!! try { - guiCfg = xmlAccess::readGuiConfig(filename); + xmlAccess::readGuiConfig(filename, newGuiCfg); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { - if (programStartup) - { - if (filename == FreeFileSync::getLastConfigFile() && !wxFileExists(filename)) //do not show error in this case - ; - else //program startup: show error message and load defaults - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - } + if (programStartup && filename == lastConfigFileName() && !wxFileExists(filename)) //do not show error message in this case + ; else { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - return false; + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + return false; + } } } - //(re-)set view filter buttons - gridDataView.leftOnlyFilesActive = true; - gridDataView.leftNewerFilesActive = true; - gridDataView.differentFilesActive = true; - gridDataView.rightNewerFilesActive = true; //do not save/load these bool values from harddisk! - gridDataView.rightOnlyFilesActive = true; //it's more convenient to have them defaulted at startup - gridDataView.equalFilesActive = false; - - gridDataView.conflictFilesActive = true; + currentCfg = newGuiCfg; - gridDataView.syncDirLeftActive = true; - gridDataView.syncDirRightActive = true; - gridDataView.syncDirNoneActive = true; - - updateViewFilterButtons(); + //evaluate new settings... + //disable the sync button + syncPreview.enableSynchronization(false); - //load main configuration into instance - cfg = guiCfg.mainCfg; + //clear grids + currentGridData.clear(); + updateGuiGrid(); - //update visible config on main window - updateCompareButtons(); + //(re-)set view filter buttons + gridDataView->resetSettings(); + updateViewFilterButtons(); - updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); + updateFilterButton(m_bpButtonFilter, currentCfg.mainCfg.filterIsActive); //read folder pairs: + //clear existing pairs first - m_directoryLeft->SetSelection(wxNOT_FOUND); - m_directoryLeft->SetValue(wxEmptyString); - m_dirPickerLeft->SetPath(wxEmptyString); - m_directoryRight->SetSelection(wxNOT_FOUND); - m_directoryRight->SetValue(wxEmptyString); - m_dirPickerRight->SetPath(wxEmptyString); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryRight, m_dirPickerRight); - clearFolderPairs(); + clearAddFolderPairs(); - if (guiCfg.directoryPairs.size() > 0) + if (currentCfg.directoryPairs.size() > 0) { //set main folder pair - std::vector<FolderPair>::const_iterator main = guiCfg.directoryPairs.begin(); + std::vector<FolderPair>::const_iterator main = currentCfg.directoryPairs.begin(); - m_directoryLeft->SetValue(main->leftDirectory.c_str()); - const wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(main->leftDirectory).c_str(); - if (wxDirExists(leftDirFormatted)) - m_dirPickerLeft->SetPath(leftDirFormatted); - addLeftFolderToHistory(main->leftDirectory.c_str()); //another hack: wxCombobox::Insert() asynchronously sends message overwriting a later wxCombobox::SetValue()!!! :( + FreeFileSync::setDirectoryName(main->leftDirectory.c_str(), m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(main->rightDirectory.c_str(), m_directoryRight, m_dirPickerRight); - m_directoryRight->SetValue(main->rightDirectory.c_str()); - const wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(main->rightDirectory).c_str(); - if (wxDirExists(rightDirFormatted)) - m_dirPickerRight->SetPath(rightDirFormatted); - addRightFolderToHistory(main->rightDirectory.c_str()); //another hack... + addLeftFolderToHistory( main->leftDirectory.c_str()); //another hack: wxCombobox::Insert() asynchronously sends message + addRightFolderToHistory(main->rightDirectory.c_str()); //overwriting a later wxCombobox::SetValue()!!! :( //set additional pairs - std::vector<FolderPair> additionalPairs; //don't modify guiCfg.directoryPairs! - for (std::vector<FolderPair>::const_iterator i = guiCfg.directoryPairs.begin() + 1; i != guiCfg.directoryPairs.end(); ++i) - additionalPairs.push_back(*i); - addFolderPair(additionalPairs); + addFolderPair(std::vector<FolderPair>(currentCfg.directoryPairs.begin() + 1, currentCfg.directoryPairs.end())); } //read GUI layout - hideFilteredElements = guiCfg.hideFilteredElements; - m_checkBoxHideFilt->SetValue(hideFilteredElements); + currentCfg.hideFilteredElements = currentCfg.hideFilteredElements; + m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); - ignoreErrors = guiCfg.ignoreErrors; + currentCfg.ignoreErrors = currentCfg.ignoreErrors; - syncPreview->enablePreview(guiCfg.syncPreviewEnabled); + syncPreview.enablePreview(currentCfg.syncPreviewEnabled); //########################################################### addFileToCfgHistory(filename); //put filename on list of last used config files - lastConfigurationSaved = guiCfg; + lastConfigurationSaved = currentCfg; - if (filename == FreeFileSync::getLastConfigFile()) //set title + if (filename == lastConfigFileName()) //set title { SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); currentConfigFileName.clear(); @@ -1718,8 +1858,11 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program currentConfigFileName = filename; } - //update variant name - m_staticTextVariant->SetLabel(wxString(wxT("(")) + cfg.syncConfiguration.getVariantName() + wxT(")")); + //update compare variant name + m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); + + //update sync variant name + m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + currentCfg.mainCfg.syncConfiguration.getVariantName() + wxT(")")); bSizer6->Layout(); //adapt layout for variant text return true; @@ -1733,20 +1876,20 @@ bool MainDialog::writeConfigurationToXml(const wxString& filename) //write config to XML try { - xmlAccess::writeGuiConfig(filename, guiCfg); + xmlAccess::writeGuiConfig(guiCfg, filename); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; } - //put filename on list of last used config files - addFileToCfgHistory(filename); + //########################################################### + addFileToCfgHistory(filename); //put filename on list of last used config files lastConfigurationSaved = guiCfg; - if (filename == FreeFileSync::getLastConfigFile()) //set title + if (filename == lastConfigFileName()) //set title { SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); currentConfigFileName.clear(); @@ -1763,27 +1906,22 @@ bool MainDialog::writeConfigurationToXml(const wxString& filename) xmlAccess::XmlGuiConfig MainDialog::getCurrentConfiguration() const { - xmlAccess::XmlGuiConfig guiCfg; - - //load structure with basic settings "mainCfg" - guiCfg.mainCfg = cfg; - guiCfg.directoryPairs = getFolderPairs(); - - //load structure with gui settings - guiCfg.hideFilteredElements = hideFilteredElements; + xmlAccess::XmlGuiConfig guiCfg = currentCfg; - guiCfg.ignoreErrors = ignoreErrors; - - guiCfg.syncPreviewEnabled = syncPreview->previewIsEnabled(); + //load settings whose ownership lies not in currentCfg + guiCfg.directoryPairs = getFolderPairs(); + guiCfg.syncPreviewEnabled = syncPreview.previewIsEnabled(); return guiCfg; } -void MainDialog::OnShowHelpDialog(wxCommandEvent &event) +const wxString& MainDialog::lastConfigFileName() { - HelpDlg* helpDlg = new HelpDlg(this); - helpDlg->ShowModal(); + static wxString instance = FreeFileSync::getConfigDir().EndsWith(wxString(globalFunctions::FILE_NAME_SEPARATOR)) ? + FreeFileSync::getConfigDir() + wxT("LastRun.ffs_gui") : + FreeFileSync::getConfigDir() + globalFunctions::FILE_NAME_SEPARATOR + wxT("LastRun.ffs_gui"); + return instance; } @@ -1795,7 +1933,7 @@ void MainDialog::refreshGridAfterFilterChange(const int delay) m_gridRight->ForceRefresh(); Update(); //show changes resulting from ForceRefresh() - if (hideFilteredElements) + if (currentCfg.hideFilteredElements) { wxMilliSleep(delay); //some delay to show user the rows he has filtered out before they are removed updateGuiGrid(); //redraw grid to remove excluded elements (keeping sort sequence) @@ -1810,13 +1948,13 @@ void MainDialog::refreshGridAfterFilterChange(const int delay) void MainDialog::OnFilterButton(wxCommandEvent &event) { //toggle filter on/off - cfg.filterIsActive = !cfg.filterIsActive; + currentCfg.mainCfg.filterIsActive = !currentCfg.mainCfg.filterIsActive; //make sure, button-appearance and "filterIsActive" are in sync. - updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); + updateFilterButton(m_bpButtonFilter, currentCfg.mainCfg.filterIsActive); - if (cfg.filterIsActive) + if (currentCfg.mainCfg.filterIsActive) { - FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter); filterInstance.filterGridData(currentGridData); refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts } @@ -1830,9 +1968,9 @@ void MainDialog::OnFilterButton(wxCommandEvent &event) void MainDialog::OnHideFilteredButton(wxCommandEvent &event) { //toggle showing filtered rows - hideFilteredElements = !hideFilteredElements; + currentCfg.hideFilteredElements = !currentCfg.hideFilteredElements; //make sure, checkbox and "hideFiltered" are in sync - m_checkBoxHideFilt->SetValue(hideFilteredElements); + m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); m_gridLeft->ClearSelection(); m_gridRight->ClearSelection(); @@ -1845,29 +1983,29 @@ void MainDialog::OnHideFilteredButton(wxCommandEvent &event) void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) { - const wxString beforeImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; + const wxString beforeImage = currentCfg.mainCfg.includeFilter + wxChar(1) + currentCfg.mainCfg.excludeFilter; - FilterDlg* filterDlg = new FilterDlg(this, cfg.includeFilter, cfg.excludeFilter); + FilterDlg* filterDlg = new FilterDlg(this, currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter); if (filterDlg->ShowModal() == FilterDlg::BUTTON_OKAY) { - const wxString afterImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; + const wxString afterImage = currentCfg.mainCfg.includeFilter + wxChar(1) + currentCfg.mainCfg.excludeFilter; if (beforeImage != afterImage) //if filter settings are changed: set filtering to "on" { if (afterImage == (wxString(wxT("*")) + wxChar(1))) //default { - cfg.filterIsActive = false; + currentCfg.mainCfg.filterIsActive = false; FreeFileSync::FilterProcess::includeAllRowsOnGrid(currentGridData); } else { - cfg.filterIsActive = true; + currentCfg.mainCfg.filterIsActive = true; - FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter); filterInstance.filterGridData(currentGridData); } - updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); + updateFilterButton(m_bpButtonFilter, currentCfg.mainCfg.filterIsActive); updateGuiGrid(); } @@ -1879,35 +2017,35 @@ void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) { - gridDataView.leftOnlyFilesActive = !gridDataView.leftOnlyFilesActive; + gridDataView->leftOnlyFilesActive = !gridDataView->leftOnlyFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) { - gridDataView.leftNewerFilesActive = !gridDataView.leftNewerFilesActive; + gridDataView->leftNewerFilesActive = !gridDataView->leftNewerFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnDifferentFiles(wxCommandEvent& event) { - gridDataView.differentFilesActive = !gridDataView.differentFilesActive; + gridDataView->differentFilesActive = !gridDataView->differentFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnRightNewerFiles(wxCommandEvent& event) { - gridDataView.rightNewerFilesActive = !gridDataView.rightNewerFilesActive; + gridDataView->rightNewerFilesActive = !gridDataView->rightNewerFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) { - gridDataView.rightOnlyFilesActive = !gridDataView.rightOnlyFilesActive; + gridDataView->rightOnlyFilesActive = !gridDataView->rightOnlyFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1915,7 +2053,7 @@ void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) void MainDialog::OnEqualFiles(wxCommandEvent& event) { - gridDataView.equalFilesActive = !gridDataView.equalFilesActive; + gridDataView->equalFilesActive = !gridDataView->equalFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1923,7 +2061,39 @@ void MainDialog::OnEqualFiles(wxCommandEvent& event) void MainDialog::OnConflictFiles(wxCommandEvent& event) { - gridDataView.conflictFilesActive = !gridDataView.conflictFilesActive; + gridDataView->conflictFilesActive = !gridDataView->conflictFilesActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncCreateLeft(wxCommandEvent& event) +{ + gridDataView->syncCreateLeftActive = !gridDataView->syncCreateLeftActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncCreateRight(wxCommandEvent& event) +{ + gridDataView->syncCreateRightActive = !gridDataView->syncCreateRightActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncDeleteLeft(wxCommandEvent& event) +{ + gridDataView->syncDeleteLeftActive = !gridDataView->syncDeleteLeftActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncDeleteRight(wxCommandEvent& event) +{ + gridDataView->syncDeleteRightActive = !gridDataView->syncDeleteRightActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1931,7 +2101,7 @@ void MainDialog::OnConflictFiles(wxCommandEvent& event) void MainDialog::OnSyncDirLeft(wxCommandEvent& event) { - gridDataView.syncDirLeftActive = !gridDataView.syncDirLeftActive; + gridDataView->syncDirLeftActive = !gridDataView->syncDirLeftActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1939,7 +2109,7 @@ void MainDialog::OnSyncDirLeft(wxCommandEvent& event) void MainDialog::OnSyncDirRight(wxCommandEvent& event) { - gridDataView.syncDirRightActive = !gridDataView.syncDirRightActive; + gridDataView->syncDirRightActive = !gridDataView->syncDirRightActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1947,7 +2117,7 @@ void MainDialog::OnSyncDirRight(wxCommandEvent& event) void MainDialog::OnSyncDirNone(wxCommandEvent& event) { - gridDataView.syncDirNoneActive = !gridDataView.syncDirNoneActive; + gridDataView->syncDirNoneActive = !gridDataView->syncDirNoneActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1956,7 +2126,7 @@ void MainDialog::OnSyncDirNone(wxCommandEvent& event) void MainDialog::updateViewFilterButtons() { //compare result buttons - if (gridDataView.leftOnlyFilesActive) + if (gridDataView->leftOnlyFilesActive) { m_bpButtonLeftOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapLeftOnlyAct); m_bpButtonLeftOnly->SetToolTip(_("Hide files that exist on left side only")); @@ -1967,7 +2137,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonLeftOnly->SetToolTip(_("Show files that exist on left side only")); } - if (gridDataView.rightOnlyFilesActive) + if (gridDataView->rightOnlyFilesActive) { m_bpButtonRightOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapRightOnlyAct); m_bpButtonRightOnly->SetToolTip(_("Hide files that exist on right side only")); @@ -1978,7 +2148,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonRightOnly->SetToolTip(_("Show files that exist on right side only")); } - if (gridDataView.leftNewerFilesActive) + if (gridDataView->leftNewerFilesActive) { m_bpButtonLeftNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapLeftNewerAct); m_bpButtonLeftNewer->SetToolTip(_("Hide files that are newer on left")); @@ -1989,7 +2159,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonLeftNewer->SetToolTip(_("Show files that are newer on left")); } - if (gridDataView.rightNewerFilesActive) + if (gridDataView->rightNewerFilesActive) { m_bpButtonRightNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapRightNewerAct); m_bpButtonRightNewer->SetToolTip(_("Hide files that are newer on right")); @@ -2000,7 +2170,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonRightNewer->SetToolTip(_("Show files that are newer on right")); } - if (gridDataView.equalFilesActive) + if (gridDataView->equalFilesActive) { m_bpButtonEqual->SetBitmapLabel(*GlobalResources::getInstance().bitmapEqualAct); m_bpButtonEqual->SetToolTip(_("Hide files that are equal")); @@ -2011,7 +2181,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonEqual->SetToolTip(_("Show files that are equal")); } - if (gridDataView.differentFilesActive) + if (gridDataView->differentFilesActive) { m_bpButtonDifferent->SetBitmapLabel(*GlobalResources::getInstance().bitmapDifferentAct); m_bpButtonDifferent->SetToolTip(_("Hide files that are different")); @@ -2022,7 +2192,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonDifferent->SetToolTip(_("Show files that are different")); } - if (gridDataView.conflictFilesActive) + if (gridDataView->conflictFilesActive) { m_bpButtonConflict->SetBitmapLabel(*GlobalResources::getInstance().bitmapConflictAct); m_bpButtonConflict->SetToolTip(_("Hide conflicts")); @@ -2034,7 +2204,51 @@ void MainDialog::updateViewFilterButtons() } //sync preview buttons - if (gridDataView.syncDirLeftActive) + if (gridDataView->syncCreateLeftActive) + { + m_bpButtonSyncCreateLeft->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncCreateLeftAct); + m_bpButtonSyncCreateLeft->SetToolTip(_("Hide files that will be created on the left side")); + } + else + { + m_bpButtonSyncCreateLeft->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncCreateLeftDeact); + m_bpButtonSyncCreateLeft->SetToolTip(_("Show files that will be created on the left side")); + } + + if (gridDataView->syncCreateRightActive) + { + m_bpButtonSyncCreateRight->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncCreateRightAct); + m_bpButtonSyncCreateRight->SetToolTip(_("Hide files that will be created on the right side")); + } + else + { + m_bpButtonSyncCreateRight->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncCreateRightDeact); + m_bpButtonSyncCreateRight->SetToolTip(_("Show files that will be created on the right side")); + } + + if (gridDataView->syncDeleteLeftActive) + { + m_bpButtonSyncDeleteLeft->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDeleteLeftAct); + m_bpButtonSyncDeleteLeft->SetToolTip(_("Hide files that will be deleted on the left side")); + } + else + { + m_bpButtonSyncDeleteLeft->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDeleteLeftDeact); + m_bpButtonSyncDeleteLeft->SetToolTip(_("Show files that will be deleted on the left side")); + } + + if (gridDataView->syncDeleteRightActive) + { + m_bpButtonSyncDeleteRight->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDeleteRightAct); + m_bpButtonSyncDeleteRight->SetToolTip(_("Hide files that will be deleted on the right side")); + } + else + { + m_bpButtonSyncDeleteRight->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDeleteRightDeact); + m_bpButtonSyncDeleteRight->SetToolTip(_("Show files that will be deleted on the right side")); + } + + if (gridDataView->syncDirLeftActive) { m_bpButtonSyncDirLeft->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDirLeftAct); m_bpButtonSyncDirLeft->SetToolTip(_("Hide files that will be copied to the left side")); @@ -2045,7 +2259,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonSyncDirLeft->SetToolTip(_("Show files that will be copied to the left side")); } - if (gridDataView.syncDirRightActive) + if (gridDataView->syncDirRightActive) { m_bpButtonSyncDirRight->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDirRightAct); m_bpButtonSyncDirRight->SetToolTip(_("Hide files that will be copied to the right side")); @@ -2056,7 +2270,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonSyncDirRight->SetToolTip(_("Show files that will be copied to the right side")); } - if (gridDataView.syncDirNoneActive) + if (gridDataView->syncDirNoneActive) { m_bpButtonSyncDirNone->SetBitmapLabel(*GlobalResources::getInstance().bitmapSyncDirNoneAct); m_bpButtonSyncDirNone->SetToolTip(_("Hide files that won't be copied")); @@ -2097,29 +2311,6 @@ void MainDialog::updateFilterButton(wxBitmapButton* filterButton, bool isActive) } -void MainDialog::updateCompareButtons() -{ - switch (cfg.compareVar) - { - case CMP_BY_TIME_SIZE: - m_radioBtnSizeDate->SetValue(true); - break; - case CMP_BY_CONTENT: - m_radioBtnContent->SetValue(true); - break; - default: - assert (false); - } - - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - currentGridData.clear(); - updateGuiGrid(); -} - - std::vector<FolderPair> MainDialog::getFolderPairs() const { std::vector<FolderPair> output; @@ -2144,7 +2335,9 @@ void MainDialog::OnCompare(wxCommandEvent &event) wxBusyCursor dummy; //show hourglass cursor - //prevent temporary memory peak by clearing old result list + //1. prevent temporary memory peak by clearing old result list + //2. ATTENTION: wxAPP->Yield() will be called in the following! + // when comparing there will be a mismatch "gridDataView <-> currentGridData": make sure gridDataView does NOT access currentGridData!!! currentGridData.clear(); updateGuiGrid(); //refresh GUI grid @@ -2152,12 +2345,11 @@ void MainDialog::OnCompare(wxCommandEvent &event) try { //class handling status display and error messages CompareStatusHandler statusHandler(this); - cmpStatusHandlerTmp = &statusHandler; //prepare filter std::auto_ptr<FreeFileSync::FilterProcess> filterInstance(NULL); - if (cfg.filterIsActive) - filterInstance.reset(new FreeFileSync::FilterProcess(cfg.includeFilter, cfg.excludeFilter)); + if (currentCfg.mainCfg.filterIsActive) + filterInstance.reset(new FreeFileSync::FilterProcess(currentCfg.mainCfg.includeFilter, currentCfg.mainCfg.excludeFilter)); //begin comparison FreeFileSync::CompareProcess comparison(globalSettings.traverseDirectorySymlinks, @@ -2168,30 +2360,29 @@ void MainDialog::OnCompare(wxCommandEvent &event) &statusHandler); comparison.startCompareProcess(getFolderPairs(), - cfg.compareVar, - cfg.syncConfiguration, + currentCfg.mainCfg.compareVar, + currentCfg.mainCfg.syncConfiguration, currentGridData); //if (output.size < 50000) statusHandler.updateStatusText(_("Sorting file list...")); statusHandler.forceUiRefresh(); //keep total number of scanned files up to date - gridDataView.sortView(GridView::SORT_BY_DIRECTORY, true, true); + gridDataView->sortView(GridView::SORT_BY_DIRECTORY, true, true); } catch (AbortThisProcess&) { aborted = true; } - cmpStatusHandlerTmp = NULL; if (aborted) { //disable the sync button - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); m_buttonCompare->SetFocus(); } else { //once compare is finished enable the sync button - syncPreview->enableSynchronization(true); + syncPreview.enableSynchronization(true); m_buttonStartSync->SetFocus(); //hide sort direction indicator on GUI grids @@ -2217,70 +2408,57 @@ void MainDialog::OnCompare(wxCommandEvent &event) } -void MainDialog::OnAbortCompare(wxCommandEvent& event) -{ - if (cmpStatusHandlerTmp) - cmpStatusHandlerTmp->requestAbortion(); -} - - void MainDialog::updateGuiGrid() { - m_gridLeft->BeginBatch(); //necessary?? + m_gridLeft ->BeginBatch(); //necessary?? m_gridMiddle->BeginBatch(); - m_gridRight->BeginBatch(); + m_gridRight ->BeginBatch(); updateGridViewData(); //update gridDataView and write status information - //all three grids retrieve their data directly via currentGridData!!! + //all three grids retrieve their data directly via gridDataView(which knows currentGridData)!!! //the only thing left to do is notify the grids to update their sizes (nr of rows), since this has to be communicated by the grids via messages - m_gridLeft->updateGridSizes(); + m_gridLeft ->updateGridSizes(); m_gridMiddle->updateGridSizes(); - m_gridRight->updateGridSizes(); + m_gridRight ->updateGridSizes(); //enlarge label width to display row numbers correctly const int nrOfRows = m_gridLeft->GetNumberRows(); - - if (nrOfRows >= 1) + if (nrOfRows >= 0) { #ifdef FFS_WIN - const int digitWidth = 8; + const unsigned int digitWidth = 8; #elif defined FFS_LINUX - const int digitWidth = 10; + const unsigned int digitWidth = 10; #endif - const int nrOfDigits = int(floor(log10(double(nrOfRows)) + 1)); - m_gridLeft->SetRowLabelSize(nrOfDigits * digitWidth + 4); + const unsigned int nrOfDigits = globalFunctions::getDigitCount(static_cast<unsigned int>(nrOfRows)); + m_gridLeft ->SetRowLabelSize(nrOfDigits * digitWidth + 4); m_gridRight->SetRowLabelSize(nrOfDigits * digitWidth + 4); } + //support for column auto adjustment + if (globalSettings.gui.autoAdjustColumnsLeft) + m_gridLeft->AutoSizeColumns(false); + if (globalSettings.gui.autoAdjustColumnsRight) + m_gridRight->AutoSizeColumns(false); + //update sync preview statistics calculatePreview(); - m_gridLeft->EndBatch(); + m_gridLeft ->EndBatch(); m_gridMiddle->EndBatch(); - m_gridRight->EndBatch(); + m_gridRight ->EndBatch(); } void MainDialog::calculatePreview() { //update preview of bytes to be transferred: - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflictsDummy = 0; - wxULongLong dataToProcess; - FreeFileSync::calcTotalBytesToSync(currentGridData, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflictsDummy, - dataToProcess); - - const wxString toCreate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToCreate)); - const wxString toUpdate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToOverwrite)); - const wxString toDelete = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToDelete)); - const wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); + const SyncStatistics st(currentGridData); + const wxString toCreate = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(st.getCreate())); + const wxString toUpdate = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(st.getOverwrite())); + const wxString toDelete = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(st.getDelete())); + const wxString data = FreeFileSync::formatFilesizeToShortString(st.getDataToProcess()); m_textCtrlCreate->SetValue(toCreate); m_textCtrlUpdate->SetValue(toUpdate); @@ -2292,56 +2470,67 @@ void MainDialog::calculatePreview() void MainDialog::OnSwitchView(wxCommandEvent& event) { //toggle view - syncPreview->enablePreview(!syncPreview->previewIsEnabled()); + syncPreview.enablePreview(!syncPreview.previewIsEnabled()); } void MainDialog::OnSyncSettings(wxCommandEvent& event) { - SyncDialog* syncDlg = new SyncDialog(this, currentGridData, cfg, ignoreErrors); - if (syncDlg->ShowModal() == SyncDialog::BUTTON_OKAY) + SyncCfgDialog* syncDlg = new SyncCfgDialog(this, currentGridData, currentCfg.mainCfg, currentCfg.ignoreErrors); + if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_OKAY) { - //update variant name - m_staticTextVariant->SetLabel(wxString(wxT("(")) + cfg.syncConfiguration.getVariantName() + wxT(")")); + //update sync variant name + m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + currentCfg.mainCfg.syncConfiguration.getVariantName() + wxT(")")); bSizer6->Layout(); //adapt layout for variant text - redetermineSyncDirection(cfg.syncConfiguration, currentGridData); + redetermineSyncDirection(currentCfg.mainCfg.syncConfiguration, currentGridData); updateGuiGrid(); } } +void MainDialog::OnCmpSettings(wxCommandEvent& event) +{ + CompareVariant newCmpVariant = currentCfg.mainCfg.compareVar; + + CompareCfgDialog* syncDlg = new CompareCfgDialog(this, newCmpVariant); + if (syncDlg->ShowModal() == CompareCfgDialog::BUTTON_OKAY) + { + if (currentCfg.mainCfg.compareVar != newCmpVariant) + { + currentCfg.mainCfg.compareVar = newCmpVariant; + + //update compare variant name + m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); + bSizer6->Layout(); //adapt layout for variant text + + //disable the sync button + syncPreview.enableSynchronization(false); + + //clear grids + currentGridData.clear(); + updateGuiGrid(); + + m_buttonCompare->SetFocus(); + } + } +} + + void MainDialog::OnStartSync(wxCommandEvent& event) { - if (syncPreview->synchronizationIsEnabled()) + if (syncPreview.synchronizationIsEnabled()) { //show sync preview screen if (globalSettings.gui.showSummaryBeforeSync) { - //prepare preview screen - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - int conflictsDummy = 0; - wxULongLong dataToProcess; - FreeFileSync::calcTotalBytesToSync(currentGridData, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - conflictsDummy, - dataToProcess); - - const wxString toCreate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToCreate)); - const wxString toUpdate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToOverwrite)); - const wxString toDelete = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToDelete)); - const wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); - bool dontShowAgain = false; SyncPreviewDlg* preview = new SyncPreviewDlg( - this, cfg.syncConfiguration.getVariantName(), - toCreate, toUpdate, toDelete, data, + this, + currentCfg.mainCfg.syncConfiguration.getVariantName(), + FreeFileSync::SyncStatistics(currentGridData), dontShowAgain); if (preview->ShowModal() != SyncPreviewDlg::BUTTON_START) @@ -2359,15 +2548,20 @@ void MainDialog::OnStartSync(wxCommandEvent& event) wxBusyCursor dummy; //show hourglass cursor + //ATTENTION: wxAPP->Yield() will be called in the following! + //when sync'ing there will be a mismatch "gridDataView <-> currentGridData": make sure gridDataView does NOT access currentGridData!!! + gridDataView->clearView(); + clearStatusBar(); try { //class handling status updates and error messages - SyncStatusHandler statusHandler(this, ignoreErrors); + SyncStatusHandler statusHandler(this, currentCfg.ignoreErrors); //start synchronization and return elements that were not sync'ed in currentGridData FreeFileSync::SyncProcess synchronization( - cfg.useRecycleBin, + currentCfg.mainCfg.handleDeletion, + currentCfg.mainCfg.customDeletionDirectory, globalSettings.copyFileSymlinks, globalSettings.traverseDirectorySymlinks, globalSettings.warnings, @@ -2388,12 +2582,12 @@ void MainDialog::OnStartSync(wxCommandEvent& event) m_gridMiddle->ClearSelection(); m_gridRight->ClearSelection(); - if (!gridDataView.refGridIsEmpty()) + if (!gridDataView->refGridIsEmpty()) pushStatusInformation(_("Not all items have been synchronized! Have a look at the list.")); else { pushStatusInformation(_("All items have been synchronized!")); - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); } } } @@ -2433,22 +2627,22 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) switch (columnType) { case xmlAccess::FULL_PATH: - gridDataView.sortView(GridView::SORT_BY_DIRECTORY, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DIRECTORY, true, sortAscending); break; case xmlAccess::FILENAME: - gridDataView.sortView(GridView::SORT_BY_FILENAME, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_FILENAME, true, sortAscending); break; case xmlAccess::REL_PATH: - gridDataView.sortView(GridView::SORT_BY_REL_NAME, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_REL_NAME, true, sortAscending); break; case xmlAccess::DIRECTORY: - gridDataView.sortView(GridView::SORT_BY_DIRECTORY, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DIRECTORY, true, sortAscending); break; case xmlAccess::SIZE: - gridDataView.sortView(GridView::SORT_BY_FILESIZE, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_FILESIZE, true, sortAscending); break; case xmlAccess::DATE: - gridDataView.sortView(GridView::SORT_BY_DATE, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DATE, true, sortAscending); break; } @@ -2474,10 +2668,10 @@ void MainDialog::OnSortMiddleGrid(wxGridEvent& event) lastSortGrid = m_gridMiddle; //start sort - if (syncPreview->previewIsEnabled()) - gridDataView.sortView(GridView::SORT_BY_SYNC_DIRECTION, true, sortAscending); + if (syncPreview.previewIsEnabled()) + gridDataView->sortView(GridView::SORT_BY_SYNC_DIRECTION, true, sortAscending); else - gridDataView.sortView(GridView::SORT_BY_CMP_RESULT, true, sortAscending); + gridDataView->sortView(GridView::SORT_BY_CMP_RESULT, true, sortAscending); updateGuiGrid(); //refresh gridDataView @@ -2508,22 +2702,22 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) switch (columnType) { case xmlAccess::FULL_PATH: - gridDataView.sortView(GridView::SORT_BY_DIRECTORY, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DIRECTORY, false, sortAscending); break; case xmlAccess::FILENAME: - gridDataView.sortView(GridView::SORT_BY_FILENAME, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_FILENAME, false, sortAscending); break; case xmlAccess::REL_PATH: - gridDataView.sortView(GridView::SORT_BY_REL_NAME, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_REL_NAME, false, sortAscending); break; case xmlAccess::DIRECTORY: - gridDataView.sortView(GridView::SORT_BY_DIRECTORY, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DIRECTORY, false, sortAscending); break; case xmlAccess::SIZE: - gridDataView.sortView(GridView::SORT_BY_FILESIZE, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_FILESIZE, false, sortAscending); break; case xmlAccess::DATE: - gridDataView.sortView(GridView::SORT_BY_DATE, false, sortAscending); + gridDataView->sortView(GridView::SORT_BY_DATE, false, sortAscending); break; } @@ -2559,14 +2753,17 @@ void MainDialog::OnSwapSides(wxCommandEvent& event) } //swap view filter - std::swap(gridDataView.leftOnlyFilesActive, gridDataView.rightOnlyFilesActive); - std::swap(gridDataView.leftNewerFilesActive, gridDataView.rightNewerFilesActive); - std::swap(gridDataView.syncDirLeftActive, gridDataView.syncDirRightActive); + std::swap(gridDataView->leftOnlyFilesActive, gridDataView->rightOnlyFilesActive); + std::swap(gridDataView->leftNewerFilesActive, gridDataView->rightNewerFilesActive); + + std::swap(gridDataView->syncCreateLeftActive, gridDataView->syncCreateRightActive); + std::swap(gridDataView->syncDirLeftActive, gridDataView->syncDirRightActive); + std::swap(gridDataView->syncDeleteLeftActive, gridDataView->syncDeleteRightActive); updateViewFilterButtons(); //swap grid information - FreeFileSync::swapGrids(cfg.syncConfiguration, currentGridData); + FreeFileSync::swapGrids(currentCfg.mainCfg.syncConfiguration, currentGridData); updateGuiGrid(); event.Skip(); } @@ -2574,7 +2771,7 @@ void MainDialog::OnSwapSides(wxCommandEvent& event) void MainDialog::updateGridViewData() { - const GridView::StatusInfo result = gridDataView.update(hideFilteredElements, syncPreview->previewIsEnabled()); + const GridView::StatusInfo result = gridDataView->update(currentCfg.hideFilteredElements, syncPreview.previewIsEnabled()); //hide or enable view filter buttons @@ -2615,6 +2812,26 @@ void MainDialog::updateGridViewData() m_bpButtonConflict->Hide(); //sync preview buttons + if (result.existsSyncCreateLeft) + m_bpButtonSyncCreateLeft->Show(); + else + m_bpButtonSyncCreateLeft->Hide(); + + if (result.existsSyncCreateRight) + m_bpButtonSyncCreateRight->Show(); + else + m_bpButtonSyncCreateRight->Hide(); + + if (result.existsSyncDeleteLeft) + m_bpButtonSyncDeleteLeft->Show(); + else + m_bpButtonSyncDeleteLeft->Hide(); + + if (result.existsSyncDeleteRight) + m_bpButtonSyncDeleteRight->Show(); + else + m_bpButtonSyncDeleteRight->Hide(); + if (result.existsSyncDirLeft) m_bpButtonSyncDirLeft->Show(); else @@ -2631,15 +2848,19 @@ void MainDialog::updateGridViewData() m_bpButtonSyncDirNone->Hide(); - if ( result.existsLeftOnly || - result.existsRightOnly || - result.existsLeftNewer || - result.existsRightNewer || - result.existsDifferent || - result.existsEqual || - result.existsConflict || - result.existsSyncDirLeft || - result.existsSyncDirRight || + if ( result.existsLeftOnly || + result.existsRightOnly || + result.existsLeftNewer || + result.existsRightNewer || + result.existsDifferent || + result.existsEqual || + result.existsConflict || + result.existsSyncCreateLeft || + result.existsSyncCreateRight || + result.existsSyncDeleteLeft || + result.existsSyncDeleteRight || + result.existsSyncDirLeft || + result.existsSyncDirRight || result.existsSyncDirNone) { m_panel112->Show(); @@ -2669,7 +2890,7 @@ void MainDialog::updateGridViewData() statusLeftNew += _("1 directory"); else { - wxString folderCount = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.foldersOnLeftView)); + wxString folderCount = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(result.foldersOnLeftView)); wxString outputString = _("%x directories"); outputString.Replace(wxT("%x"), folderCount, false); @@ -2686,7 +2907,7 @@ void MainDialog::updateGridViewData() statusLeftNew += _("1 file,"); else { - wxString fileCount = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.filesOnLeftView)); + wxString fileCount = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(result.filesOnLeftView)); wxString outputString = _("%x files,"); outputString.Replace(wxT("%x"), fileCount, false); @@ -2696,7 +2917,7 @@ void MainDialog::updateGridViewData() statusLeftNew += FreeFileSync::formatFilesizeToShortString(result.filesizeLeftView); } - const wxString objectsView = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(gridDataView.elementsOnView())); + const wxString objectsView = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(gridDataView->elementsOnView())); if (result.objectsTotal == 1) { wxString outputString = _("%x of 1 row in view"); @@ -2705,7 +2926,7 @@ void MainDialog::updateGridViewData() } else { - const wxString objectsTotal = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.objectsTotal)); + const wxString objectsTotal = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(result.objectsTotal)); wxString outputString = _("%x of %y rows in view"); outputString.Replace(wxT("%x"), objectsView, false); @@ -2719,7 +2940,7 @@ void MainDialog::updateGridViewData() statusRightNew += _("1 directory"); else { - wxString folderCount = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.foldersOnRightView)); + wxString folderCount = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(result.foldersOnRightView)); wxString outputString = _("%x directories"); outputString.Replace(wxT("%x"), folderCount, false); @@ -2736,7 +2957,7 @@ void MainDialog::updateGridViewData() statusRightNew += _("1 file,"); else { - wxString fileCount = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.filesOnRightView)); + wxString fileCount = FreeFileSync::includeNumberSeparator(globalFunctions::numberToWxString(result.filesOnRightView)); wxString outputString = _("%x files,"); outputString.Replace(wxT("%x"), fileCount, false); @@ -2762,21 +2983,18 @@ void MainDialog::updateGridViewData() void MainDialog::OnAddFolderPair(wxCommandEvent& event) { - const wxString topPairLeft = m_directoryLeft->GetValue(); - const wxString topPairRight = m_directoryRight->GetValue(); + std::vector<FolderPair> newPairs; + newPairs.push_back(FolderPair(m_directoryLeft ->GetValue().c_str(), + m_directoryRight->GetValue().c_str())); - //clear existing pairs first - m_directoryLeft->SetSelection(wxNOT_FOUND); - m_directoryLeft->SetValue(wxEmptyString); - m_dirPickerLeft->SetPath(wxEmptyString); - m_directoryRight->SetSelection(wxNOT_FOUND); - m_directoryRight->SetValue(wxEmptyString); - m_dirPickerRight->SetPath(wxEmptyString); + addFolderPair(newPairs, true); //add pair in front of additonal pairs - addFolderPair(topPairLeft.c_str(), topPairRight.c_str(), true); //add pair in front of additonal pairs + //clear existing pairs + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryRight, m_dirPickerRight); //disable the sync button - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); //clear grids currentGridData.clear(); @@ -2792,10 +3010,10 @@ void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) { if (eventObj == static_cast<wxObject*>((*i)->m_bpButtonRemovePair)) { - removeFolderPair(i - additionalFolderPairs.begin()); + removeAddFolderPair(i - additionalFolderPairs.begin()); //disable the sync button - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); //clear grids currentGridData.clear(); @@ -2810,16 +3028,16 @@ void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) { if (additionalFolderPairs.size() > 0) { - m_directoryLeft->SetSelection(wxNOT_FOUND); - m_directoryRight->SetSelection(wxNOT_FOUND); + const wxString leftDir = (*additionalFolderPairs.begin())->m_directoryLeft->GetValue().c_str(); + const wxString rightDir = (*additionalFolderPairs.begin())->m_directoryRight->GetValue().c_str(); - m_directoryLeft->SetValue((*additionalFolderPairs.begin())->m_directoryLeft->GetValue()); - m_directoryRight->SetValue((*additionalFolderPairs.begin())->m_directoryRight->GetValue()); + FreeFileSync::setDirectoryName(leftDir, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(rightDir, m_directoryRight, m_dirPickerRight); - removeFolderPair(0); //remove first of additional folder pairs + removeAddFolderPair(0); //remove first of additional folder pairs //disable the sync button - syncPreview->enableSynchronization(false); + syncPreview.enableSynchronization(false); //clear grids currentGridData.clear(); @@ -2828,15 +3046,6 @@ void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) } -void MainDialog::addFolderPair(const Zstring& leftDir, const Zstring& rightDir, bool addFront) -{ - std::vector<FolderPair> newPairs; - newPairs.push_back(FolderPair(leftDir, rightDir)); - - MainDialog::addFolderPair(newPairs, addFront); -} - - void scrollToBottom(wxScrolledWindow* scrWindow) { int height = 0; @@ -2857,11 +3066,17 @@ void scrollToBottom(wxScrolledWindow* scrWindow) } +const size_t MAX_ADD_FOLDER_PAIRS = 5; + + void MainDialog::addFolderPair(const std::vector<FolderPair>& newPairs, bool addFront) { if (newPairs.size() == 0) return; + wxWindowUpdateLocker dummy(this); //avoid display distortion + + int pairHeight = 0; for (std::vector<FolderPair>::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) { //add new folder pair @@ -2869,124 +3084,98 @@ void MainDialog::addFolderPair(const std::vector<FolderPair>& newPairs, bool add newPair->m_bitmap23->SetBitmap(*GlobalResources::getInstance().bitmapLink); newPair->m_bpButtonRemovePair->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); + //set width of left folder panel + const int width = m_panelTopLeft->GetSize().GetWidth(); + newPair->m_panelLeft->SetMinSize(wxSize(width, -1)); + + if (addFront) { - bSizerFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); + bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); } else { - bSizerFolderPairs->Add(newPair, 0, wxEXPAND, 5); + bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); additionalFolderPairs.push_back(newPair); } - //set size of scrolled window - const wxSize pairSize = newPair->GetSize(); - - const int additionalRows = additionalFolderPairs.size(); - if (additionalRows <= 3) //up to 3 additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairSize.GetHeight() * additionalRows)); - else //adjust scrollbars - m_scrolledWindowFolderPairs->Fit(); + //get size of scrolled window + pairHeight = newPair->GetSize().GetHeight(); //register events newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolderPair), NULL, this ); - //insert directory names if provided - newPair->m_directoryLeft->SetValue(i->leftDirectory.c_str()); - const wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(i->leftDirectory).c_str(); - if (wxDirExists(leftDirFormatted)) - newPair->m_dirPickerLeft->SetPath(leftDirFormatted); - - newPair->m_directoryRight->SetValue(i->rightDirectory.c_str()); - const wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(i->rightDirectory).c_str(); - if (wxDirExists(rightDirFormatted)) - newPair->m_dirPickerRight->SetPath(rightDirFormatted); + //insert directory names + FreeFileSync::setDirectoryName(i->leftDirectory.c_str(), newPair->m_directoryLeft, newPair->m_dirPickerLeft); + FreeFileSync::setDirectoryName(i->rightDirectory.c_str(), newPair->m_directoryRight, newPair->m_dirPickerRight); } - //adapt left-shift display distortion caused by scrollbars - if (additionalFolderPairs.size() > 3 && !m_bitmapShift->IsShown()) - { - //m_scrolledWindowFolderPairs and bSizerFolderPairs need to be up to date - m_scrolledWindowFolderPairs->Layout(); - bSizer1->Layout(); - - //calculate scrollbar width - const int shiftToRight = m_scrolledWindowFolderPairs->GetSize().GetWidth() - bSizerFolderPairs->GetSize().GetWidth(); - m_bitmapShift->SetMinSize(wxSize(shiftToRight, -1)); - m_bitmapShift->Show(); - } + //set size of scrolled window + const int visiblePairs = std::min(additionalFolderPairs.size(), MAX_ADD_FOLDER_PAIRS); //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown + m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairHeight * visiblePairs)); //adapt delete top folder pair button - if (additionalFolderPairs.size() > 0) - { - m_bpButtonRemoveTopPair->Show(); - m_panelTopRight->Layout(); - } + m_bpButtonRemoveTopPair->Show(); + m_panelTopRight->Layout(); + + //update controls + m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + bSizer1->Layout(); //scroll to the bottom of wxScrolledWindow //scrollToBottom(m_scrolledWindowFolderPairs); - - m_scrolledWindowFolderPairs->Layout(); - bSizer1->Layout(); - m_bpButtonSwapSides->Refresh(); } -void MainDialog::removeFolderPair(const int pos, bool refreshLayout) +void MainDialog::removeAddFolderPair(const int pos) { + wxWindowUpdateLocker dummy(this); //avoid display distortion + if (0 <= pos && pos < int(additionalFolderPairs.size())) { - wxSize pairSize; //remove folder pairs from window FolderPairPanel* pairToDelete = additionalFolderPairs[pos]; - pairSize = pairToDelete->GetSize(); + const int pairHeight = pairToDelete->GetSize().GetHeight(); - bSizerFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually + bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually pairToDelete->Destroy(); // - additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove last element in vector + additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove element from vector //set size of scrolled window - const int additionalRows = additionalFolderPairs.size(); - if (additionalRows <= 3) //up to 3 additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairSize.GetHeight() * additionalRows)); - //adjust scrollbars (do not put in else clause) - m_scrolledWindowFolderPairs->Fit(); - - //adapt left-shift display distortion caused by scrollbars - if (refreshLayout) - { - if (additionalRows <= 3) - m_bitmapShift->Hide(); - - m_scrolledWindowFolderPairs->Layout(); - bSizer1->Layout(); - } + const size_t additionalRows = additionalFolderPairs.size(); + if (additionalRows <= MAX_ADD_FOLDER_PAIRS) //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown + m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairHeight * additionalRows)); //adapt delete top folder pair button if (additionalFolderPairs.size() == 0) { m_bpButtonRemoveTopPair->Hide(); - if (refreshLayout) - m_panelTopRight->Layout(); + m_panelTopRight->Layout(); } + //update controls + m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + bSizer1->Layout(); } } -void MainDialog::clearFolderPairs() +void MainDialog::clearAddFolderPairs() { - if (additionalFolderPairs.size() > 0) - { - for (int i = int(additionalFolderPairs.size()) - 1; i > 0; --i) - MainDialog::removeFolderPair(i, false); + wxWindowUpdateLocker dummy(this); //avoid display distortion - //refresh layout just once for improved performance! - MainDialog::removeFolderPair(0, true); - } -} + additionalFolderPairs.clear(); + bSizerAddFolderPairs->Clear(true); + + m_bpButtonRemoveTopPair->Hide(); + m_panelTopRight->Layout(); + m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, 0)); + bSizer1->Layout(); +} //######################################################################################################## @@ -3064,11 +3253,11 @@ void MainDialog::OnMenuBatchJob(wxCommandEvent& event) { //fill batch config structure xmlAccess::XmlBatchConfig batchCfg; - batchCfg.mainCfg = cfg; + batchCfg.mainCfg = currentCfg.mainCfg; batchCfg.directoryPairs = getFolderPairs(); batchCfg.silent = false; - if (ignoreErrors) + if (currentCfg.ignoreErrors) batchCfg.handleError = xmlAccess::ON_ERROR_IGNORE; else batchCfg.handleError = xmlAccess::ON_ERROR_POPUP; @@ -3099,6 +3288,11 @@ void MainDialog::OnLayoutWindowAsync(wxIdleEvent& event) //execute just once per startup! Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); + wxWindowUpdateLocker dummy(this); //avoid display distortion + + //adjust folder pair distortion on startup + m_scrolledWindowFolderPairs->Fit(); + Layout(); //strangely this layout call works if called in next idle event only Refresh(); } @@ -3121,13 +3315,13 @@ void MainDialog::OnMenuQuit(wxCommandEvent& event) //language selection void MainDialog::switchProgramLanguage(const int langID) { - programLanguage->setLanguage(langID); //language is a global attribute + CustomLocale::getInstance().setLanguage(langID); //language is a global attribute //create new main window and delete old one cleanUp(); //destructor's code: includes writing settings to HD //create new dialog with respect to new language - MainDialog* frame = new MainDialog(NULL, FreeFileSync::getLastConfigFile(), programLanguage, globalSettings); + MainDialog* frame = new MainDialog(NULL, wxEmptyString, globalSettings); frame->SetIcon(*GlobalResources::getInstance().programIcon); //set application icon frame->Show(); @@ -3145,20 +3339,19 @@ void MainDialog::OnMenuLanguageSwitch(wxCommandEvent& event) //######################################################################################################### - -SyncPreview::SyncPreview(MainDialog* mainDlg) : +MainDialog::SyncPreview::SyncPreview(MainDialog* mainDlg) : mainDlg_(mainDlg), syncPreviewEnabled(false), synchronizationEnabled(false) {} -bool SyncPreview::previewIsEnabled() +bool MainDialog::SyncPreview::previewIsEnabled() const { return syncPreviewEnabled; } -void SyncPreview::enablePreview(bool value) +void MainDialog::SyncPreview::enablePreview(bool value) { if (value) { @@ -3183,7 +3376,7 @@ void SyncPreview::enablePreview(bool value) } -void SyncPreview::enableSynchronization(bool value) +void MainDialog::SyncPreview::enableSynchronization(bool value) { if (value) { @@ -3200,7 +3393,7 @@ void SyncPreview::enableSynchronization(bool value) } -bool SyncPreview::synchronizationIsEnabled() +bool MainDialog::SyncPreview::synchronizationIsEnabled() const { return synchronizationEnabled; } diff --git a/ui/MainDialog.h b/ui/MainDialog.h index e8eae783..b6a49b17 100644 --- a/ui/MainDialog.h +++ b/ui/MainDialog.h @@ -11,7 +11,6 @@ #include "guiGenerated.h" #include <stack> #include "../library/processXml.h" -#include "gridView.h" #include <memory> #include <map> @@ -22,20 +21,21 @@ class FolderPairPanel; class CustomGrid; class FFSCheckRowsEvent; class FFSSyncDirectionEvent; -class SyncPreview; class IconUpdater; +class ManualDeletionHandler; namespace FreeFileSync { class CustomLocale; + class GridView; } class MainDialog : public MainDialogGenerated { friend class CompareStatusHandler; + friend class ManualDeletionHandler; friend class MainFolderDragDrop; - friend class SyncPreview; //IDs for context menu items enum ContextIDRim //context menu for left and right grids @@ -54,7 +54,9 @@ class MainDialog : public MainDialogGenerated enum ContextIDRimLabel//context menu for column settings { CONTEXT_CUSTOMIZE_COLUMN_LEFT, - CONTEXT_CUSTOMIZE_COLUMN_RIGHT + CONTEXT_CUSTOMIZE_COLUMN_RIGHT, + CONTEXT_AUTO_ADJUST_COLUMN_LEFT, + CONTEXT_AUTO_ADJUST_COLUMN_RIGHT }; enum ContextIDMiddle//context menu for middle grid @@ -73,7 +75,6 @@ class MainDialog : public MainDialogGenerated public: MainDialog(wxFrame* frame, const wxString& cfgFileName, - FreeFileSync::CustomLocale* language, xmlAccess::XmlGlobalSettings& settings); ~MainDialog(); @@ -85,6 +86,7 @@ private: bool readConfigurationFromXml(const wxString& filename, bool programStartup = false); bool writeConfigurationToXml(const wxString& filename); xmlAccess::XmlGuiConfig getCurrentConfiguration() const; + static const wxString& lastConfigFileName(); xmlAccess::XmlGuiConfig lastConfigurationSaved; //support for: "Save changed configuration?" dialog @@ -93,16 +95,14 @@ private: void updateViewFilterButtons(); void updateFilterButton(wxBitmapButton* filterButton, bool isActive); - void updateCompareButtons(); void addFileToCfgHistory(const wxString& filename); void addLeftFolderToHistory(const wxString& leftFolder); void addRightFolderToHistory(const wxString& rightFolder); - void addFolderPair(const Zstring& leftDir, const Zstring& rightDir, bool addFront = false); void addFolderPair(const std::vector<FreeFileSync::FolderPair>& newPairs, bool addFront = false); - void removeFolderPair(const int pos, bool refreshLayout = true); //keep it an int, allow negative values! - void clearFolderPairs(); + void removeAddFolderPair(const int pos); //keep it an int, allow negative values! + void clearAddFolderPairs(); //main method for putting gridDataView on UI: updates data respecting current view settings void updateGuiGrid(); @@ -125,6 +125,9 @@ private: void pushStatusInformation(const wxString& text); void clearStatusBar(); + void disableAllElements(); //dis-/enables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion + void enableAllElements(); // + //events void onGridLeftButtonEvent( wxKeyEvent& event); void onGridRightButtonEvent( wxKeyEvent& event); @@ -160,6 +163,10 @@ private: void OnDifferentFiles( wxCommandEvent& event); void OnConflictFiles( wxCommandEvent& event); + void OnSyncCreateLeft( wxCommandEvent& event); + void OnSyncCreateRight( wxCommandEvent& event); + void OnSyncDeleteLeft( wxCommandEvent& event); + void OnSyncDeleteRight( wxCommandEvent& event); void OnSyncDirLeft( wxCommandEvent& event); void OnSyncDirRight( wxCommandEvent& event); void OnSyncDirNone( wxCommandEvent& event); @@ -177,18 +184,16 @@ private: void refreshGridAfterFilterChange(const int delay); - void onResizeMainWindow( wxEvent& event); - void OnAbortCompare( wxCommandEvent& event); + void OnResize( wxSizeEvent& event); + void OnResizeFolderPairs( wxSizeEvent& event); void OnFilterButton( wxCommandEvent& event); void OnHideFilteredButton( wxCommandEvent& event); void OnConfigureFilter( wxHyperlinkEvent& event); - void OnShowHelpDialog( wxCommandEvent& event); void OnSwapSides( wxCommandEvent& event); - void OnCompareByTimeSize( wxCommandEvent& event); - void OnCompareByContent( wxCommandEvent& event); void OnCompare( wxCommandEvent& event); void OnSwitchView( wxCommandEvent& event); void OnSyncSettings( wxCommandEvent& event); + void OnCmpSettings( wxCommandEvent& event); void OnStartSync( wxCommandEvent& event); void OnClose( wxCloseEvent& event); void OnQuit( wxCommandEvent& event); @@ -200,8 +205,6 @@ private: void OnRemoveTopFolderPair( wxCommandEvent& event); //menu events - void OnMenuSaveConfig( wxCommandEvent& event); - void OnMenuLoadConfig( wxCommandEvent& event); void OnMenuGlobalSettings( wxCommandEvent& event); void OnMenuExportFileList( wxCommandEvent& event); void OnMenuBatchJob( wxCommandEvent& event); @@ -226,11 +229,11 @@ private: FreeFileSync::FolderComparison currentGridData; //UI view of currentGridData - FreeFileSync::GridView gridDataView; + std::auto_ptr<FreeFileSync::GridView> gridDataView; //------------------------------------- //functional configuration - FreeFileSync::MainConfiguration cfg; + xmlAccess::XmlGuiConfig currentCfg; //folder pairs: //m_directoryLeft, m_directoryRight @@ -241,8 +244,6 @@ private: int heightNotMaximized; int posXNotMaximized; int posYNotMaximized; - bool hideFilteredElements; - bool ignoreErrors; //------------------------------------- //convenience method to get all folder pairs (unformatted) @@ -252,8 +253,6 @@ private: //*********************************************** std::auto_ptr<wxMenu> contextMenu; - FreeFileSync::CustomLocale* programLanguage; - //status information wxLongLong lastStatusChange; std::stack<wxString> stackObjects; @@ -276,8 +275,6 @@ private: }; std::vector<FilterObject> exFilterCandidateObj; - CompareStatusHandler* cmpStatusHandlerTmp; //used only by the abort button when comparing - bool cleanedUp; //determines if destructor code was already executed //remember last sort executed (for determination of sort order) @@ -294,27 +291,22 @@ private: #endif //encapsulation of handling of sync preview - std::auto_ptr<SyncPreview> syncPreview; -}; - - -class SyncPreview //encapsulates MainDialog functionality for synchronization preview (friend class) -{ - friend class MainDialog; - -public: - void enablePreview(bool value); - bool previewIsEnabled(); + class SyncPreview //encapsulates MainDialog functionality for synchronization preview (friend class) + { + public: + SyncPreview(MainDialog* mainDlg); - void enableSynchronization(bool value); - bool synchronizationIsEnabled(); + void enablePreview(bool value); + bool previewIsEnabled() const; -private: - SyncPreview(MainDialog* mainDlg); + void enableSynchronization(bool value); + bool synchronizationIsEnabled() const; - MainDialog* mainDlg_; - bool syncPreviewEnabled; //toggle to display configuration preview instead of comparison result - bool synchronizationEnabled; //determines whether synchronization should be allowed + private: + MainDialog* mainDlg_; + bool syncPreviewEnabled; //toggle to display configuration preview instead of comparison result + bool synchronizationEnabled; //determines whether synchronization should be allowed + } syncPreview; }; #endif // MAINDIALOG_H diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index 4565e16b..beb2d975 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -1,12 +1,16 @@ #include "smallDialogs.h" -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" #include "../library/resources.h" #include "../algorithm.h" +#include "../synchronization.h" #include <wx/msgdlg.h> #include "../library/customGrid.h" -#include "../library/customButton.h" +#include "../shared/customButton.h" #include "../library/statistics.h" -#include "../library/localization.h" +#include "../shared/localization.h" +#include "../shared/fileHandling.h" +#include "../library/statusHandler.h" +#include <wx/wupdlock.h> using namespace FreeFileSync; @@ -18,12 +22,11 @@ AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) m_bitmap11->SetBitmap(*GlobalResources::getInstance().bitmapLogo); m_bitmap13->SetBitmap(*GlobalResources::getInstance().bitmapGPL); - //create language credits for (std::vector<LocInfoLine>::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) { //flag - wxStaticBitmap* staticBitmapFlag = new wxStaticBitmap(m_scrolledWindowTranslators, wxID_ANY, *i->languageFlag, wxDefaultPosition, wxSize(-1,11), 0 ); + wxStaticBitmap* staticBitmapFlag = new wxStaticBitmap(m_scrolledWindowTranslators, wxID_ANY, GlobalResources::getInstance().getImageByName(i->languageFlag), wxDefaultPosition, wxSize(-1,11), 0 ); fgSizerTranslators->Add(staticBitmapFlag, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); //language name @@ -40,21 +43,19 @@ AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) bSizerTranslators->Fit(m_scrolledWindowTranslators); - //build information wxString build = wxString(wxT("(")) + _("Build:") + wxT(" ") + __TDATE__; #if wxUSE_UNICODE - build+= wxT(" - Unicode)"); + build += wxT(" - Unicode)"); #else - build+= wxT(" - ANSI)"); + build += wxT(" - ANSI)"); #endif //wxUSE_UNICODE m_build->SetLabel(build); m_animationControl1->SetAnimation(*GlobalResources::getInstance().animationMoney); - m_animationControl1->Play(); //Note: The animation is created hidden(!) to not disturb constraint based window creation; - m_animationControl1->Show(); // + m_animationControl1->Play(); - m_button8->SetFocus(); + m_buttonOkay->SetFocus(); Fit(); } @@ -196,13 +197,15 @@ DeleteDialog::DeleteDialog(wxWindow* main, const FreeFileSync::FolderCompRef& rowsOnLeft, const FreeFileSync::FolderCompRef& rowsOnRight, bool& deleteOnBothSides, - bool& useRecycleBin) : + bool& useRecycleBin, + int& totalDeleteCount) : DeleteDlgGenerated(main), m_folderCmp(folderCmp), rowsToDeleteOnLeft(rowsOnLeft), rowsToDeleteOnRight(rowsOnRight), m_deleteOnBothSides(deleteOnBothSides), - m_useRecycleBin(useRecycleBin) + m_useRecycleBin(useRecycleBin), + totalDelCount(totalDeleteCount) { m_checkBoxDeleteBothSides->SetValue(deleteOnBothSides); m_checkBoxUseRecycler->SetValue(useRecycleBin); @@ -231,6 +234,7 @@ void DeleteDialog::updateTexts() assert(m_folderCmp.size() == rowsToDeleteOnRight.size()); wxString filesToDelete; + totalDelCount = 0; for (FolderComparison::const_iterator j = m_folderCmp.begin(); j != m_folderCmp.end(); ++j) { const FileComparison& fileCmp = j->fileCmp; @@ -239,10 +243,13 @@ void DeleteDialog::updateTexts() if ( pairIndex < int(rowsToDeleteOnLeft.size()) && //just to be sure pairIndex < int(rowsToDeleteOnRight.size())) { - filesToDelete += FreeFileSync::deleteFromGridAndHDPreview(fileCmp, - rowsToDeleteOnLeft[pairIndex], - rowsToDeleteOnRight[pairIndex], - m_checkBoxDeleteBothSides->GetValue()); + const std::pair<wxString, int> delInfo = FreeFileSync::deleteFromGridAndHDPreview(fileCmp, + rowsToDeleteOnLeft[pairIndex], + rowsToDeleteOnRight[pairIndex], + m_checkBoxDeleteBothSides->GetValue()); + + filesToDelete += delInfo.first; + totalDelCount += delInfo.second; } } m_textCtrlMessage->SetValue(filesToDelete); @@ -575,14 +582,14 @@ void CustomizeColsDlg::OnMoveDown(wxCommandEvent& event) SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, const wxString& variantName, - const wxString& toCreate, - const wxString& toUpdate, - const wxString& toDelete, - const wxString& data, + const FreeFileSync::SyncStatistics& statistics, bool& dontShowAgain) : SyncPreviewDlgGenerated(parentWindow), m_dontShowAgain(dontShowAgain) { + using FreeFileSync::includeNumberSeparator; + using globalFunctions::numberToWxString; + //m_bitmapPreview->SetBitmap(*GlobalResources::getInstance().bitmapSync); m_buttonStartSync->setBitmapFront(*GlobalResources::getInstance().bitmapStartSync); m_bitmapCreate->SetBitmap(*GlobalResources::getInstance().bitmapCreate); @@ -591,10 +598,15 @@ SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, m_bitmapData->SetBitmap(*GlobalResources::getInstance().bitmapData); m_staticTextVariant->SetLabel(variantName); - m_textCtrlCreate->SetValue(toCreate); - m_textCtrlUpdate->SetValue(toUpdate); - m_textCtrlDelete->SetValue(toDelete); - m_textCtrlData->SetValue(data); + m_textCtrlData->SetValue(FreeFileSync::formatFilesizeToShortString(statistics.getDataToProcess())); + + m_textCtrlCreateL->SetValue(includeNumberSeparator(numberToWxString(statistics.getCreate( true, false)))); + m_textCtrlUpdateL->SetValue(includeNumberSeparator(numberToWxString(statistics.getOverwrite(true, false)))); + m_textCtrlDeleteL->SetValue(includeNumberSeparator(numberToWxString(statistics.getDelete( true, false)))); + + m_textCtrlCreateR->SetValue(includeNumberSeparator(numberToWxString(statistics.getCreate( false, true)))); + m_textCtrlUpdateR->SetValue(includeNumberSeparator(numberToWxString(statistics.getOverwrite(false, true)))); + m_textCtrlDeleteR->SetValue(includeNumberSeparator(numberToWxString(statistics.getDelete( false, true)))); m_checkBoxDontShowAgain->SetValue(dontShowAgain); @@ -622,6 +634,60 @@ void SyncPreviewDlg::OnStartSync(wxCommandEvent& event) } +//######################################################################################## + +CompareCfgDialog::CompareCfgDialog(wxWindow* parentWindow, CompareVariant& cmpVar) : + CmpCfgDlgGenerated(parentWindow), + m_cmpVar(cmpVar) +{ + m_bpButtonHelp->SetBitmapLabel(*GlobalResources::getInstance().bitmapHelp); + + switch (cmpVar) + { + case CMP_BY_TIME_SIZE: + m_radioBtnSizeDate->SetValue(true); + m_buttonContent->SetFocus(); //set focus on the other button + break; + case CMP_BY_CONTENT: + m_radioBtnContent->SetValue(true); + m_buttonTimeSize->SetFocus(); //set focus on the other button + break; + } +} + + +void CompareCfgDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void CompareCfgDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void CompareCfgDialog::OnTimeSize(wxCommandEvent& event) +{ + m_cmpVar = CMP_BY_TIME_SIZE; + EndModal(BUTTON_OKAY); +} + + +void CompareCfgDialog::OnContent(wxCommandEvent& event) +{ + m_cmpVar = CMP_BY_CONTENT; + EndModal(BUTTON_OKAY); +} + + +void CompareCfgDialog::OnShowHelp(wxCommandEvent& event) +{ + HelpDlg* helpDlg = new HelpDlg(this); + helpDlg->ShowModal(); +} + //######################################################################################## GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings) : @@ -634,7 +700,18 @@ GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSetti m_spinCtrlFileTimeTolerance->SetValue(globalSettings.fileTimeTolerance); m_checkBoxIgnoreOneHour->SetValue(globalSettings.ignoreOneHourDiff); - m_textCtrlFileManager->SetValue(globalSettings.gui.commandLineFileManager); + m_textCtrlCommand->SetValue(globalSettings.gui.commandLineFileManager); + + const wxString toolTip = wxString(_("This commandline will be executed on each doubleclick. The following macros are available:")) + wxT("\n\n") + + wxT("%name \t") + _("- full file or directory name") + wxT("\n") + + wxT("%dir \t") + _("- directory part only") + wxT("\n") + + wxT("%nameCo \t") + _("- sibling of %name") + wxT("\n") + + wxT("%dirCo \t") + _("- sibling of %dir"); + + m_staticTextCommand->SetToolTip(toolTip); + m_textCtrlCommand->SetToolTip(toolTip); + + m_buttonOkay->SetFocus(); Fit(); } @@ -646,7 +723,7 @@ void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) settings.fileTimeTolerance = m_spinCtrlFileTimeTolerance->GetValue(); settings.ignoreOneHourDiff = m_checkBoxIgnoreOneHour->GetValue(); - settings.gui.commandLineFileManager = m_textCtrlFileManager->GetValue(); + settings.gui.commandLineFileManager = m_textCtrlCommand->GetValue(); EndModal(BUTTON_OKAY); } @@ -665,9 +742,9 @@ void GlobalSettingsDlg::OnDefault(wxCommandEvent& event) m_spinCtrlFileTimeTolerance->SetValue(2); m_checkBoxIgnoreOneHour->SetValue(true); #ifdef FFS_WIN - m_textCtrlFileManager->SetValue(wxT("explorer /select, %name")); + m_textCtrlCommand->SetValue(wxT("explorer /select, %name")); #elif defined FFS_LINUX - m_textCtrlFileManager->SetValue(wxT("konqueror \"%path\"")); + m_textCtrlCommand->SetValue(wxT("konqueror \"%dir\"")); #endif } @@ -713,7 +790,8 @@ void CompareStatus::init() m_gauge2->Hide(); bSizer42->Layout(); - scannedObjects = 0; + scannedObjects = 0; + currentStatusText.clear(); totalObjects = 0; totalData = 0; @@ -777,71 +855,73 @@ void CompareStatus::updateStatusPanelNow() { //static RetrieveStatistics statistic; //statistic.writeEntry(currentData, currentObjects); + { + wxWindowUpdateLocker dummy(this); //reduce display distortion - bool screenChanged = false; //avoid screen flicker by calling layout() only if necessary + bool screenChanged = false; //avoid screen flicker by calling layout() only if necessary - //remove linebreaks from currentStatusText - wxString formattedStatusText = currentStatusText.c_str(); - for (wxString::iterator i = formattedStatusText.begin(); i != formattedStatusText.end(); ++i) - if (*i == wxChar('\n')) - *i = wxChar(' '); + //remove linebreaks from currentStatusText + wxString formattedStatusText = currentStatusText.c_str(); + for (wxString::iterator i = formattedStatusText.begin(); i != formattedStatusText.end(); ++i) + if (*i == wxChar('\n')) + *i = wxChar(' '); - //status texts - if (m_textCtrlFilename->GetValue() != formattedStatusText && (screenChanged = true)) //avoid screen flicker - m_textCtrlFilename->SetValue(formattedStatusText); + //status texts + if (m_textCtrlStatus->GetValue() != formattedStatusText && (screenChanged = true)) //avoid screen flicker + m_textCtrlStatus->SetValue(formattedStatusText); - //nr of scanned objects - const wxString scannedObjTmp = globalFunctions::numberToWxString(scannedObjects); - if (m_staticTextScanned->GetLabel() != scannedObjTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextScanned->SetLabel(scannedObjTmp); + //nr of scanned objects + const wxString scannedObjTmp = globalFunctions::numberToWxString(scannedObjects); + if (m_staticTextScanned->GetLabel() != scannedObjTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextScanned->SetLabel(scannedObjTmp); - //progress indicator for "compare file content" - m_gauge2->SetValue(int(currentData.ToDouble() * scalingFactor)); + //progress indicator for "compare file content" + m_gauge2->SetValue(int(currentData.ToDouble() * scalingFactor)); - //remaining files left for file comparison - const wxString filesToCompareTmp = globalFunctions::numberToWxString(totalObjects - currentObjects); - if (m_staticTextFilesRemaining->GetLabel() != filesToCompareTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextFilesRemaining->SetLabel(filesToCompareTmp); + //remaining files left for file comparison + const wxString filesToCompareTmp = globalFunctions::numberToWxString(totalObjects - currentObjects); + if (m_staticTextFilesRemaining->GetLabel() != filesToCompareTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextFilesRemaining->SetLabel(filesToCompareTmp); - //remaining bytes left for file comparison - const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); - if (m_staticTextDataRemaining->GetLabel() != remainingBytesTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextDataRemaining->SetLabel(remainingBytesTmp); + //remaining bytes left for file comparison + const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); + if (m_staticTextDataRemaining->GetLabel() != remainingBytesTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextDataRemaining->SetLabel(remainingBytesTmp); - if (statistics.get()) - { - if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + if (statistics.get()) { - lastStatCallSpeed = timeElapsed.Time(); + if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + { + lastStatCallSpeed = timeElapsed.Time(); - statistics->addMeasurement(currentObjects, currentData.ToDouble()); + statistics->addMeasurement(currentObjects, currentData.ToDouble()); - //current speed - const wxString speedTmp = statistics->getBytesPerSecond(); - if (m_staticTextSpeed->GetLabel() != speedTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextSpeed->SetLabel(speedTmp); + //current speed + const wxString speedTmp = statistics->getBytesPerSecond(); + if (m_staticTextSpeed->GetLabel() != speedTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextSpeed->SetLabel(speedTmp); - if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only - { - lastStatCallRemTime = timeElapsed.Time(); + if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only + { + lastStatCallRemTime = timeElapsed.Time(); - //remaining time - const wxString timeRemainingTmp = statistics->getRemainingTime(); - if (m_staticTextTimeRemaining->GetLabel() != timeRemainingTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextTimeRemaining->SetLabel(timeRemainingTmp); + //remaining time + const wxString timeRemainingTmp = statistics->getRemainingTime(); + if (m_staticTextTimeRemaining->GetLabel() != timeRemainingTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextTimeRemaining->SetLabel(timeRemainingTmp); + } } } - } - //time elapsed - const wxString timeElapsedTmp = (wxTimeSpan::Milliseconds(timeElapsed.Time())).Format(); - if (m_staticTextTimeElapsed->GetLabel() != timeElapsedTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextTimeElapsed->SetLabel(timeElapsedTmp); - - //do the ui update - if (screenChanged) - bSizer42->Layout(); + //time elapsed + const wxString timeElapsedTmp = (wxTimeSpan::Milliseconds(timeElapsed.Time())).Format(); + if (m_staticTextTimeElapsed->GetLabel() != timeElapsedTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextTimeElapsed->SetLabel(timeElapsedTmp); + //do the ui update + if (screenChanged) + bSizer42->Layout(); + } updateUiNow(); } @@ -924,79 +1004,79 @@ void SyncStatus::setStatusText_NoUpdate(const Zstring& text) } -void SyncStatus::updateStatusDialogNow(bool flushWindowMessages) +void SyncStatus::updateStatusDialogNow() { //static RetrieveStatistics statistic; //statistic.writeEntry(currentData, currentObjects); + { + wxWindowUpdateLocker dummy(this); //reduce display distortion + bool screenChanged = false; //avoid screen flicker by calling layout() only if necessary - bool screenChanged = false; //avoid screen flicker by calling layout() only if necessary - - //progress indicator - m_gauge1->SetValue(globalFunctions::round(currentData.ToDouble() * scalingFactor)); + //progress indicator + m_gauge1->SetValue(globalFunctions::round(currentData.ToDouble() * scalingFactor)); - //status text - if (m_textCtrlInfo->GetValue() != wxString(currentStatusText.c_str()) && (screenChanged = true)) //avoid screen flicker - m_textCtrlInfo->SetValue(currentStatusText.c_str()); + //status text + if (m_textCtrlInfo->GetValue() != wxString(currentStatusText.c_str()) && (screenChanged = true)) //avoid screen flicker + m_textCtrlInfo->SetValue(currentStatusText.c_str()); - //remaining objects - const wxString remainingObjTmp = globalFunctions::numberToWxString(totalObjects - currentObjects); - if (m_staticTextRemainingObj->GetLabel() != remainingObjTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextRemainingObj->SetLabel(remainingObjTmp); + //remaining objects + const wxString remainingObjTmp = globalFunctions::numberToWxString(totalObjects - currentObjects); + if (m_staticTextRemainingObj->GetLabel() != remainingObjTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextRemainingObj->SetLabel(remainingObjTmp); - //remaining bytes left for copy - const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); - if (m_staticTextDataRemaining->GetLabel() != remainingBytesTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextDataRemaining->SetLabel(remainingBytesTmp); + //remaining bytes left for copy + const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); + if (m_staticTextDataRemaining->GetLabel() != remainingBytesTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextDataRemaining->SetLabel(remainingBytesTmp); - if (statistics.get()) - { - if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + if (statistics.get()) { - lastStatCallSpeed = timeElapsed.Time(); + if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + { + lastStatCallSpeed = timeElapsed.Time(); - statistics->addMeasurement(currentObjects, currentData.ToDouble()); + statistics->addMeasurement(currentObjects, currentData.ToDouble()); - //current speed - const wxString speedTmp = statistics->getBytesPerSecond(); - if (m_staticTextSpeed->GetLabel() != speedTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextSpeed->SetLabel(speedTmp); + //current speed + const wxString speedTmp = statistics->getBytesPerSecond(); + if (m_staticTextSpeed->GetLabel() != speedTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextSpeed->SetLabel(speedTmp); - if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only - { - lastStatCallRemTime = timeElapsed.Time(); + if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only + { + lastStatCallRemTime = timeElapsed.Time(); - //remaining time - const wxString timeRemainingTmp = statistics->getRemainingTime(); - if (m_staticTextTimeRemaining->GetLabel() != timeRemainingTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextTimeRemaining->SetLabel(timeRemainingTmp); + //remaining time + const wxString timeRemainingTmp = statistics->getRemainingTime(); + if (m_staticTextTimeRemaining->GetLabel() != timeRemainingTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextTimeRemaining->SetLabel(timeRemainingTmp); + } } } - } - //time elapsed - const wxString timeElapsedTmp = (wxTimeSpan::Milliseconds(timeElapsed.Time())).Format(); - if (m_staticTextTimeElapsed->GetLabel() != timeElapsedTmp && (screenChanged = true)) //avoid screen flicker - m_staticTextTimeElapsed->SetLabel(timeElapsedTmp); + //time elapsed + const wxString timeElapsedTmp = (wxTimeSpan::Milliseconds(timeElapsed.Time())).Format(); + if (m_staticTextTimeElapsed->GetLabel() != timeElapsedTmp && (screenChanged = true)) //avoid screen flicker + m_staticTextTimeElapsed->SetLabel(timeElapsedTmp); - //do the ui update - if (screenChanged) - { - bSizer28->Layout(); - bSizer31->Layout(); + //do the ui update + if (screenChanged) + { + bSizer28->Layout(); + bSizer31->Layout(); + } } - if (flushWindowMessages) - updateUiNow(); + updateUiNow(); //support for pause button while (processPaused && currentProcessIsRunning) { wxMilliSleep(UI_UPDATE_INTERVAL); - if (flushWindowMessages) - updateUiNow(); + updateUiNow(); } } @@ -1065,11 +1145,8 @@ void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in bSizerSpeed->Show(false); bSizerRemTime->Show(false); - //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between - //gridDataView and currentGridData!! avoid grid repaint at all costs!! - - updateStatusDialogNow(false); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed - Layout(); // + updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed + Layout(); // } diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index da627e82..f5ea53df 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -2,13 +2,18 @@ #define SMALLDIALOGS_H_INCLUDED #include "../structures.h" -#include "../library/statusHandler.h" #include "../library/processXml.h" #include "guiGenerated.h" #include <wx/stopwatch.h> #include <memory> class Statistics; +class StatusHandler; + +namespace FreeFileSync +{ + class SyncStatistics; +} class AboutDlg : public AboutDlgGenerated @@ -66,7 +71,8 @@ public: const FreeFileSync::FolderCompRef& rowsOnLeft, const FreeFileSync::FolderCompRef& rowsOnRight, bool& deleteOnBothSides, - bool& useRecycleBin); + bool& useRecycleBin, + int& totalDeleteCount); ~DeleteDialog() {} @@ -90,6 +96,7 @@ private: const FreeFileSync::FolderCompRef& rowsToDeleteOnRight; bool& m_deleteOnBothSides; bool& m_useRecycleBin; + int& totalDelCount; }; @@ -99,7 +106,7 @@ public: ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxString messageText, bool& ignoreNextErrors); ~ErrorDlg(); - enum + enum ReturnCodes { BUTTON_IGNORE = 1, BUTTON_RETRY = 2, @@ -122,7 +129,7 @@ public: WarningDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool& dontShowAgain); ~WarningDlg(); - enum + enum Response { BUTTON_IGNORE = 1, BUTTON_ABORT = 2 @@ -190,10 +197,7 @@ class SyncPreviewDlg : public SyncPreviewDlgGenerated public: SyncPreviewDlg(wxWindow* parentWindow, const wxString& variantName, - const wxString& toCreate, - const wxString& toUpdate, - const wxString& toDelete, - const wxString& data, + const FreeFileSync::SyncStatistics& statistics, bool& dontShowAgain); enum @@ -211,6 +215,27 @@ private: }; +class CompareCfgDialog : public CmpCfgDlgGenerated +{ +public: + CompareCfgDialog(wxWindow* parentWindow, FreeFileSync::CompareVariant& cmpVar); + + enum + { + BUTTON_OKAY = 10 + }; + +private: + void OnClose(wxCloseEvent& event); + void OnCancel(wxCommandEvent& event); + void OnTimeSize(wxCommandEvent& event); + void OnContent(wxCommandEvent& event); + void OnShowHelp(wxCommandEvent& event); + + FreeFileSync::CompareVariant& m_cmpVar; +}; + + class GlobalSettingsDlg : public GlobalSettingsDlgGenerated { public: @@ -287,7 +312,7 @@ public: void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); void setStatusText_NoUpdate(const Zstring& text); - void updateStatusDialogNow(bool flushWindowMessages = true); + void updateStatusDialogNow(); void setCurrentStatus(SyncStatusID id); void processHasFinished(SyncStatusID id); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp index 58abc753..3172a548 100644 --- a/ui/SyncDialog.cpp +++ b/ui/SyncDialog.cpp @@ -1,31 +1,37 @@ #include "syncDialog.h" -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" #include "../library/resources.h" #include <wx/msgdlg.h> -#include <wx/stdpaths.h> -#include <wx/ffile.h> -#include "../library/customButton.h" +#include "../shared/customButton.h" #include "../synchronization.h" #include "../algorithm.h" #include <wx/dnd.h> -#include "dragAndDrop.h" +#include "../shared/dragAndDrop.h" +#include "../shared/fileHandling.h" +#include "../shared/xmlBase.h" +#include <wx/wupdlock.h> using namespace FreeFileSync; -SyncDialog::SyncDialog(wxWindow* window, - const FolderComparison& folderCmpRef, - MainConfiguration& config, - bool& ignoreErrors) : - SyncDlgGenerated(window), +SyncCfgDialog::SyncCfgDialog(wxWindow* window, + const FolderComparison& folderCmpRef, + MainConfiguration& config, + bool& ignoreErrors) : + SyncCfgDlgGenerated(window), folderCmp(folderCmpRef), cfg(config), - m_ignoreErrors(ignoreErrors) + m_ignoreErrors(ignoreErrors), + dragDropCustomDelFolder(new DragDropOnDlg(m_panelCustomDeletionDir, m_dirPickerCustomDelFolder, m_textCtrlCustomDelFolder)) { //make working copy of mainDialog.cfg.syncConfiguration and recycler setting localSyncConfiguration = config.syncConfiguration; - m_checkBoxUseRecycler->SetValue(cfg.useRecycleBin); - m_checkBoxIgnoreErrors->SetValue(m_ignoreErrors); + + setDeletionHandling(cfg.handleDeletion); + m_textCtrlCustomDelFolder->SetValue(cfg.customDeletionDirectory); + + //error handling + setErrorHandling(m_ignoreErrors); //set sync config icons updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -43,28 +49,30 @@ SyncDialog::SyncDialog(wxWindow* window, switch (localSyncConfiguration.getVariant()) { case SyncConfiguration::MIRROR: - m_radioBtn1->SetValue(true); //one way -> + m_radioBtn1->SetValue(true); //one way -> break; case SyncConfiguration::UPDATE: - m_radioBtnUpdate->SetValue(true); //Update -> + m_radioBtnUpdate->SetValue(true); //Update -> break; case SyncConfiguration::TWOWAY: - m_radioBtn2->SetValue(true); //two way <-> + m_radioBtn2->SetValue(true); //two way <-> break; case SyncConfiguration::CUSTOM: - m_radioBtn3->SetValue(true); //other + m_radioBtn3->SetValue(true); //other break; } + m_buttonApply->SetFocus(); + Fit(); } //################################################################################################################# -SyncDialog::~SyncDialog() {} +SyncCfgDialog::~SyncCfgDialog() {} -void SyncDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) +void SyncCfgDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) { updateConfigIcons(cmpVar, syncConfig, @@ -81,18 +89,18 @@ void SyncDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, co } -void SyncDialog::updateConfigIcons(const CompareVariant compareVar, - const SyncConfiguration& syncConfig, - wxBitmapButton* buttonLeftOnly, - wxBitmapButton* buttonRightOnly, - wxBitmapButton* buttonLeftNewer, - wxBitmapButton* buttonRightNewer, - wxBitmapButton* buttonDifferent, - wxStaticBitmap* bitmapLeftOnly, - wxStaticBitmap* bitmapRightOnly, - wxStaticBitmap* bitmapLeftNewer, - wxStaticBitmap* bitmapRightNewer, - wxStaticBitmap* bitmapDifferent) +void SyncCfgDialog::updateConfigIcons(const CompareVariant compareVar, + const SyncConfiguration& syncConfig, + wxBitmapButton* buttonLeftOnly, + wxBitmapButton* buttonRightOnly, + wxBitmapButton* buttonLeftNewer, + wxBitmapButton* buttonRightNewer, + wxBitmapButton* buttonDifferent, + wxStaticBitmap* bitmapLeftOnly, + wxStaticBitmap* bitmapRightOnly, + wxStaticBitmap* bitmapLeftNewer, + wxStaticBitmap* bitmapRightNewer, + wxStaticBitmap* bitmapDifferent) { //display only relevant sync options switch (compareVar) @@ -127,125 +135,234 @@ void SyncDialog::updateConfigIcons(const CompareVariant compareVar, } - if (syncConfig.exLeftSideOnly == SYNC_DIR_RIGHT) + switch (syncConfig.exLeftSideOnly) { + case SYNC_DIR_RIGHT: buttonLeftOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowRightCr); buttonLeftOnly->SetToolTip(_("Copy from left to right")); - } - else if (syncConfig.exLeftSideOnly == SYNC_DIR_LEFT) - { + break; + case SYNC_DIR_LEFT: buttonLeftOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapDeleteLeft); buttonLeftOnly->SetToolTip(_("Delete files/folders existing on left side only")); - } - else if (syncConfig.exLeftSideOnly == SYNC_DIR_NONE) - { + break; + case SYNC_DIR_NONE: buttonLeftOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowNone); buttonLeftOnly->SetToolTip(_("Do nothing")); + break; } - if (syncConfig.exRightSideOnly == SYNC_DIR_RIGHT) + switch (syncConfig.exRightSideOnly) { + case SYNC_DIR_RIGHT: buttonRightOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapDeleteRight); buttonRightOnly->SetToolTip(_("Delete files/folders existing on right side only")); - } - else if (syncConfig.exRightSideOnly == SYNC_DIR_LEFT) - { + break; + case SYNC_DIR_LEFT: buttonRightOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowLeftCr); buttonRightOnly->SetToolTip(_("Copy from right to left")); - } - else if (syncConfig.exRightSideOnly == SYNC_DIR_NONE) - { + break; + case SYNC_DIR_NONE: buttonRightOnly->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowNone); buttonRightOnly->SetToolTip(_("Do nothing")); + break; } - if (syncConfig.leftNewer == SYNC_DIR_RIGHT) + switch (syncConfig.leftNewer) { + case SYNC_DIR_RIGHT: buttonLeftNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowRight); buttonLeftNewer->SetToolTip(_("Copy from left to right overwriting")); - } - else if (syncConfig.leftNewer == SYNC_DIR_LEFT) - { + break; + case SYNC_DIR_LEFT: buttonLeftNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowLeft); buttonLeftNewer->SetToolTip(_("Copy from right to left overwriting")); - } - else if (syncConfig.leftNewer == SYNC_DIR_NONE) - { + break; + case SYNC_DIR_NONE: buttonLeftNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowNone); buttonLeftNewer->SetToolTip(_("Do nothing")); + break; } - if (syncConfig.rightNewer == SYNC_DIR_RIGHT) + switch (syncConfig.rightNewer) { + case SYNC_DIR_RIGHT: buttonRightNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowRight); buttonRightNewer->SetToolTip(_("Copy from left to right overwriting")); - } - else if (syncConfig.rightNewer == SYNC_DIR_LEFT) - { + break; + case SYNC_DIR_LEFT: buttonRightNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowLeft); buttonRightNewer->SetToolTip(_("Copy from right to left overwriting")); - } - else if (syncConfig.rightNewer == SYNC_DIR_NONE) - { + break; + case SYNC_DIR_NONE: buttonRightNewer->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowNone); buttonRightNewer->SetToolTip(_("Do nothing")); + break; } - if (syncConfig.different == SYNC_DIR_RIGHT) + switch (syncConfig.different) { + case SYNC_DIR_RIGHT: buttonDifferent->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowRight); buttonDifferent->SetToolTip(_("Copy from left to right overwriting")); - } - else if (syncConfig.different == SYNC_DIR_LEFT) - { + break; + case SYNC_DIR_LEFT: buttonDifferent->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowLeft); buttonDifferent->SetToolTip(_("Copy from right to left overwriting")); - } - else if (syncConfig.different == SYNC_DIR_NONE) - { + break; + case SYNC_DIR_NONE: buttonDifferent->SetBitmapLabel(*GlobalResources::getInstance().bitmapArrowNone); buttonDifferent->SetToolTip(_("Do nothing")); + break; } } -void SyncDialog::OnClose(wxCloseEvent& event) +void SyncCfgDialog::OnClose(wxCloseEvent& event) { EndModal(0); } -void SyncDialog::OnCancel(wxCommandEvent& event) +void SyncCfgDialog::OnCancel(wxCommandEvent& event) { EndModal(0); } -void SyncDialog::OnApply(wxCommandEvent& event) +void SyncCfgDialog::OnApply(wxCommandEvent& event) { //write configuration to main dialog cfg.syncConfiguration = localSyncConfiguration; - cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); - m_ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); + cfg.handleDeletion = getDeletionHandling(); + cfg.customDeletionDirectory = m_textCtrlCustomDelFolder->GetValue(); + + m_ignoreErrors = getErrorHandling(); EndModal(BUTTON_OKAY); } -void SyncDialog::OnSelectRecycleBin(wxCommandEvent& event) +void updateToolTipErrorHandling(wxChoice* choiceHandleError, const xmlAccess::OnError value) { - if (event.IsChecked()) + switch (value) { - if (!FreeFileSync::recycleBinExists()) - { - wxMessageBox(_("It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :)"), _("Error") , wxOK | wxICON_ERROR); - m_checkBoxUseRecycler->SetValue(false); - } + case xmlAccess::ON_ERROR_POPUP: + choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); + break; + case xmlAccess::ON_ERROR_IGNORE: + choiceHandleError->SetToolTip(_("Hide all error and warning messages")); + break; + case xmlAccess::ON_ERROR_EXIT: + choiceHandleError->SetToolTip(_("Exit immediately and set returncode < 0")); + break; + default: + assert(false); + choiceHandleError->SetToolTip(wxEmptyString); + } +} + + +bool SyncCfgDialog::getErrorHandling() +{ + if (m_choiceHandleError->GetSelection() == 1) //Ignore errors + return true; + else + return false; // Show popup +} + + +void SyncCfgDialog::setErrorHandling(bool ignoreErrors) +{ + m_choiceHandleError->Clear(); + m_choiceHandleError->Append(_("Show popup")); + m_choiceHandleError->Append(_("Ignore errors")); + + if (ignoreErrors) + m_choiceHandleError->SetSelection(1); + else + m_choiceHandleError->SetSelection(0); + + updateToolTipErrorHandling(m_choiceHandleError, ignoreErrors ? xmlAccess::ON_ERROR_IGNORE : xmlAccess::ON_ERROR_POPUP); +} + + +void SyncCfgDialog::OnChangeErrorHandling(wxCommandEvent& event) +{ + updateToolTipErrorHandling(m_choiceHandleError, getErrorHandling() ? xmlAccess::ON_ERROR_IGNORE : xmlAccess::ON_ERROR_POPUP); +} + +//------------------- + +void updateToolTipDeletionHandling(wxChoice* choiceHandleError, wxPanel* customDir, const FreeFileSync::DeletionPolicy value) +{ + customDir->Disable(); + + switch (value) + { + case FreeFileSync::DELETE_PERMANENTLY: + choiceHandleError->SetToolTip(_("Delete or overwrite files permanently.")); + break; + + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + choiceHandleError->SetToolTip(_("Use Recycle Bin when deleting or overwriting files.")); + break; + + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + choiceHandleError->SetToolTip(_("Move files to a custom directory.")); + customDir->Enable(); + break; + } +} + + +FreeFileSync::DeletionPolicy SyncCfgDialog::getDeletionHandling() +{ + switch (m_choiceHandleDeletion->GetSelection()) + { + case 0: + return FreeFileSync::DELETE_PERMANENTLY; + case 1: + return FreeFileSync::MOVE_TO_RECYCLE_BIN; + case 2: + return FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY; + default: + assert(false); + return FreeFileSync::MOVE_TO_RECYCLE_BIN; + } +} + + +void SyncCfgDialog::setDeletionHandling(FreeFileSync::DeletionPolicy newValue) +{ + m_choiceHandleDeletion->Clear(); + m_choiceHandleDeletion->Append(_("Delete permanently")); + m_choiceHandleDeletion->Append(_("Use Recycle Bin")); + m_choiceHandleDeletion->Append(_("Move to custom directory")); + + switch (newValue) + { + case FreeFileSync::DELETE_PERMANENTLY: + m_choiceHandleDeletion->SetSelection(0); + break; + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + m_choiceHandleDeletion->SetSelection(1); + break; + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + m_choiceHandleDeletion->SetSelection(2); + break; } + + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, newValue); } -void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) +void SyncCfgDialog::OnChangeDeletionHandling(wxCommandEvent& event) +{ + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, getDeletionHandling()); +} + + +void SyncCfgDialog::OnSyncLeftToRight(wxCommandEvent& event) { localSyncConfiguration.setVariant(SyncConfiguration::MIRROR); @@ -256,7 +373,7 @@ void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) } -void SyncDialog::OnSyncUpdate(wxCommandEvent& event) +void SyncCfgDialog::OnSyncUpdate(wxCommandEvent& event) { localSyncConfiguration.setVariant(SyncConfiguration::UPDATE); @@ -267,7 +384,7 @@ void SyncDialog::OnSyncUpdate(wxCommandEvent& event) } -void SyncDialog::OnSyncBothSides(wxCommandEvent& event) +void SyncCfgDialog::OnSyncBothSides(wxCommandEvent& event) { localSyncConfiguration.setVariant(SyncConfiguration::TWOWAY); @@ -278,20 +395,24 @@ void SyncDialog::OnSyncBothSides(wxCommandEvent& event) } -void toggleSyncDirection(SyncDirection& current) +void toggleSyncDirection(SyncDirectionCfg& current) { - if (current == SYNC_DIR_RIGHT) - current = SYNC_DIR_LEFT; - else if (current == SYNC_DIR_LEFT) - current = SYNC_DIR_NONE; - else if (current== SYNC_DIR_NONE) - current = SYNC_DIR_RIGHT; - else - assert (false); + switch (current) + { + case SYNC_DIR_CFG_RIGHT: + current = SYNC_DIR_CFG_LEFT; + break; + case SYNC_DIR_CFG_LEFT: + current = SYNC_DIR_CFG_NONE; + break; + case SYNC_DIR_CFG_NONE: + current = SYNC_DIR_CFG_RIGHT; + break; + } } -void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) +void SyncCfgDialog::OnExLeftSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -300,7 +421,7 @@ void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) } -void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) +void SyncCfgDialog::OnExRightSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -309,7 +430,7 @@ void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) } -void SyncDialog::OnLeftNewer( wxCommandEvent& event ) +void SyncCfgDialog::OnLeftNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.leftNewer); updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -318,7 +439,7 @@ void SyncDialog::OnLeftNewer( wxCommandEvent& event ) } -void SyncDialog::OnRightNewer( wxCommandEvent& event ) +void SyncCfgDialog::OnRightNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.rightNewer); updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -327,7 +448,7 @@ void SyncDialog::OnRightNewer( wxCommandEvent& event ) } -void SyncDialog::OnDifferent( wxCommandEvent& event ) +void SyncCfgDialog::OnDifferent( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.different); updateConfigIcons(cfg.compareVar, localSyncConfiguration); @@ -406,10 +527,18 @@ void BatchDialog::init() { //prepare drag & drop for loading of *.ffs_batch files SetDropTarget(new BatchFileDropEvent(this)); - dragDropOnLogfileDir.reset(new DragDropOnDlg(m_panelLogging, m_dirPickerLogfileDir, m_textCtrlLogfileDir)); + //support for drag and drop on main pair + dragDropOnLeft.reset( new DragDropOnDlg(m_panelLeft, m_dirPickerLeft, m_directoryLeft)); + dragDropOnRight.reset(new DragDropOnDlg(m_panelRight, m_dirPickerRight, m_directoryRight)); + + dragDropCustomDelFolder.reset(new DragDropOnDlg(m_panelCustomDeletionDir, m_dirPickerCustomDelFolder, m_textCtrlCustomDelFolder)); + + //set icons for this dialog + m_bpButtonAddPair->SetBitmapLabel(*GlobalResources::getInstance().bitmapAddFolderPair); + m_bpButtonRemoveTopPair->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); m_bitmapLeftOnly->SetBitmap(*GlobalResources::getInstance().bitmapLeftOnly); m_bitmapRightOnly->SetBitmap(*GlobalResources::getInstance().bitmapRightOnly); m_bitmapLeftNewer->SetBitmap(*GlobalResources::getInstance().bitmapLeftNewer); @@ -418,8 +547,11 @@ void BatchDialog::init() m_bitmap8->SetBitmap(*GlobalResources::getInstance().bitmapInclude); m_bitmap9->SetBitmap(*GlobalResources::getInstance().bitmapExclude); m_bitmap27->SetBitmap(*GlobalResources::getInstance().bitmapBatch); + + m_buttonSave->SetFocus(); } +//------------------- error handling -------------------------- xmlAccess::OnError BatchDialog::getSelectionHandleError() { @@ -438,26 +570,6 @@ xmlAccess::OnError BatchDialog::getSelectionHandleError() } -void updateToolTip(wxChoice* choiceHandleError, const xmlAccess::OnError value) -{ - switch (value) - { - case xmlAccess::ON_ERROR_POPUP: - choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); - break; - case xmlAccess::ON_ERROR_IGNORE: - choiceHandleError->SetToolTip(_("Hide all error and warning messages")); - break; - case xmlAccess::ON_ERROR_EXIT: - choiceHandleError->SetToolTip(_("Exit immediately and set returncode < 0")); - break; - default: - assert(false); - choiceHandleError->SetToolTip(wxEmptyString); - } -} - - void BatchDialog::setSelectionHandleError(const xmlAccess::OnError value) { m_choiceHandleError->Clear(); @@ -481,13 +593,13 @@ void BatchDialog::setSelectionHandleError(const xmlAccess::OnError value) m_choiceHandleError->SetSelection(0); } - updateToolTip(m_choiceHandleError, getSelectionHandleError()); + updateToolTipErrorHandling(m_choiceHandleError, getSelectionHandleError()); } void BatchDialog::OnChangeErrorHandling(wxCommandEvent& event) { - updateToolTip(m_choiceHandleError, getSelectionHandleError()); + updateToolTipErrorHandling(m_choiceHandleError, getSelectionHandleError()); } @@ -498,6 +610,56 @@ void BatchDialog::OnExLeftSideOnly(wxCommandEvent& event) } +//------------------- deletion handling -------------------------- + +FreeFileSync::DeletionPolicy BatchDialog::getDeletionHandling() +{ + switch (m_choiceHandleDeletion->GetSelection()) + { + case 0: + return FreeFileSync::DELETE_PERMANENTLY; + case 1: + return FreeFileSync::MOVE_TO_RECYCLE_BIN; + case 2: + return FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY; + default: + assert(false); + return FreeFileSync::MOVE_TO_RECYCLE_BIN; + } +} + + +void BatchDialog::setDeletionHandling(FreeFileSync::DeletionPolicy newValue) +{ + m_choiceHandleDeletion->Clear(); + m_choiceHandleDeletion->Append(_("Delete permanently")); + m_choiceHandleDeletion->Append(_("Use Recycle Bin")); + m_choiceHandleDeletion->Append(_("Move to custom directory")); + + switch (newValue) + { + case FreeFileSync::DELETE_PERMANENTLY: + m_choiceHandleDeletion->SetSelection(0); + break; + case FreeFileSync::MOVE_TO_RECYCLE_BIN: + m_choiceHandleDeletion->SetSelection(1); + break; + case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: + m_choiceHandleDeletion->SetSelection(2); + break; + } + + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, newValue); +} + + +void BatchDialog::OnChangeDeletionHandling(wxCommandEvent& event) +{ + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, getDeletionHandling()); +} + + + void BatchDialog::OnExRightSideOnly(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); @@ -575,19 +737,6 @@ void BatchDialog::showNotebookpage(wxWindow* page, const wxString& pageName, boo } -void BatchDialog::OnSelectRecycleBin(wxCommandEvent& event) -{ - if (m_checkBoxUseRecycler->GetValue()) - { - if (!FreeFileSync::recycleBinExists()) - { - wxMessageBox(_("It was not possible to initialize the Recycle Bin!\n\nIt's likely that you are not using Windows.\nIf you want this feature included, please contact the author. :)"), _("Error") , wxOK | wxICON_ERROR); - m_checkBoxUseRecycler->SetValue(false); - } - } -} - - CompareVariant BatchDialog::getCurrentCompareVar() { if (m_radioBtnSizeDate->GetValue()) @@ -604,24 +753,26 @@ CompareVariant BatchDialog::getCurrentCompareVar() void BatchDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) { - SyncDialog::updateConfigIcons(cmpVar, - syncConfig, - m_bpButtonLeftOnly, - m_bpButtonRightOnly, - m_bpButtonLeftNewer, - m_bpButtonRightNewer, - m_bpButtonDifferent, - m_bitmapLeftOnly, - m_bitmapRightOnly, - m_bitmapLeftNewer, - m_bitmapRightNewer, - m_bitmapDifferent); + SyncCfgDialog::updateConfigIcons(cmpVar, + syncConfig, + m_bpButtonLeftOnly, + m_bpButtonRightOnly, + m_bpButtonLeftNewer, + m_bpButtonRightNewer, + m_bpButtonDifferent, + m_bitmapLeftOnly, + m_bitmapRightOnly, + m_bitmapLeftNewer, + m_bitmapRightNewer, + m_bitmapDifferent); } void BatchDialog::OnChangeCompareVar(wxCommandEvent& event) { updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); + + m_panelOverview->Layout(); //needed Fit(); } @@ -683,17 +834,12 @@ bool BatchDialog::saveBatchFile(const wxString& filename) batchCfg.mainCfg.filterIsActive = m_checkBoxFilter->GetValue(); batchCfg.mainCfg.includeFilter = m_textCtrlInclude->GetValue(); batchCfg.mainCfg.excludeFilter = m_textCtrlExclude->GetValue(); - batchCfg.mainCfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); - batchCfg.handleError = getSelectionHandleError(); + batchCfg.mainCfg.handleDeletion = getDeletionHandling(); + batchCfg.mainCfg.customDeletionDirectory = m_textCtrlCustomDelFolder->GetValue(); - for (unsigned int i = 0; i < localFolderPairs.size(); ++i) - { - FolderPair newPair; - newPair.leftDirectory = localFolderPairs[i]->m_directoryLeft->GetValue().c_str(); - newPair.rightDirectory = localFolderPairs[i]->m_directoryRight->GetValue().c_str(); + batchCfg.handleError = getSelectionHandleError(); - batchCfg.directoryPairs.push_back(newPair); - } + batchCfg.directoryPairs = getFolderPairs(); //load structure with batch settings "batchCfg" batchCfg.silent = m_checkBoxSilent->GetValue(); @@ -702,9 +848,9 @@ bool BatchDialog::saveBatchFile(const wxString& filename) //write config to XML try { - xmlAccess::writeBatchConfig(filename, batchCfg); + xmlAccess::writeBatchConfig(batchCfg, filename); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; @@ -723,27 +869,35 @@ void BatchDialog::loadBatchFile(const wxString& filename) xmlAccess::XmlBatchConfig batchCfg; //structure to receive gui settings try { - batchCfg = xmlAccess::readBatchConfig(filename); + xmlAccess::readBatchConfig(filename, batchCfg); } - catch (const FileError& error) + catch (const xmlAccess::XmlError& error) { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - return; + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + return; + } } SetTitle(wxString(_("Create a batch job")) + wxT(" - ") + filename); proposedBatchFileName = filename; //may be used on next save - this->loadBatchCfg(batchCfg); } void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) { + wxWindowUpdateLocker dummy(this); //avoid display distortion + //make working copy of mainDialog.cfg.syncConfiguration and recycler setting localSyncConfiguration = batchCfg.mainCfg.syncConfiguration; - m_checkBoxUseRecycler->SetValue(batchCfg.mainCfg.useRecycleBin); + setDeletionHandling(batchCfg.mainCfg.handleDeletion); + m_textCtrlCustomDelFolder->SetValue(batchCfg.mainCfg.customDeletionDirectory); + setSelectionHandleError(batchCfg.handleError); switch (batchCfg.mainCfg.compareVar) @@ -766,35 +920,197 @@ void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) m_textCtrlLogfileDir->SetValue(batchCfg.logFileDirectory); //remove existing folder pairs - localFolderPairs.clear(); - bSizerFolderPairs->Clear(true); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryRight, m_dirPickerRight); + clearAddFolderPairs(); //add folder pairs - int scrWindowHeight = 0; - for (std::vector<FolderPair>::const_iterator i = batchCfg.directoryPairs.begin(); i != batchCfg.directoryPairs.end(); ++i) + if (batchCfg.directoryPairs.size() > 0) { - BatchFolderPairPanel* newPair = new BatchFolderPairPanel(m_scrolledWindow6); - newPair->m_directoryLeft->SetValue(i->leftDirectory.c_str()); - newPair->m_directoryRight->SetValue(i->rightDirectory.c_str()); + //set main folder pair + std::vector<FolderPair>::const_iterator main = batchCfg.directoryPairs.begin(); - bSizerFolderPairs->Add( newPair, 0, wxEXPAND, 5); - localFolderPairs.push_back(newPair); + FreeFileSync::setDirectoryName(main->leftDirectory.c_str(), m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(main->rightDirectory.c_str(), m_directoryRight, m_dirPickerRight); - if (i == batchCfg.directoryPairs.begin()) - scrWindowHeight = newPair->GetSize().GetHeight(); + //set additional pairs + std::vector<FolderPair> additionalPairs; //don't modify batchCfg.directoryPairs! + for (std::vector<FolderPair>::const_iterator i = batchCfg.directoryPairs.begin() + 1; i != batchCfg.directoryPairs.end(); ++i) + additionalPairs.push_back(*i); + addFolderPair(additionalPairs); } - //set size of scrolled window - int pairCount = std::min(localFolderPairs.size(), size_t(3)); //up to 3 additional pairs shall be shown - m_scrolledWindow6->SetMinSize(wxSize( -1, scrWindowHeight * pairCount)); updateVisibleTabs(); - m_scrolledWindow6->Layout(); //needed - m_panelOverview->Layout(); //needed - Fit(); //needed + Refresh(); //needed Centre(); - m_buttonSave->SetFocus(); +} + + +void BatchDialog::OnAddFolderPair(wxCommandEvent& event) +{ + std::vector<FolderPair> newPairs; + newPairs.push_back(FolderPair(m_directoryLeft->GetValue().c_str(), + m_directoryRight->GetValue().c_str())); + addFolderPair(newPairs, true); //add pair in front of additional pairs + + //clear top folder pair + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(wxEmptyString, m_directoryRight, m_dirPickerRight); +} + + +void BatchDialog::OnRemoveFolderPair(wxCommandEvent& event) +{ + //find folder pair originating the event + const wxObject* const eventObj = event.GetEventObject(); + for (std::vector<BatchFolderPairPanel*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + { + if (eventObj == static_cast<wxObject*>((*i)->m_bpButtonRemovePair)) + { + removeAddFolderPair(i - additionalFolderPairs.begin()); + return; + } + } +} + + +void BatchDialog::OnRemoveTopFolderPair(wxCommandEvent& event) +{ + if (additionalFolderPairs.size() > 0) + { + const wxString leftDir = (*additionalFolderPairs.begin())->m_directoryLeft ->GetValue().c_str(); + const wxString rightDir = (*additionalFolderPairs.begin())->m_directoryRight->GetValue().c_str(); + + FreeFileSync::setDirectoryName(leftDir, m_directoryLeft, m_dirPickerLeft); + FreeFileSync::setDirectoryName(rightDir, m_directoryRight, m_dirPickerRight); + + removeAddFolderPair(0); //remove first of additional folder pairs + } +} + + +const size_t MAX_FOLDER_PAIRS = 3; + + +void BatchDialog::addFolderPair(const std::vector<FolderPair>& newPairs, bool addFront) +{ + if (newPairs.size() == 0) + return; + + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + //add folder pairs + int pairHeight = 0; + for (std::vector<FolderPair>::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) + { + BatchFolderPairPanel* newPair = new BatchFolderPairPanel(m_scrolledWindow6); + newPair->m_bpButtonRemovePair->SetBitmapLabel(*GlobalResources::getInstance().bitmapRemoveFolderPair); + + if (addFront) + { + bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); + additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); + } + else + { + bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); + additionalFolderPairs.push_back(newPair); + } + + //get size of scrolled window + pairHeight = newPair->GetSize().GetHeight(); + + //register events + newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BatchDialog::OnRemoveFolderPair), NULL, this ); + + //insert directory names + FreeFileSync::setDirectoryName(i->leftDirectory.c_str(), newPair->m_directoryLeft, newPair->m_dirPickerLeft); + FreeFileSync::setDirectoryName(i->rightDirectory.c_str(), newPair->m_directoryRight, newPair->m_dirPickerRight); + } + //set size of scrolled window + const int visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown + m_scrolledWindow6->SetMinSize(wxSize( -1, pairHeight * visiblePairs)); + + //adapt delete top folder pair button + m_bpButtonRemoveTopPair->Show(); + m_panelMainPair->Layout(); + + //update controls + m_scrolledWindow6->Fit(); //adjust scrolled window size + m_panelOverview->Layout(); //adjust stuff inside scrolled window + Fit(); //adapt dialog size + + //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this + m_bpButtonLeftOnly->SetFocus(); +} + + +void BatchDialog::removeAddFolderPair(const int pos) +{ + if (0 <= pos && pos < static_cast<int>(additionalFolderPairs.size())) + { + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + //remove folder pairs from window + BatchFolderPairPanel* pairToDelete = additionalFolderPairs[pos]; + const int pairHeight = pairToDelete->GetSize().GetHeight(); + + bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually + pairToDelete->Destroy(); // + additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove last element in vector + + //set size of scrolled window + const int visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown + m_scrolledWindow6->SetMinSize(wxSize(-1, pairHeight * visiblePairs)); + + if (additionalFolderPairs.size() == 0) + { + m_bpButtonRemoveTopPair->Hide(); + m_panelMainPair->Layout(); + } + + //update controls + m_scrolledWindow6->Fit(); //adjust scrolled window size + m_panelOverview->Layout(); //adjust stuff inside scrolled window + + m_panelOverview->InvalidateBestSize(); //needed for Fit() to work correctly! + Fit(); //adapt dialog size + + //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this + m_bpButtonLeftOnly->SetFocus(); + } +} + + +void BatchDialog::clearAddFolderPairs() +{ + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + additionalFolderPairs.clear(); + bSizerAddFolderPairs->Clear(true); + + m_bpButtonRemoveTopPair->Hide(); + m_panelMainPair->Layout(); + + m_scrolledWindow6->SetMinSize(wxSize(-1, sbSizerMainPair->GetSize().GetHeight())); //respect height of main pair +} + + +std::vector<FreeFileSync::FolderPair> BatchDialog::getFolderPairs() const +{ + std::vector<FolderPair> output; + + //add main pair + output.push_back(FolderPair(m_directoryLeft->GetValue().c_str(), + m_directoryRight->GetValue().c_str())); + + //add additional pairs + for (std::vector<BatchFolderPairPanel*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + output.push_back(FolderPair((*i)->m_directoryLeft->GetValue().c_str(), + (*i)->m_directoryRight->GetValue().c_str())); + return output; } diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h index 940efac7..57d220d3 100644 --- a/ui/SyncDialog.h +++ b/ui/SyncDialog.h @@ -1,7 +1,6 @@ #ifndef SYNCDIALOG_H_INCLUDED #define SYNCDIALOG_H_INCLUDED -#include "../structures.h" #include "guiGenerated.h" #include "../library/processXml.h" #include <memory> @@ -15,15 +14,15 @@ namespace FreeFileSync } -class SyncDialog: public SyncDlgGenerated +class SyncCfgDialog : public SyncCfgDlgGenerated { public: - SyncDialog(wxWindow* window, - const FreeFileSync::FolderComparison& folderCmpRef, - FreeFileSync::MainConfiguration& config, - bool& ignoreErrors); + SyncCfgDialog(wxWindow* window, + const FreeFileSync::FolderComparison& folderCmpRef, + FreeFileSync::MainConfiguration& config, + bool& ignoreErrors); - ~SyncDialog(); + ~SyncCfgDialog(); enum { @@ -60,13 +59,23 @@ private: void OnCancel( wxCommandEvent& event); void OnApply( wxCommandEvent& event); - void OnSelectRecycleBin(wxCommandEvent& event); + //error handling + bool getErrorHandling(); + void setErrorHandling(bool ignoreErrors); + void OnChangeErrorHandling(wxCommandEvent& event); + + //deletion handling + FreeFileSync::DeletionPolicy getDeletionHandling(); + void setDeletionHandling(FreeFileSync::DeletionPolicy newValue); + void OnChangeDeletionHandling(wxCommandEvent& event); //temporal copy of maindialog.cfg.syncConfiguration FreeFileSync::SyncConfiguration localSyncConfiguration; const FreeFileSync::FolderComparison& folderCmp; FreeFileSync::MainConfiguration& cfg; bool& m_ignoreErrors; + + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropCustomDelFolder; }; @@ -87,47 +96,65 @@ public: private: void init(); - void OnChangeErrorHandling(wxCommandEvent& event); - - void OnExLeftSideOnly( wxCommandEvent& event); - void OnExRightSideOnly( wxCommandEvent& event); - void OnLeftNewer( wxCommandEvent& event); - void OnRightNewer( wxCommandEvent& event); - void OnDifferent( wxCommandEvent& event); - - void OnCheckFilter( wxCommandEvent& event); - void OnCheckLogging( wxCommandEvent& event); - void OnSelectRecycleBin(wxCommandEvent& event); - void OnChangeCompareVar(wxCommandEvent& event); + virtual void OnExLeftSideOnly( wxCommandEvent& event); + virtual void OnExRightSideOnly( wxCommandEvent& event); + virtual void OnLeftNewer( wxCommandEvent& event); + virtual void OnRightNewer( wxCommandEvent& event); + virtual void OnDifferent( wxCommandEvent& event); + + virtual void OnCheckFilter( wxCommandEvent& event); + virtual void OnCheckLogging( wxCommandEvent& event); + virtual void OnChangeCompareVar( wxCommandEvent& event); + virtual void OnClose( wxCloseEvent& event); + virtual void OnCancel( wxCommandEvent& event); + virtual void OnSaveBatchJob( wxCommandEvent& event); + virtual void OnLoadBatchJob( wxCommandEvent& event); + virtual void OnAddFolderPair( wxCommandEvent& event); + virtual void OnRemoveFolderPair( wxCommandEvent& event); + virtual void OnRemoveTopFolderPair(wxCommandEvent& event); + + void addFolderPair(const std::vector<FreeFileSync::FolderPair>& newPairs, bool addFront = false); + void removeAddFolderPair(const int pos); + void clearAddFolderPairs(); + std::vector<FreeFileSync::FolderPair> getFolderPairs() const; FreeFileSync::CompareVariant getCurrentCompareVar(); void updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig); - void updateVisibleTabs(); void showNotebookpage(wxWindow* page, const wxString& pageName, bool show); - void OnClose( wxCloseEvent& event); - void OnCancel( wxCommandEvent& event); - void OnSaveBatchJob( wxCommandEvent& event); - void OnLoadBatchJob( wxCommandEvent& event); - + //error handling xmlAccess::OnError getSelectionHandleError(); void setSelectionHandleError(const xmlAccess::OnError value); + void OnChangeErrorHandling(wxCommandEvent& event); + + //deletion handling + FreeFileSync::DeletionPolicy getDeletionHandling(); + void setDeletionHandling(FreeFileSync::DeletionPolicy newValue); + void OnChangeDeletionHandling(wxCommandEvent& event); + bool saveBatchFile(const wxString& filename); void loadBatchFile(const wxString& filename); void loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg); + FreeFileSync::SyncConfiguration localSyncConfiguration; - std::vector<BatchFolderPairPanel*> localFolderPairs; + std::vector<BatchFolderPairPanel*> additionalFolderPairs; //used when saving batch file wxString proposedBatchFileName; //add drag & drop support when selecting logfile directory std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnLogfileDir; + + //support for drag and drop on main pair + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnLeft; + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropOnRight; + + std::auto_ptr<FreeFileSync::DragDropOnDlg> dragDropCustomDelFolder; }; #endif // SYNCDIALOG_H_INCLUDED diff --git a/ui/batchStatusHandler.cpp b/ui/batchStatusHandler.cpp index f7f0df9f..294613dd 100644 --- a/ui/batchStatusHandler.cpp +++ b/ui/batchStatusHandler.cpp @@ -1,11 +1,13 @@ #include "batchStatusHandler.h" #include "smallDialogs.h" -#include <wx/stopwatch.h> #include <wx/taskbar.h> #include "../algorithm.h" #include <wx/ffile.h> #include <wx/msgdlg.h> -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" +#include "../shared/standardPaths.h" +#include "../shared/fileHandling.h" +#include "../library/resources.h" class LogFile @@ -14,11 +16,11 @@ public: LogFile(const wxString& logfileDirectory) { //create logfile directory - const Zstring logfileDir = logfileDirectory.empty() ? FreeFileSync::getDefaultLogDirectory().c_str() : logfileDirectory.c_str(); - if (!wxDirExists(logfileDir)) + const wxString logfileDir = logfileDirectory.empty() ? FreeFileSync::getDefaultLogDirectory() : logfileDirectory; + if (!FreeFileSync::dirExists(logfileDir)) try { - FreeFileSync::createDirectory(logfileDir, Zstring(), false); + FreeFileSync::createDirectory(logfileDir.c_str()); //create recursively if necessary } catch (FreeFileSync::FileError&) { @@ -27,9 +29,10 @@ public: } //assemble logfile name - wxString logfileName = logfileDir.c_str(); - if (!FreeFileSync::endsWithPathSeparator(logfileName.c_str())) - logfileName += FreeFileSync::FILE_NAME_SEPARATOR; + wxString logfileName = logfileDir; + if (!logfileName.empty() && logfileName.Last() != globalFunctions::FILE_NAME_SEPARATOR) + logfileName += globalFunctions::FILE_NAME_SEPARATOR; + wxString timeNow = wxDateTime::Now().FormatISOTime(); timeNow.Replace(wxT(":"), wxT("-")); logfileName += wxDateTime::Now().FormatISODate() + wxChar(' ') + timeNow + wxT(".log"); @@ -39,6 +42,7 @@ public: readyToWrite = logFile.IsOpened(); if (readyToWrite) { + //write header wxString headerLine = wxString(wxT("FreeFileSync - ")) + _("Batch execution") + wxT(" (") + _("Date") + wxT(": ") + wxDateTime::Now().FormatDate() + wxT(" ") + //"Date" is used at other places too @@ -50,8 +54,7 @@ public: logFile.Write(caption + wxChar('\n')); logFile.Write(wxString().Pad(caption.Len(), wxChar('-')) + wxChar('\n')); - write(_("Start")); //attention: write() replaces '\n'-characters - logFile.Write(wxChar('\n')); // + logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Start") + wxChar('\n') + wxChar('\n')); totalTime.Start(); //measure total time } @@ -59,48 +62,57 @@ public: ~LogFile() { - if (readyToWrite) - close(); - } + if (readyToWrite) //could be reached when creation of logfile failed + { + //write actual logfile + const std::vector<wxString>& messages = errorLog.getFormattedMessages(); + for (std::vector<wxString>::const_iterator i = messages.begin(); i != messages.end(); ++i) + logFile.Write(*i + wxChar('\n')); - bool isOkay() - { - return readyToWrite; - } + //write ending + logFile.Write(wxChar('\n')); - void write(const wxString& logText, const wxString& problemType = wxEmptyString) - { - logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); + const long time = totalTime.Time(); //retrieve total time + logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); + logFile.Write(wxString(_("Stop")) + wxT(" (") + _("Total time:") + wxT(" ") + (wxTimeSpan::Milliseconds(time)).Format() + wxT(")")); - if (problemType != wxEmptyString) - logFile.Write(problemType + wxT(": ")); + //logFile.close(); <- not needed + } + } - //remove linebreaks - wxString formattedText = logText; - for (wxString::iterator i = formattedText.begin(); i != formattedText.end(); ++i) - if (*i == wxChar('\n')) - *i = wxChar(' '); - logFile.Write(formattedText + wxChar('\n')); + bool isOkay() //has to be checked before LogFile can be used! + { + return readyToWrite; } -private: - void close() + void logError(const wxString& errorMessage) { - logFile.Write(wxChar('\n')); + errorLog.logError(errorMessage); + } - long time = totalTime.Time(); //retrieve total time + void logWarning(const wxString& warningMessage) + { + errorLog.logWarning(warningMessage); + } - logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); - logFile.Write(wxString(_("Stop")) + wxT(" (") + _("Total time:") + wxT(" ") + (wxTimeSpan::Milliseconds(time)).Format() + wxT(")")); + void logInfo(const wxString& infoMessage) + { + errorLog.logInfo(infoMessage); + } - //logFile.close(); <- not needed + bool errorsOccured() + { + return errorLog.errorsTotal() > 0; } +private: bool readyToWrite; wxFFile logFile; wxStopWatch totalTime; + + FreeFileSync::ErrorLogging errorLog; }; @@ -109,18 +121,22 @@ class FfsTrayIcon : public wxTaskBarIcon public: FfsTrayIcon(StatusHandler* statusHandler) : m_statusHandler(statusHandler), - processPaused(false) + processPaused(false), + percentage(_("%x Percent")), + currentProcess(StatusHandler::PROCESS_NONE), + totalObjects(0), + currentObjects(0) { running.reset(new wxIcon(*GlobalResources::getInstance().programIcon)); paused.reset(new wxIcon); paused->CopyFromBitmap(*GlobalResources::getInstance().bitmapFFSPaused); - wxTaskBarIcon::SetIcon(*running); + wxTaskBarIcon::SetIcon(*running, wxT("FreeFileSync")); } ~FfsTrayIcon() {} - enum + enum Selection { CONTEXT_PAUSE, CONTEXT_ABORT, @@ -132,9 +148,9 @@ public: wxMenu* contextMenu = new wxMenu; contextMenu->Append(CONTEXT_PAUSE, _("&Pause"), wxEmptyString, wxITEM_CHECK); contextMenu->Check(CONTEXT_PAUSE, processPaused); - contextMenu->Append(CONTEXT_ABORT, _("&Abort")); - contextMenu->AppendSeparator(); contextMenu->Append(CONTEXT_ABOUT, _("&About...")); + contextMenu->AppendSeparator(); + contextMenu->Append(CONTEXT_ABORT, _("&Exit")); //event handling contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FfsTrayIcon::onContextMenuSelection), NULL, this); @@ -143,46 +159,100 @@ public: void onContextMenuSelection(wxCommandEvent& event) { - int eventId = event.GetId(); - if (eventId == CONTEXT_PAUSE) + const Selection eventId = static_cast<Selection>(event.GetId()); + switch (eventId) { + case CONTEXT_PAUSE: processPaused = !processPaused; - if (processPaused) - wxTaskBarIcon::SetIcon(*paused); - else - wxTaskBarIcon::SetIcon(*running); - } - else if (eventId == CONTEXT_ABORT) - { + break; + case CONTEXT_ABORT: processPaused = false; - wxTaskBarIcon::SetIcon(*running); m_statusHandler->requestAbortion(); - } - else if (eventId == CONTEXT_ABOUT) + break; + case CONTEXT_ABOUT: { AboutDlg* aboutDlg = new AboutDlg(NULL); aboutDlg->ShowModal(); aboutDlg->Destroy(); } + break; + } + } + + wxString calcPercentage(const wxLongLong& current, const wxLongLong& total) + { + const double ratio = current.ToDouble() * 100 / total.ToDouble(); + wxString output = percentage; + output.Replace(wxT("%x"), wxString::Format(wxT("%3.2f"), ratio), false); + return output; } void updateSysTray() { + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + wxTaskBarIcon::SetIcon(*running, wxString(wxT("FreeFileSync - ")) + wxString(_("Scanning...")) + wxT(" ") + + globalFunctions::numberToWxString(currentObjects)); + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + wxTaskBarIcon::SetIcon(*running, wxString(wxT("FreeFileSync - ")) + wxString(_("Comparing content...")) + wxT(" ") + + calcPercentage(currentData, totalData)); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + wxTaskBarIcon::SetIcon(*running, wxString(wxT("FreeFileSync - ")) + wxString(_("Synchronizing...")) + wxT(" ") + + calcPercentage(currentData, totalData)); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } + updateUiNow(); + //support for pause button - while (processPaused) + if (processPaused) { - wxMilliSleep(UI_UPDATE_INTERVAL); - updateUiNow(); + wxTaskBarIcon::SetIcon(*paused, wxString(wxT("FreeFileSync - ")) + _("Paused")); + while (processPaused) + { + wxMilliSleep(UI_UPDATE_INTERVAL); + updateUiNow(); + } } } + void initNewProcess(int objectsTotal, wxLongLong dataTotal, StatusHandler::Process processID) + { + totalObjects = objectsTotal; + totalData = dataTotal; + currentObjects = 0; + currentData = 0; + currentProcess = processID; + } + + void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) + { + currentObjects += objectsProcessed; + currentData += dataProcessed; + } + + private: StatusHandler* m_statusHandler; bool processPaused; std::auto_ptr<wxIcon> running; std::auto_ptr<wxIcon> paused; + const wxString percentage; + + //status variables + StatusHandler::Process currentProcess; + int totalObjects; + wxLongLong totalData; + int currentObjects; //each object represents a file or directory processed + wxLongLong currentData; //each data element represents one byte for proper progress indicator scaling + }; @@ -199,6 +269,7 @@ BatchStatusHandlerSilent::BatchStatusHandlerSilent(const xmlAccess::OnError hand if (!m_log->isOkay()) { //handle error: file load wxMessageBox(_("Unable to create logfile!"), _("Error"), wxOK | wxICON_ERROR); + returnValue = -7; throw FreeFileSync::AbortThisProcess(); } } @@ -206,21 +277,19 @@ BatchStatusHandlerSilent::BatchStatusHandlerSilent(const xmlAccess::OnError hand BatchStatusHandlerSilent::~BatchStatusHandlerSilent() { - unsigned int failedItems = unhandledErrors.GetCount(); - //write result if (abortIsRequested()) { returnValue = -4; - m_log->write(_("Synchronization aborted!"), _("Error")); + m_log->logError(_("Synchronization aborted!")); } - else if (failedItems) + else if (m_log->errorsOccured()) { returnValue = -5; - m_log->write(_("Synchronization completed with errors!"), _("Info")); + m_log->logInfo(_("Synchronization completed with errors!")); } else - m_log->write(_("Synchronization completed successfully!"), _("Info")); + m_log->logInfo(_("Synchronization completed successfully!")); } @@ -233,7 +302,7 @@ void BatchStatusHandlerSilent::updateStatusText(const Zstring& text) case StatusHandler::PROCESS_COMPARING_CONTENT: break; case StatusHandler::PROCESS_SYNCHRONIZING: - m_log->write(text.c_str(), _("Info")); + m_log->logInfo(text.c_str()); break; case StatusHandler::PROCESS_NONE: assert(false); @@ -246,10 +315,18 @@ inline void BatchStatusHandlerSilent::initNewProcess(int objectsTotal, wxLongLong dataTotal, StatusHandler::Process processID) { currentProcess = processID; + + trayIcon->initNewProcess(objectsTotal, dataTotal, processID); } -ErrorHandler::Response BatchStatusHandlerSilent::reportError(const Zstring& errorMessage) +void BatchStatusHandlerSilent::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) +{ + trayIcon->updateProcessedData(objectsProcessed, dataProcessed); +} + + +ErrorHandler::Response BatchStatusHandlerSilent::reportError(const wxString& errorMessage) { switch (m_handleError) { @@ -258,38 +335,34 @@ ErrorHandler::Response BatchStatusHandlerSilent::reportError(const Zstring& erro bool ignoreNextErrors = false; ErrorDlg* errorDlg = new ErrorDlg(NULL, ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - wxString(errorMessage) + wxT("\n\n") + _("Ignore this error, retry or abort?"), + errorMessage + wxT("\n\n\n") + _("Ignore this error, retry or abort?"), ignoreNextErrors); - const int rv = errorDlg->ShowModal(); + const ErrorDlg::ReturnCodes rv = static_cast<ErrorDlg::ReturnCodes>(errorDlg->ShowModal()); errorDlg->Destroy(); switch (rv) { case ErrorDlg::BUTTON_IGNORE: if (ignoreNextErrors) //falsify only m_handleError = xmlAccess::ON_ERROR_IGNORE; - unhandledErrors.Add(errorMessage.c_str()); - m_log->write(errorMessage.c_str(), _("Error")); + m_log->logError(errorMessage); return ErrorHandler::IGNORE_ERROR; case ErrorDlg::BUTTON_RETRY: return ErrorHandler::RETRY; case ErrorDlg::BUTTON_ABORT: - unhandledErrors.Add(errorMessage.c_str()); - m_log->write(errorMessage.c_str(), _("Error")); + m_log->logError(errorMessage); abortThisProcess(); } } break; //used if last switch didn't find a match case xmlAccess::ON_ERROR_EXIT: //abort - unhandledErrors.Add(errorMessage.c_str()); - m_log->write(errorMessage.c_str(), _("Error")); + m_log->logError(errorMessage); abortThisProcess(); case xmlAccess::ON_ERROR_IGNORE: - unhandledErrors.Add(errorMessage.c_str()); - m_log->write(errorMessage.c_str(), _("Error")); + m_log->logError(errorMessage); return ErrorHandler::IGNORE_ERROR; } @@ -298,7 +371,7 @@ ErrorHandler::Response BatchStatusHandlerSilent::reportError(const Zstring& erro } -void BatchStatusHandlerSilent::reportFatalError(const Zstring& errorMessage) +void BatchStatusHandlerSilent::reportFatalError(const wxString& errorMessage) { switch (m_handleError) { @@ -307,7 +380,7 @@ void BatchStatusHandlerSilent::reportFatalError(const Zstring& errorMessage) bool dummy = false; ErrorDlg* errorDlg = new ErrorDlg(NULL, ErrorDlg::BUTTON_ABORT, - errorMessage.c_str(), dummy); + errorMessage, dummy); errorDlg->ShowModal(); errorDlg->Destroy(); } @@ -320,14 +393,18 @@ void BatchStatusHandlerSilent::reportFatalError(const Zstring& errorMessage) break; } - unhandledErrors.Add(errorMessage.c_str()); - m_log->write(errorMessage.c_str(), _("Error")); + m_log->logError(errorMessage); abortThisProcess(); } -void BatchStatusHandlerSilent::reportWarning(const Zstring& warningMessage, bool& dontShowAgain) +void BatchStatusHandlerSilent::reportWarning(const wxString& warningMessage, bool& warningActive) { + m_log->logWarning(warningMessage); + + if (!warningActive) + return; + switch (m_handleError) { case xmlAccess::ON_ERROR_POPUP: @@ -336,41 +413,36 @@ void BatchStatusHandlerSilent::reportWarning(const Zstring& warningMessage, bool bool dontWarnAgain = false; WarningDlg* warningDlg = new WarningDlg(NULL, WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage.c_str(), + warningMessage, dontWarnAgain); - const int rv = warningDlg->ShowModal(); + const WarningDlg::Response rv = static_cast<WarningDlg::Response>(warningDlg->ShowModal()); warningDlg->Destroy(); switch (rv) { case WarningDlg::BUTTON_ABORT: - unhandledErrors.Add(warningMessage.c_str()); - m_log->write(warningMessage.c_str(), _("Warning")); abortThisProcess(); + break; + case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! - dontShowAgain = dontWarnAgain; - m_log->write(warningMessage.c_str(), _("Warning")); - return; + warningActive = !dontWarnAgain; + break; } } break; //keep it! last switch might not find match case xmlAccess::ON_ERROR_EXIT: //abort - unhandledErrors.Add(warningMessage.c_str()); - m_log->write(warningMessage.c_str(), _("Warning")); abortThisProcess(); + break; case xmlAccess::ON_ERROR_IGNORE: //no unhandled error situation! - m_log->write(warningMessage.c_str(), _("Warning")); - return; + break; } - - assert(false); } -void BatchStatusHandlerSilent::addFinalInfo(const Zstring& infoMessage) +void BatchStatusHandlerSilent::addFinalInfo(const wxString& infoMessage) { - m_log->write(infoMessage.c_str(), _("Info")); + m_log->logInfo(infoMessage); } @@ -390,10 +462,26 @@ void BatchStatusHandlerSilent::abortThisProcess() //used by sys-tray menu BatchStatusHandlerGui::BatchStatusHandlerGui(const xmlAccess::OnError handleError, int& returnVal) : - m_handleError(handleError), + showPopups(true), currentProcess(StatusHandler::PROCESS_NONE), returnValue(returnVal) { + switch (handleError) + { + case xmlAccess::ON_ERROR_POPUP: + showPopups = true; + break; + + case xmlAccess::ON_ERROR_EXIT: //doesn't make much sense for "batch gui"-mode + showPopups = true; + break; + + case xmlAccess::ON_ERROR_IGNORE: + showPopups = false; + break; + } + + syncStatusFrame = new SyncStatus(this, NULL); syncStatusFrame->Show(); } @@ -401,24 +489,24 @@ BatchStatusHandlerGui::BatchStatusHandlerGui(const xmlAccess::OnError handleErro BatchStatusHandlerGui::~BatchStatusHandlerGui() { - //display result + //print the results list wxString finalMessage; - - unsigned int failedItems = unhandledErrors.GetCount(); - if (failedItems) + if (errorLog.messageCount() > 0) { - finalMessage = wxString(_("Warning: Synchronization failed for %x item(s):")) + wxT("\n\n"); - finalMessage.Replace(wxT("%x"), globalFunctions::numberToWxString(failedItems), false); - - for (unsigned int j = 0; j < failedItems; ++j) - { //remove linebreaks - wxString errorMessage = unhandledErrors[j]; - for (wxString::iterator i = errorMessage.begin(); i != errorMessage.end(); ++i) - if (*i == wxChar('\n')) - *i = wxChar(' '); + if (errorLog.errorsTotal() > 0) + { + wxString header(_("Warning: Synchronization failed for %x item(s):")); + header.Replace(wxT("%x"), globalFunctions::numberToWxString(errorLog.errorsTotal()), false); + finalMessage += header + wxT("\n\n"); + } - finalMessage += errorMessage + wxT("\n"); + const std::vector<wxString>& messages = errorLog.getFormattedMessages(); + for (std::vector<wxString>::const_iterator i = messages.begin(); i != messages.end(); ++i) + { + finalMessage += *i; + finalMessage += wxChar('\n'); } + finalMessage += wxT("\n"); } @@ -433,7 +521,7 @@ BatchStatusHandlerGui::~BatchStatusHandlerGui() syncStatusFrame->setStatusText_NoUpdate(finalMessage.c_str()); syncStatusFrame->processHasFinished(SyncStatus::ABORTED); //enable okay and close events } - else if (failedItems) + else if (errorLog.errorsTotal()) { returnValue = -5; finalMessage += _("Synchronization completed with errors!"); @@ -499,69 +587,57 @@ void BatchStatusHandlerGui::updateProcessedData(int objectsProcessed, wxLongLong } -ErrorHandler::Response BatchStatusHandlerGui::reportError(const Zstring& errorMessage) +ErrorHandler::Response BatchStatusHandlerGui::reportError(const wxString& errorMessage) { - //add current time before error message - const wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + errorMessage.c_str(); - - switch (m_handleError) - { - case xmlAccess::ON_ERROR_POPUP: + if (showPopups) { syncStatusFrame->updateStatusDialogNow(); bool ignoreNextErrors = false; ErrorDlg* errorDlg = new ErrorDlg(syncStatusFrame, ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - wxString(errorMessage) + wxT("\n\n") + _("Ignore this error, retry or abort?"), + errorMessage + wxT("\n\n\n") + _("Ignore this error, retry or abort?"), ignoreNextErrors); - switch (errorDlg->ShowModal()) + switch (static_cast<ErrorDlg::ReturnCodes>(errorDlg->ShowModal())) { case ErrorDlg::BUTTON_IGNORE: - if (ignoreNextErrors) //falsify only - m_handleError = xmlAccess::ON_ERROR_IGNORE; - unhandledErrors.Add(errorWithTime); + showPopups = !ignoreNextErrors; + errorLog.logError(errorMessage); return ErrorHandler::IGNORE_ERROR; case ErrorDlg::BUTTON_RETRY: return ErrorHandler::RETRY; case ErrorDlg::BUTTON_ABORT: - unhandledErrors.Add(errorWithTime); + errorLog.logError(errorMessage); abortThisProcess(); } } - break; //used IF last switch didn't find a match - - case xmlAccess::ON_ERROR_EXIT: //abort - unhandledErrors.Add(errorWithTime); - abortThisProcess(); - - case xmlAccess::ON_ERROR_IGNORE: - unhandledErrors.Add(errorWithTime); + else + { + errorLog.logError(errorMessage); return ErrorHandler::IGNORE_ERROR; } assert(false); - return ErrorHandler::IGNORE_ERROR; //dummy value + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; //dummy } -void BatchStatusHandlerGui::reportFatalError(const Zstring& errorMessage) -{ //add current time before error message - wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + errorMessage.c_str(); - - unhandledErrors.Add(errorWithTime); +void BatchStatusHandlerGui::reportFatalError(const wxString& errorMessage) +{ + errorLog.logError(errorMessage); abortThisProcess(); } -void BatchStatusHandlerGui::reportWarning(const Zstring& warningMessage, bool& dontShowAgain) -{ //add current time before warning message - wxString warningWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + warningMessage.c_str(); +void BatchStatusHandlerGui::reportWarning(const wxString& warningMessage, bool& warningActive) +{ + errorLog.logWarning(warningMessage); - switch (m_handleError) - { - case xmlAccess::ON_ERROR_POPUP: - case xmlAccess::ON_ERROR_EXIT: //show popup in this case also + if (!warningActive) + return; + + if (showPopups) { syncStatusFrame->updateStatusDialogNow(); @@ -569,27 +645,21 @@ void BatchStatusHandlerGui::reportWarning(const Zstring& warningMessage, bool& d bool dontWarnAgain = false; WarningDlg* warningDlg = new WarningDlg(NULL, WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage.c_str(), + warningMessage, dontWarnAgain); - const int rv = warningDlg->ShowModal(); + const WarningDlg::Response rv = static_cast<WarningDlg::Response>(warningDlg->ShowModal()); warningDlg->Destroy(); switch (rv) { case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! - dontShowAgain = dontWarnAgain; - return; + warningActive = !dontWarnAgain; + break; + case WarningDlg::BUTTON_ABORT: - unhandledErrors.Add(warningWithTime); abortThisProcess(); + break; } } - break; //keep it! last switch might not find match - - case xmlAccess::ON_ERROR_IGNORE: //no unhandled error situation! - return; - } - - assert(false); } @@ -610,7 +680,7 @@ void BatchStatusHandlerGui::abortThisProcess() } -void BatchStatusHandlerGui::addFinalInfo(const Zstring& infoMessage) +void BatchStatusHandlerGui::addFinalInfo(const wxString& infoMessage) { - finalInfo = infoMessage.c_str(); + finalInfo = infoMessage; } diff --git a/ui/batchStatusHandler.h b/ui/batchStatusHandler.h index 7087d3c9..a075d7d7 100644 --- a/ui/batchStatusHandler.h +++ b/ui/batchStatusHandler.h @@ -4,7 +4,7 @@ #include "../library/statusHandler.h" #include <memory> #include "../library/processXml.h" -#include <wx/arrstr.h> +#include "../library/errorLogging.h" class LogFile; class FfsTrayIcon; @@ -14,10 +14,7 @@ class SyncStatus; class BatchStatusHandler : public StatusHandler { public: - BatchStatusHandler() {} - virtual ~BatchStatusHandler() {} - - virtual void addFinalInfo(const Zstring& infoMessage) = 0; + virtual void addFinalInfo(const wxString& infoMessage) = 0; }; @@ -30,19 +27,19 @@ public: virtual void updateStatusText(const Zstring& text); virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); - virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) {} + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); virtual void forceUiRefresh(); - virtual ErrorHandler::Response reportError(const Zstring& errorMessage); - virtual void reportFatalError(const Zstring& errorMessage); - virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); - virtual void addFinalInfo(const Zstring& infoMessage); + virtual ErrorHandler::Response reportError(const wxString& errorMessage); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); + virtual void addFinalInfo(const wxString& infoMessage); private: virtual void abortThisProcess(); xmlAccess::OnError m_handleError; - wxArrayString unhandledErrors; //list of non-resolved errors + Process currentProcess; int& returnValue; std::auto_ptr<FfsTrayIcon> trayIcon; @@ -62,16 +59,16 @@ public: virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); virtual void forceUiRefresh(); - virtual ErrorHandler::Response reportError(const Zstring& errorMessage); - virtual void reportFatalError(const Zstring& errorMessage); - virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); - virtual void addFinalInfo(const Zstring& infoMessage); + virtual ErrorHandler::Response reportError(const wxString& errorMessage); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); + virtual void addFinalInfo(const wxString& infoMessage); private: virtual void abortThisProcess(); - xmlAccess::OnError m_handleError; - wxArrayString unhandledErrors; //list of non-resolved errors + bool showPopups; + FreeFileSync::ErrorLogging errorLog; //list of non-resolved errors and warnings Process currentProcess; int& returnValue; diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp index 16d37036..41677094 100644 --- a/ui/checkVersion.cpp +++ b/ui/checkVersion.cpp @@ -6,7 +6,7 @@ #include <wx/msgdlg.h> #include <wx/utils.h> #include <wx/timer.h> -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" class CloseConnectionOnExit @@ -69,28 +69,19 @@ bool newerVersionExists(const wxString& onlineVersion) const wxChar VERSION_SEP = wxT('.'); - while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND && + while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND || onlineVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND) { - const wxString currentMajor = currentVersionCpy.BeforeFirst(VERSION_SEP); - const wxString onlineMajor = onlineVersionCpy.BeforeFirst(VERSION_SEP); + const int currentMajor = globalFunctions::wxStringToInt(currentVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. + const int onlineMajor = globalFunctions::wxStringToInt(onlineVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. if (currentMajor != onlineMajor) - return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor); + return currentMajor < onlineMajor; - currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); - onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); + currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. + onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. } - const wxString currentMinor = currentVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found. - const wxString onlineMinor = onlineVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found. - - if (currentMinor != onlineMinor) - return globalFunctions::wxStringToInt(currentMinor) < globalFunctions::wxStringToInt(onlineMinor); - - currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. - onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. - return globalFunctions::wxStringToInt(currentVersionCpy) < globalFunctions::wxStringToInt(onlineVersionCpy); } diff --git a/ui/gridView.cpp b/ui/gridView.cpp index aa1867fd..5406422b 100644 --- a/ui/gridView.cpp +++ b/ui/gridView.cpp @@ -1,5 +1,6 @@ #include "gridView.h" #include "sorting.h" +#include "../synchronization.h" using FreeFileSync::GridView; @@ -12,6 +13,10 @@ GridView::GridView(FreeFileSync::FolderComparison& results) : differentFilesActive(false), equalFilesActive(false), conflictFilesActive(false), + syncCreateLeftActive(false), + syncCreateRightActive(false), + syncDeleteLeftActive(false), + syncDeleteRightActive(false), syncDirLeftActive(false), syncDirRightActive(false), syncDirNoneActive(false), @@ -26,7 +31,10 @@ GridView::StatusInfo::StatusInfo() : existsDifferent(false), existsEqual(false), existsConflict(false), - + existsSyncCreateLeft(false), + existsSyncCreateRight(false), + existsSyncDeleteLeft(false), + existsSyncDeleteRight(false), existsSyncDirLeft(false), existsSyncDirRight(false), existsSyncDirNone(false), @@ -67,21 +75,37 @@ GridView::StatusInfo GridView::update_sub(const bool hideFiltered) continue; - switch (i->direction) + switch (FreeFileSync::getSyncOperation(*i)) //evaluate comparison result and sync direction { - case SYNC_DIR_LEFT: - output.existsSyncDirLeft = true; - if (!syncDirLeftActive) continue; + case SO_CREATE_NEW_LEFT: + output.existsSyncCreateLeft = true; + if (!syncCreateLeftActive) continue; + break; + case SO_CREATE_NEW_RIGHT: + output.existsSyncCreateRight = true; + if (!syncCreateRightActive) continue; + break; + case SO_DELETE_LEFT: + output.existsSyncDeleteLeft = true; + if (!syncDeleteLeftActive) continue; + break; + case SO_DELETE_RIGHT: + output.existsSyncDeleteRight = true; + if (!syncDeleteRightActive) continue; break; - case SYNC_DIR_RIGHT: + case SO_OVERWRITE_RIGHT: output.existsSyncDirRight = true; if (!syncDirRightActive) continue; break; - case SYNC_DIR_NONE: + case SO_OVERWRITE_LEFT: + output.existsSyncDirLeft = true; + if (!syncDirLeftActive) continue; + break; + case SO_DO_NOTHING: output.existsSyncDirNone = true; if (!syncDirNoneActive) continue; break; - case SYNC_UNRESOLVED_CONFLICT: + case SO_UNRESOLVED_CONFLICT: output.existsConflict = true; if (!conflictFilesActive) continue; break; @@ -168,6 +192,33 @@ GridView::StatusInfo GridView::update(const bool hideFiltered, const bool syncPr } +void GridView::resetSettings() +{ + leftOnlyFilesActive = true; + leftNewerFilesActive = true; + differentFilesActive = true; + rightNewerFilesActive = true; //do not save/load these bool values from harddisk! + rightOnlyFilesActive = true; //it's more convenient to have them defaulted at startup + equalFilesActive = false; + + conflictFilesActive = true; + + syncCreateLeftActive = true; + syncCreateRightActive = true; + syncDeleteLeftActive = true; + syncDeleteRightActive = true; + syncDirLeftActive = true; + syncDirRightActive = true; + syncDirNoneActive = true; +} + + +void GridView::clearView() +{ + refView.clear(); +} + + void GridView::viewRefToFolderRef(const std::set<int>& viewRef, FreeFileSync::FolderCompRef& output) { output.clear(); @@ -212,24 +263,41 @@ void bubbleSort(FreeFileSync::FolderComparison& folderCmp, CompareFct compare) } +template <class T> +struct CompareGreater +{ + typedef bool (*CmpLess) (const T& a, const T& b); + CompareGreater(CmpLess cmpFct) : m_cmpFct(cmpFct) {} + + bool operator()(const T& a, const T& b) const + { + return m_cmpFct(b, a); + } +private: + CmpLess m_cmpFct; +}; + + void GridView::sortView(const SortType type, const bool onLeft, const bool ascending) { using namespace FreeFileSync; + typedef CompareGreater<FolderCompareLine> FolderReverse; if (type == SORT_BY_DIRECTORY) { //specialization: use custom sorting function based on FolderComparison::swap() //bubble sort is no performance issue since number of folder pairs should be "very small" - if (ascending && onLeft) bubbleSort(folderCmp, sortByDirectory<ASCENDING, SORT_ON_LEFT>); - else if (ascending && !onLeft) bubbleSort(folderCmp, sortByDirectory<ASCENDING, SORT_ON_RIGHT>); - else if (!ascending && onLeft) bubbleSort(folderCmp, sortByDirectory<DESCENDING, SORT_ON_LEFT>); - else if (!ascending && !onLeft) bubbleSort(folderCmp, sortByDirectory<DESCENDING, SORT_ON_RIGHT>); + if (ascending && onLeft) bubbleSort(folderCmp, sortByDirectory<SORT_ON_LEFT>); + else if (ascending && !onLeft) bubbleSort(folderCmp, sortByDirectory<SORT_ON_RIGHT>); + else if (!ascending && onLeft) bubbleSort(folderCmp, FolderReverse(sortByDirectory<SORT_ON_LEFT>)); + else if (!ascending && !onLeft) bubbleSort(folderCmp, FolderReverse(sortByDirectory<SORT_ON_RIGHT>)); //then sort by relative name GridView::sortView(SORT_BY_REL_NAME, onLeft, ascending); return; } + typedef CompareGreater<FileCompareLine> FileReverse; for (FolderComparison::iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) { @@ -238,38 +306,38 @@ void GridView::sortView(const SortType type, const bool onLeft, const bool ascen switch (type) { case SORT_BY_REL_NAME: - if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<ASCENDING, SORT_ON_LEFT>); - else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<ASCENDING, SORT_ON_RIGHT>); - else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<DESCENDING, SORT_ON_LEFT>); - else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<DESCENDING, SORT_ON_RIGHT>); + if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<SORT_ON_LEFT>); + else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByRelativeName<SORT_ON_RIGHT>); + else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByRelativeName<SORT_ON_LEFT>)); + else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByRelativeName<SORT_ON_RIGHT>)); break; case SORT_BY_FILENAME: - if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<ASCENDING, SORT_ON_LEFT>); - else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<ASCENDING, SORT_ON_RIGHT>); - else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<DESCENDING, SORT_ON_LEFT>); - else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<DESCENDING, SORT_ON_RIGHT>); + if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<SORT_ON_LEFT>); + else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileName<SORT_ON_RIGHT>); + else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByFileName<SORT_ON_LEFT>)); + else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByFileName<SORT_ON_RIGHT>)); break; case SORT_BY_FILESIZE: - if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<ASCENDING, SORT_ON_LEFT>); - else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<ASCENDING, SORT_ON_RIGHT>); - else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<DESCENDING, SORT_ON_LEFT>); - else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<DESCENDING, SORT_ON_RIGHT>); + if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<SORT_ON_LEFT>); + else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByFileSize<SORT_ON_RIGHT>); + else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByFileSize<SORT_ON_LEFT>)); + else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByFileSize<SORT_ON_RIGHT>)); break; case SORT_BY_DATE: - if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<ASCENDING, SORT_ON_LEFT>); - else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<ASCENDING, SORT_ON_RIGHT>); - else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<DESCENDING, SORT_ON_LEFT>); - else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<DESCENDING, SORT_ON_RIGHT>); + if ( ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<SORT_ON_LEFT>); + else if ( ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), sortByDate<SORT_ON_RIGHT>); + else if (!ascending && onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByDate<SORT_ON_LEFT>)); + else if (!ascending && !onLeft) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByDate<SORT_ON_RIGHT>)); break; case SORT_BY_CMP_RESULT: - if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortByCmpResult<ASCENDING>); - else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortByCmpResult<DESCENDING>); + if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortByCmpResult); + else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortByCmpResult)); break; case SORT_BY_SYNC_DIRECTION: - if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortBySyncDirection<ASCENDING>); - else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortBySyncDirection<DESCENDING>); + if ( ascending) std::sort(fileCmp.begin(), fileCmp.end(), sortBySyncDirection); + else if (!ascending) std::sort(fileCmp.begin(), fileCmp.end(), FileReverse(sortBySyncDirection)); break; - default: + case SORT_BY_DIRECTORY: assert(false); } } diff --git a/ui/gridView.h b/ui/gridView.h index b531093d..8603bbd2 100644 --- a/ui/gridView.h +++ b/ui/gridView.h @@ -15,8 +15,6 @@ namespace FreeFileSync const FileCompareLine& operator[] (unsigned row) const; FileCompareLine& operator[] (unsigned row); - //unsigned getResultsIndex(const unsigned viewIndex); //convert index on GridView to index on FolderComparison - unsigned int elementsOnView() const; //only the currently visible elements bool refGridIsEmpty() const; @@ -38,6 +36,10 @@ namespace FreeFileSync bool existsEqual; bool existsConflict; + bool existsSyncCreateLeft; + bool existsSyncCreateRight; + bool existsSyncDeleteLeft; + bool existsSyncDeleteRight; bool existsSyncDirLeft; bool existsSyncDirRight; bool existsSyncDirNone; @@ -55,6 +57,8 @@ namespace FreeFileSync StatusInfo update(const bool hideFiltered, const bool syncPreviewActive); + void clearView(); //clear all references on compare results table: needed if there is a mismatch between references and actual data + //UI View Filter settings //compare result bool leftOnlyFilesActive; @@ -65,10 +69,15 @@ namespace FreeFileSync bool equalFilesActive; bool conflictFilesActive; //sync preview + bool syncCreateLeftActive; + bool syncCreateRightActive; + bool syncDeleteLeftActive; + bool syncDeleteRightActive; bool syncDirLeftActive; bool syncDirRightActive; bool syncDirNoneActive; + void resetSettings(); //sorting... enum SortType diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index de21b0f8..a3db4dd8 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -5,8 +5,8 @@ // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "../library/customButton.h" #include "../library/customGrid.h" +#include "../shared/customButton.h" #include "guiGenerated.h" @@ -87,60 +87,48 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + wxFlexGridSizer* fgSizer121; + fgSizer121 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer121->SetFlexibleDirection( wxBOTH ); + fgSizer121->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextCmpVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCmpVariant->Wrap( -1 ); + m_staticTextCmpVariant->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextCmpVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + fgSizer121->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + fgSizer121->Add( 0, 0, 1, 0, 5 ); + wxBoxSizer* bSizer30; bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,40 ), 0 ); + m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,42 ), 0 ); m_buttonCompare->SetDefault(); m_buttonCompare->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); m_buttonCompare->SetToolTip( _("Compare both sides") ); - bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,40 ), 0 ); + m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,42 ), 0 ); m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Tahoma") ) ); m_buttonAbort->Enable( false ); m_buttonAbort->Hide(); - bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); + bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer6->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer121->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer55; - bSizer55 = new wxBoxSizer( wxVERTICAL ); + m_bpButtonCmpConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( m_panel71, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - wxBoxSizer* bSizer45; - bSizer45 = new wxBoxSizer( wxVERTICAL ); + fgSizer121->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); - m_radioBtnSizeDate = new wxRadioButton( m_panel71, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_radioBtnSizeDate->SetValue( true ); - m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same.") ); - - bSizer45->Add( m_radioBtnSizeDate, 0, 0, 5 ); - - m_radioBtnContent = new wxRadioButton( m_panel71, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); - - bSizer45->Add( m_radioBtnContent, 0, wxTOP, 5 ); - - sbSizer6->Add( bSizer45, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButton14 = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButton14->SetToolTip( _("Help") ); - - m_bpButton14->SetToolTip( _("Help") ); - - sbSizer6->Add( m_bpButton14, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 2 ); - - - bSizer55->Add( 0, 4, 0, 0, 5 ); - - bSizer6->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer6->Add( fgSizer121, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); bSizer6->Add( 0, 0, 1, 0, 5 ); @@ -153,27 +141,27 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer12->Add( 0, 0, 1, wxEXPAND, 5 ); - m_staticTextVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextVariant->Wrap( -1 ); - m_staticTextVariant->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Arial") ) ); - m_staticTextVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + m_staticTextSyncVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSyncVariant->Wrap( -1 ); + m_staticTextSyncVariant->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextSyncVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - fgSizer12->Add( m_staticTextVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); + fgSizer12->Add( m_staticTextSyncVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButtonSyncConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,40 ), wxBU_AUTODRAW ); + m_bpButtonSyncConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); fgSizer12->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); - m_buttonStartSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("Synchronize..."), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonStartSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("Synchronize..."), wxDefaultPosition, wxSize( -1,42 ), 0 ); m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); m_buttonStartSync->SetToolTip( _("Start synchronization") ); fgSizer12->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( fgSizer12, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer6->Add( fgSizer12, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -195,7 +183,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_directoryLeft = new wxComboBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); sbSizer2->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - m_dirPickerLeft = new wxDirPickerCtrl( m_panelTopLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); + m_dirPickerLeft = new wxDirPickerCtrl( m_panelTopLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); m_dirPickerLeft->SetToolTip( _("Select a folder") ); sbSizer2->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -237,39 +225,34 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer77; bSizer77 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer781; - bSizer781 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer3; + sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopRight, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); m_bpButtonAddPair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - bSizer781->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 3 ); + sbSizer3->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); m_bpButtonRemoveTopPair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); m_bpButtonRemoveTopPair->SetToolTip( _("Remove folder pair") ); m_bpButtonRemoveTopPair->SetToolTip( _("Remove folder pair") ); - bSizer781->Add( m_bpButtonRemoveTopPair, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer77->Add( bSizer781, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - wxStaticBoxSizer* sbSizer3; - sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopRight, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); + sbSizer3->Add( m_bpButtonRemoveTopPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_directoryRight = new wxComboBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); sbSizer3->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - m_dirPickerRight = new wxDirPickerCtrl( m_panelTopRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); + m_dirPickerRight = new wxDirPickerCtrl( m_panelTopRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); m_dirPickerRight->SetToolTip( _("Select a folder") ); sbSizer3->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer77->Add( sbSizer3, 1, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 3 ); + bSizer77->Add( sbSizer3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - bSizer94->Add( bSizer77, 0, wxEXPAND, 5 ); + bSizer94->Add( bSizer77, 0, wxEXPAND|wxLEFT, 3 ); m_panelTopRight->SetSizer( bSizer94 ); m_panelTopRight->Layout(); @@ -278,26 +261,16 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer1->Add( bSizer91, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer106 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapShift = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmapShift->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - m_bitmapShift->Hide(); - - bSizer106->Add( m_bitmapShift, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_scrolledWindowFolderPairs = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); m_scrolledWindowFolderPairs->SetScrollRate( 5, 5 ); m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); - bSizerFolderPairs = new wxBoxSizer( wxVERTICAL ); + bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); - m_scrolledWindowFolderPairs->SetSizer( bSizerFolderPairs ); + m_scrolledWindowFolderPairs->SetSizer( bSizerAddFolderPairs ); m_scrolledWindowFolderPairs->Layout(); - bSizerFolderPairs->Fit( m_scrolledWindowFolderPairs ); - bSizer106->Add( m_scrolledWindowFolderPairs, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer1->Add( bSizer106, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizerAddFolderPairs->Fit( m_scrolledWindowFolderPairs ); + bSizer1->Add( m_scrolledWindowFolderPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); @@ -411,14 +384,14 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer1->Add( bSizer2, 1, wxEXPAND, 5 ); - wxPanel* m_panel4; - m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxPanel* m_panelBottom; + m_panelBottom = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); bSizer3 = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bSizer120; bSizer120 = new wxBoxSizer( wxVERTICAL ); - m_notebookBottomLeft = new wxNotebook( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_notebookBottomLeft = new wxNotebook( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_panel30 = new wxPanel( m_notebookBottomLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer139; bSizer139 = new wxBoxSizer( wxHORIZONTAL ); @@ -481,7 +454,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer3->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - m_panel112 = new wxPanel( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel112 = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer64; bSizer64 = new wxBoxSizer( wxVERTICAL ); @@ -510,15 +483,27 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonRightOnly = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncCreateLeft = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncCreateLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDirLeft = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonSyncDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDeleteLeft = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDeleteLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDirNone = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonSyncDirNone, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDeleteRight = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDeleteRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDirRight = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonSyncDirRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncCreateRight = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncCreateRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonConflict = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); @@ -537,7 +522,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizerBottomRight->Add( 5, 0, 1, 0, 5 ); - m_panelSyncPreview = new wxPanel( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelSyncPreview = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer121; bSizer121 = new wxBoxSizer( wxVERTICAL ); @@ -613,7 +598,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer121->Fit( m_panelSyncPreview ); bSizerBottomRight->Add( m_panelSyncPreview, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButton10 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); + m_bpButton10 = new wxBitmapButton( m_panelBottom, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); m_bpButton10->SetToolTip( _("Quit") ); m_bpButton10->SetToolTip( _("Quit") ); @@ -622,10 +607,10 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer3->Add( bSizerBottomRight, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - m_panel4->SetSizer( bSizer3 ); - m_panel4->Layout(); - bSizer3->Fit( m_panel4 ); - bSizer1->Add( m_panel4, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_panelBottom->SetSizer( bSizer3 ); + m_panelBottom->Layout(); + bSizer3->Fit( m_panelBottom ); + bSizer1->Add( m_panelBottom, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_panel7 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); wxBoxSizer* bSizer451; @@ -705,8 +690,8 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const this->Connect( m_menuItem10->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); this->Connect( m_menuItem11->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); this->Connect( m_menuItemSwitchView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); - this->Connect( m_menuItem14->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuSaveConfig ) ); - this->Connect( m_menuItem13->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLoadConfig ) ); + this->Connect( m_menuItem14->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); + this->Connect( m_menuItem13->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); this->Connect( m_menuItemGlobSett->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); @@ -714,10 +699,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const this->Connect( m_menuItemCheckVer->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); - m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByTimeSize ), NULL, this ); - m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByContent ), NULL, this ); - m_bpButton14->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnShowHelpDialog ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); m_directoryLeft->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); @@ -751,9 +733,13 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncCreateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); m_bpButtonSyncDirLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDeleteLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); m_bpButtonSyncDirNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonSyncDeleteRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); m_bpButtonSyncDirRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonSyncCreateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); m_bpButton10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); } @@ -765,8 +751,8 @@ MainDialogGenerated::~MainDialogGenerated() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuSaveConfig ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLoadConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); @@ -774,10 +760,7 @@ MainDialogGenerated::~MainDialogGenerated() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); m_buttonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); - m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByTimeSize ), NULL, this ); - m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByContent ), NULL, this ); - m_bpButton14->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnShowHelpDialog ), NULL, this ); + m_bpButtonCmpConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); m_directoryLeft->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); @@ -811,9 +794,13 @@ MainDialogGenerated::~MainDialogGenerated() m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncCreateLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); m_bpButtonSyncDirLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDeleteLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); m_bpButtonSyncDirNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonSyncDeleteRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); m_bpButtonSyncDirRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonSyncCreateRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); m_bpButton10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); } @@ -824,21 +811,21 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer74 = new wxBoxSizer( wxHORIZONTAL ); m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxStaticBoxSizer* sbSizer21; - sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_panelLeft, wxID_ANY, wxEmptyString ), wxHORIZONTAL ); + wxBoxSizer* bSizer134; + bSizer134 = new wxBoxSizer( wxHORIZONTAL ); m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer21->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer134->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); m_dirPickerLeft->SetToolTip( _("Select a folder") ); - sbSizer21->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer134->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_panelLeft->SetSizer( sbSizer21 ); + m_panelLeft->SetSizer( bSizer134 ); m_panelLeft->Layout(); - sbSizer21->Fit( m_panelLeft ); - bSizer74->Add( m_panelLeft, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer134->Fit( m_panelLeft ); + bSizer74->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_panel20 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel20->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); @@ -847,13 +834,13 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer95 = new wxBoxSizer( wxHORIZONTAL ); m_panel21 = new wxPanel( m_panel20, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel21->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + m_panel21->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) ); wxBoxSizer* bSizer96; bSizer96 = new wxBoxSizer( wxVERTICAL ); - bSizer96->Add( 0, 15, 0, 0, 5 ); + bSizer96->Add( 0, 5, 0, 0, 5 ); m_bitmap23 = new wxStaticBitmap( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 44,17 ), 0 ); m_bitmap23->SetToolTip( _("Folder pair") ); @@ -871,33 +858,28 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer105; - bSizer105 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer135; + bSizer135 = new wxBoxSizer( wxHORIZONTAL ); m_bpButtonRemovePair = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - bSizer105->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); - - wxStaticBoxSizer* sbSizer23; - sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( m_panelRight, wxID_ANY, wxEmptyString ), wxHORIZONTAL ); + bSizer135->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer23->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer135->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); m_dirPickerRight->SetToolTip( _("Select a folder") ); - sbSizer23->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer105->Add( sbSizer23, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + bSizer135->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_panelRight->SetSizer( bSizer105 ); + m_panelRight->SetSizer( bSizer135 ); m_panelRight->Layout(); - bSizer105->Fit( m_panelRight ); - bSizer74->Add( m_panelRight, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer135->Fit( m_panelRight ); + bSizer74->Add( m_panelRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); this->SetSizer( bSizer74 ); this->Layout(); @@ -910,20 +892,62 @@ FolderPairGenerated::~FolderPairGenerated() BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - wxStaticBoxSizer* sbSizer20; - sbSizer20 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + wxBoxSizer* bSizer142; + bSizer142 = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizer9; - fgSizer9 = new wxFlexGridSizer( 2, 2, 5, 5 ); - fgSizer9->AddGrowableCol( 1 ); - fgSizer9->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + wxBoxSizer* bSizer140; + bSizer140 = new wxBoxSizer( wxHORIZONTAL ); - m_staticText53 = new wxStaticText( this, wxID_ANY, _("Left:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_panel32 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); + wxBoxSizer* bSizer147; + bSizer147 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer136; + bSizer136 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panel32, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer136->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer147->Add( bSizer136, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer143; + bSizer143 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer145; + bSizer145 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText53 = new wxStaticText( m_panel32, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText53->Wrap( -1 ); m_staticText53->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer9->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer145->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer145, 1, 0, 5 ); + + wxBoxSizer* bSizer146; + bSizer146 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText541 = new wxStaticText( m_panel32, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText541->Wrap( -1 ); + m_staticText541->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer146->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer146, 1, 0, 5 ); + + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_panel32->SetSizer( bSizer147 ); + m_panel32->Layout(); + bSizer147->Fit( m_panel32 ); + bSizer140->Add( m_panel32, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer144; + bSizer144 = new wxBoxSizer( wxVERTICAL ); m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer114; @@ -940,13 +964,7 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID m_panelLeft->SetSizer( bSizer114 ); m_panelLeft->Layout(); bSizer114->Fit( m_panelLeft ); - fgSizer9->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticText541 = new wxStaticText( this, wxID_ANY, _("Right:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText541->Wrap( -1 ); - m_staticText541->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - - fgSizer9->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer144->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer115; @@ -963,13 +981,18 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID m_panelRight->SetSizer( bSizer115 ); m_panelRight->Layout(); bSizer115->Fit( m_panelRight ); - fgSizer9->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer144->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer140->Add( bSizer144, 1, wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer20->Add( fgSizer9, 0, wxEXPAND, 5 ); + bSizer142->Add( bSizer140, 0, wxEXPAND, 5 ); - this->SetSizer( sbSizer20 ); + + bSizer142->Add( 0, 5, 0, 0, 5 ); + + this->SetSizer( bSizer142 ); this->Layout(); - sbSizer20->Fit( this ); + bSizer142->Fit( this ); } BatchFolderPairGenerated::~BatchFolderPairGenerated() @@ -1047,24 +1070,124 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_scrolledWindow6 = new wxScrolledWindow( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); m_scrolledWindow6->SetScrollRate( 5, 5 ); - bSizerFolderPairs = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer141; + bSizer141 = new wxBoxSizer( wxVERTICAL ); + + sbSizerMainPair = new wxBoxSizer( wxHORIZONTAL ); + + m_panelMainPair = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); + wxBoxSizer* bSizer147; + bSizer147 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer1361; + bSizer1361 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonAddPair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - m_scrolledWindow6->SetSizer( bSizerFolderPairs ); + bSizer1361->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); + + m_bpButtonRemoveTopPair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemoveTopPair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemoveTopPair->SetToolTip( _("Remove folder pair") ); + + bSizer1361->Add( m_bpButtonRemoveTopPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer147->Add( bSizer1361, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer143; + bSizer143 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer145; + bSizer145 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText532 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText532->Wrap( -1 ); + m_staticText532->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer145->Add( m_staticText532, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer145, 1, 0, 5 ); + + wxBoxSizer* bSizer146; + bSizer146 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText5411 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText5411->Wrap( -1 ); + m_staticText5411->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer146->Add( m_staticText5411, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer146, 1, 0, 5 ); + + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_panelMainPair->SetSizer( bSizer147 ); + m_panelMainPair->Layout(); + bSizer147->Fit( m_panelMainPair ); + sbSizerMainPair->Add( m_panelMainPair, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxVERTICAL ); + + m_panelLeft = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1141; + bSizer1141 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1141->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLeft->SetToolTip( _("Select a folder") ); + + bSizer1141->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelLeft->SetSizer( bSizer1141 ); + m_panelLeft->Layout(); + bSizer1141->Fit( m_panelLeft ); + bSizer158->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer115; + bSizer115 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer115->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerRight->SetToolTip( _("Select a folder") ); + + bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelRight->SetSizer( bSizer115 ); + m_panelRight->Layout(); + bSizer115->Fit( m_panelRight ); + bSizer158->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizerMainPair->Add( bSizer158, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + bSizer141->Add( sbSizerMainPair, 0, wxEXPAND, 5 ); + + bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); + + bSizer141->Add( bSizerAddFolderPairs, 0, wxEXPAND, 5 ); + + m_scrolledWindow6->SetSizer( bSizer141 ); m_scrolledWindow6->Layout(); - bSizerFolderPairs->Fit( m_scrolledWindow6 ); + bSizer141->Fit( m_scrolledWindow6 ); bSizer100->Add( m_scrolledWindow6, 0, wxEXPAND, 5 ); bSizer100->Add( 0, 10, 0, 0, 5 ); wxBoxSizer* bSizer57; - bSizer57 = new wxBoxSizer( wxHORIZONTAL ); + bSizer57 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer71; - bSizer71 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer721; - bSizer721 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer156; + bSizer156 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizer6; sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Compare by...") ), wxVERTICAL ); @@ -1080,25 +1203,10 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer6->Add( m_radioBtnContent, 0, wxTOP, 5 ); - bSizer721->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer156->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer721->Add( 0, 10, 0, 0, 5 ); - - wxStaticBoxSizer* sbSizer25; - sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Error handling") ), wxVERTICAL ); - - wxArrayString m_choiceHandleErrorChoices; - m_choiceHandleError = new wxChoice( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); - m_choiceHandleError->SetSelection( 0 ); - sbSizer25->Add( m_choiceHandleError, 0, wxALL, 5 ); - - bSizer721->Add( sbSizer25, 1, wxEXPAND, 5 ); - - bSizer71->Add( bSizer721, 0, 0, 5 ); - - - bSizer71->Add( 10, 0, 1, wxEXPAND, 5 ); + bSizer156->Add( 10, 10, 0, wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer24; sbSizer24 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1106,12 +1214,6 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); - m_checkBoxUseRecycler = new wxCheckBox( m_panelOverview, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - - sbSizer24->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_checkBoxFilter = new wxCheckBox( m_panelOverview, wxID_ANY, _("Filter files"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxFilter->SetToolTip( _("Enable filter to exclude files from synchronization") ); @@ -1127,15 +1229,57 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer71->Add( sbSizer24, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer156->Add( sbSizer24, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer57->Add( bSizer156, 0, 0, 5 ); - bSizer71->Add( 150, 0, 0, 0, 5 ); - bSizer57->Add( bSizer71, 0, wxEXPAND, 5 ); + bSizer57->Add( 10, 10, 0, 0, 5 ); + wxBoxSizer* bSizer721; + bSizer721 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbSizer25; + sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); + + wxArrayString m_choiceHandleErrorChoices; + m_choiceHandleError = new wxChoice( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); + m_choiceHandleError->SetSelection( 0 ); + sbSizer25->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer721->Add( sbSizer25, 0, wxEXPAND, 5 ); + + + bSizer721->Add( 10, 10, 0, 0, 5 ); - bSizer57->Add( 10, 0, 1, wxEXPAND, 5 ); + wxStaticBoxSizer* sbSizer23; + sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Deletion handling") ), wxVERTICAL ); + + wxArrayString m_choiceHandleDeletionChoices; + m_choiceHandleDeletion = new wxChoice( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleDeletionChoices, 0 ); + m_choiceHandleDeletion->SetSelection( 0 ); + sbSizer23->Add( m_choiceHandleDeletion, 0, wxBOTTOM, 5 ); + + m_panelCustomDeletionDir = new wxPanel( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1151; + bSizer1151 = new wxBoxSizer( wxHORIZONTAL ); + + m_textCtrlCustomDelFolder = new wxTextCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_RIGHT ); + m_textCtrlCustomDelFolder->SetMinSize( wxSize( 160,-1 ) ); + + bSizer1151->Add( m_textCtrlCustomDelFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerCustomDelFolder = new wxDirPickerCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1151->Add( m_dirPickerCustomDelFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelCustomDeletionDir->SetSizer( bSizer1151 ); + m_panelCustomDeletionDir->Layout(); + bSizer1151->Fit( m_panelCustomDeletionDir ); + sbSizer23->Add( m_panelCustomDeletionDir, 0, 0, 5 ); + + bSizer721->Add( sbSizer23, 0, wxEXPAND, 5 ); + + bSizer57->Add( bSizer721, 0, 0, 5 ); bSizer100->Add( bSizer57, 0, 0, 5 ); @@ -1389,12 +1533,14 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemoveTopPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this ); m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this ); - m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); m_checkBoxFilter->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckFilter ), NULL, this ); m_checkBoxSilent->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckLogging ), NULL, this ); + m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeDeletionHandling ), NULL, this ); m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); @@ -1409,12 +1555,14 @@ BatchDlgGenerated::~BatchDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemoveTopPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this ); m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this ); - m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); m_checkBoxFilter->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckFilter ), NULL, this ); m_checkBoxSilent->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckLogging ), NULL, this ); + m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeDeletionHandling ), NULL, this ); m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); @@ -1552,14 +1700,14 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, bSizer48->Add( m_staticText30, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - m_textCtrlFilename = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - m_textCtrlFilename->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_textCtrlStatus = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + m_textCtrlStatus->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - bSizer48->Add( m_textCtrlFilename, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer48->Add( m_textCtrlStatus, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); bSizer40->Add( bSizer48, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); + m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); bSizer40->Add( m_gauge2, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( bSizer40 ); @@ -1571,7 +1719,7 @@ CompareStatusGenerated::~CompareStatusGenerated() { } -SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -1676,17 +1824,45 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr bSizer201 = new wxBoxSizer( wxHORIZONTAL ); - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticBoxSizer* sbSizer27; + sbSizer27 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); + + wxArrayString m_choiceHandleErrorChoices; + m_choiceHandleError = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); + m_choiceHandleError->SetSelection( 0 ); + sbSizer27->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer201->Add( sbSizer27, 0, wxEXPAND, 5 ); + + + bSizer201->Add( 10, 0, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer231; + sbSizer231 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Deletion handling") ), wxVERTICAL ); - m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); + wxArrayString m_choiceHandleDeletionChoices; + m_choiceHandleDeletion = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleDeletionChoices, 0 ); + m_choiceHandleDeletion->SetSelection( 0 ); + sbSizer231->Add( m_choiceHandleDeletion, 0, wxBOTTOM, 5 ); - bSizer201->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_panelCustomDeletionDir = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1151; + bSizer1151 = new wxBoxSizer( wxHORIZONTAL ); - m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore errors"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCustomDelFolder = new wxTextCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_RIGHT ); + m_textCtrlCustomDelFolder->SetMinSize( wxSize( 160,-1 ) ); - m_checkBoxIgnoreErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); + bSizer1151->Add( m_textCtrlCustomDelFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer201->Add( m_checkBoxIgnoreErrors, 0, wxALL, 5 ); + m_dirPickerCustomDelFolder = new wxDirPickerCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1151->Add( m_dirPickerCustomDelFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelCustomDeletionDir->SetSizer( bSizer1151 ); + m_panelCustomDeletionDir->Layout(); + bSizer1151->Fit( m_panelCustomDeletionDir ); + sbSizer231->Add( m_panelCustomDeletionDir, 0, 0, 5 ); + + bSizer201->Add( sbSizer231, 0, wxEXPAND, 5 ); bSizer29->Add( bSizer201, 0, wxTOP|wxBOTTOM, 5 ); @@ -1696,11 +1872,11 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr wxBoxSizer* bSizer291; bSizer291 = new wxBoxSizer( wxHORIZONTAL ); - m_button6 = new wxButton( this, wxID_OK, _("&Apply"), wxDefaultPosition, wxSize( 120,35 ), 0 ); - m_button6->SetDefault(); - m_button6->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonApply = new wxButton( this, wxID_OK, _("&Apply"), wxDefaultPosition, wxSize( 120,35 ), 0 ); + m_buttonApply->SetDefault(); + m_buttonApply->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer291->Add( m_buttonApply, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button16->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); @@ -1836,43 +2012,136 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr this->Centre( wxBOTH ); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtnUpdate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); - m_buttonUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); - m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); - m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnApply ), NULL, this ); - m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); - m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); - m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); - m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); + m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtnUpdate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_buttonUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCostum ), NULL, this ); + m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); + m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); + m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); + m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); +} + +SyncCfgDlgGenerated::~SyncCfgDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); + m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtnUpdate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCostum ), NULL, this ); + m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); + m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); + m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); + m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); +} + +CmpCfgDlgGenerated::CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer136; + bSizer136 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer55; + bSizer55 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer16; + fgSizer16 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer16->SetFlexibleDirection( wxBOTH ); + fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_radioBtnSizeDate->SetValue( true ); + m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same.") ); + + fgSizer16->Add( m_radioBtnSizeDate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonTimeSize = new wxButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonTimeSize->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonTimeSize->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same.") ); + + fgSizer16->Add( m_buttonTimeSize, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_radioBtnContent = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); + + fgSizer16->Add( m_radioBtnContent, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonContent = new wxButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonContent->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); + + fgSizer16->Add( m_buttonContent, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + sbSizer6->Add( fgSizer16, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + sbSizer6->Add( m_staticline14, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_bpButtonHelp = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonHelp->SetToolTip( _("Help") ); + + m_bpButtonHelp->SetToolTip( _("Help") ); + + sbSizer6->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 2 ); + + + bSizer55->Add( 0, 4, 0, 0, 5 ); + + m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer55->Add( m_button6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer136->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + this->SetSizer( bSizer136 ); + this->Layout(); + bSizer136->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); + m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_buttonTimeSize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_buttonContent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); } -SyncDlgGenerated::~SyncDlgGenerated() +CmpCfgDlgGenerated::~CmpCfgDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtnUpdate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); - m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); - m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); - m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); - m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnApply ), NULL, this ); - m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); - m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); - m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); - m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); + m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_buttonTimeSize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_buttonContent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); } SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -2306,34 +2575,33 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer53; bSizer53 = new wxBoxSizer( wxVERTICAL ); - m_scrolledWindow4 = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); - m_scrolledWindow4->SetScrollRate( 5, 5 ); - m_scrolledWindow4->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - m_scrolledWindow4->SetMinSize( wxSize( -1,125 ) ); + m_scrolledWindowCodeInfo = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); + m_scrolledWindowCodeInfo->SetScrollRate( 5, 5 ); + m_scrolledWindowCodeInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_scrolledWindowCodeInfo->SetMinSize( wxSize( -1,125 ) ); - wxBoxSizer* bSizer73; - bSizer73 = new wxBoxSizer( wxVERTICAL ); + bSizerCodeInfo = new wxBoxSizer( wxVERTICAL ); - m_staticText72 = new wxStaticText( m_scrolledWindow4, wxID_ANY, _("Source code written completely in C++ utilizing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText72 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _("Source code written completely in C++ utilizing:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText72->Wrap( -1 ); m_staticText72->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer73->Add( m_staticText72, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizerCodeInfo->Add( m_staticText72, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); - m_staticText73 = new wxStaticText( m_scrolledWindow4, wxID_ANY, _(" MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText73 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _(" MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText73->Wrap( -1 ); - bSizer73->Add( m_staticText73, 0, wxEXPAND|wxALL, 5 ); + bSizerCodeInfo->Add( m_staticText73, 0, wxALL|wxEXPAND, 5 ); - m_staticText74 = new wxStaticText( m_scrolledWindow4, wxID_ANY, _("- ZenJu -"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText74 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _("- ZenJu -"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText74->Wrap( -1 ); m_staticText74->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); - bSizer73->Add( m_staticText74, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizerCodeInfo->Add( m_staticText74, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_scrolledWindow4->SetSizer( bSizer73 ); - m_scrolledWindow4->Layout(); - bSizer73->Fit( m_scrolledWindow4 ); - bSizer53->Add( m_scrolledWindow4, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 10 ); + m_scrolledWindowCodeInfo->SetSizer( bSizerCodeInfo ); + m_scrolledWindowCodeInfo->Layout(); + bSizerCodeInfo->Fit( m_scrolledWindowCodeInfo ); + bSizer53->Add( m_scrolledWindowCodeInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 10 ); m_scrolledWindowTranslators = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); m_scrolledWindowTranslators->SetScrollRate( 5, 5 ); @@ -2361,69 +2629,71 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_scrolledWindowTranslators->SetSizer( bSizerTranslators ); m_scrolledWindowTranslators->Layout(); bSizerTranslators->Fit( m_scrolledWindowTranslators ); - bSizer53->Add( m_scrolledWindowTranslators, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer53->Add( m_scrolledWindowTranslators, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 5 ); - bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 25 ); + bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 25 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_panel22 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER ); - wxBoxSizer* bSizer104; - bSizer104 = new wxBoxSizer( wxVERTICAL ); - - m_staticText131 = new wxStaticText( m_panel22, wxID_ANY, _("Feedback and suggestions are welcome at:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText131 = new wxStaticText( this, wxID_ANY, _("Feedback and suggestions are welcome at:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText131->Wrap( -1 ); m_staticText131->SetFont( wxFont( 11, 74, 93, 92, false, wxT("Tahoma") ) ); - bSizer104->Add( m_staticText131, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); + bSizer31->Add( m_staticText131, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer31->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_staticline12 = new wxStaticLine( m_panel22, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer104->Add( m_staticline12, 0, wxEXPAND | wxALL, 5 ); + wxBoxSizer* bSizer104; + bSizer104 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizer103; bSizer103 = new wxBoxSizer( wxHORIZONTAL ); - m_bitmap9 = new wxStaticBitmap( m_panel22, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap9->SetToolTip( _("FreeFileSync at Sourceforge") ); - bSizer103->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer103->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_hyperlink1 = new wxHyperlinkCtrl( m_panel22, wxID_ANY, _("Homepage"), wxT("http://sourceforge.net/projects/freefilesync/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink1 = new wxHyperlinkCtrl( this, wxID_ANY, _("Homepage"), wxT("http://sourceforge.net/projects/freefilesync/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlink1->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); m_hyperlink1->SetToolTip( _("http://sourceforge.net/projects/freefilesync/") ); bSizer103->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer103->Add( 30, 0, 1, wxEXPAND, 5 ); + bSizer103->Add( 20, 0, 1, wxEXPAND, 5 ); + + m_hyperlink6 = new wxHyperlinkCtrl( this, wxID_ANY, _("Report translation error"), wxT("http://sourceforge.net/forum/forum.php?forum_id=976976"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink6->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); + m_hyperlink6->SetToolTip( _("https://sourceforge.net/forum/forum.php?forum_id=976976") ); + + bSizer103->Add( m_hyperlink6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer104->Add( bSizer103, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_bitmap10 = new wxStaticBitmap( m_panel22, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + wxBoxSizer* bSizer108; + bSizer108 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap10->SetToolTip( _("Email") ); - bSizer103->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer108->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_hyperlink2 = new wxHyperlinkCtrl( m_panel22, wxID_ANY, _("Email"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, _("Email"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlink2->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); m_hyperlink2->SetToolTip( _("zhnmju123@gmx.de") ); - bSizer103->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer104->Add( bSizer103, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer108->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_panel22->SetSizer( bSizer104 ); - m_panel22->Layout(); - bSizer104->Fit( m_panel22 ); - bSizer31->Add( m_panel22, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - wxBoxSizer* bSizer108; - bSizer108 = new wxBoxSizer( wxHORIZONTAL ); + bSizer108->Add( 30, 0, 1, wxEXPAND, 5 ); m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation); - m_animationControl1->Hide(); m_animationControl1->SetToolTip( _("Donate with PayPal") ); - bSizer108->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer108->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink3 = new wxHyperlinkCtrl( this, wxID_ANY, _("If you like FFS"), wxT("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123%40gmx%2ede&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlink3->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); @@ -2431,7 +2701,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer108->Add( m_hyperlink3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - bSizer31->Add( bSizer108, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer104->Add( bSizer108, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + bSizer31->Add( bSizer104, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer31->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); @@ -2453,11 +2725,11 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - m_button8 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_button8->SetDefault(); - m_button8->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer31->Add( m_button8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer31->Add( m_buttonOkay, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); this->SetSizer( bSizer31 ); this->Layout(); @@ -2467,14 +2739,14 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); - m_button8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); } AboutDlgGenerated::~AboutDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); - m_button8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); + m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); } ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -2872,7 +3144,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer66; bSizer66 = new wxBoxSizer( wxHORIZONTAL ); - m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: \\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText181->Wrap( -1 ); bSizer66->Add( m_staticText181, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -3162,16 +3434,12 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind wxBoxSizer* bSizer104; bSizer104 = new wxBoxSizer( wxHORIZONTAL ); - m_staticText97 = new wxStaticText( this, wxID_ANY, _("File Manager integration:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText97->Wrap( -1 ); - m_staticText97->SetToolTip( _("This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file.") ); - - bSizer104->Add( m_staticText97, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlFileManager = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 150,-1 ), 0 ); - m_textCtrlFileManager->SetToolTip( _("This commandline will be executed each time you doubleclick on a filename. %name serves as a placeholder for the selected file.") ); + m_staticTextCommand = new wxStaticText( this, wxID_ANY, _("File Manager integration:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCommand->Wrap( -1 ); + bSizer104->Add( m_staticTextCommand, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer104->Add( m_textCtrlFileManager, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 150,-1 ), 0 ); + bSizer104->Add( m_textCtrlCommand, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); sbSizer23->Add( bSizer104, 1, wxEXPAND, 5 ); @@ -3204,11 +3472,11 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind wxBoxSizer* bSizer97; bSizer97 = new wxBoxSizer( wxHORIZONTAL ); - m_button28 = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button28->SetDefault(); - m_button28->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer97->Add( m_button28, 0, wxALL, 5 ); + bSizer97->Add( m_buttonOkay, 0, wxALL, 5 ); m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button9->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); @@ -3229,7 +3497,7 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); m_buttonResetWarnings->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetWarnings ), NULL, this ); - m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); } @@ -3239,7 +3507,7 @@ GlobalSettingsDlgGenerated::~GlobalSettingsDlgGenerated() // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); m_buttonResetWarnings->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetWarnings ), NULL, this ); - m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); } @@ -3251,6 +3519,19 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i wxBoxSizer* bSizer134; bSizer134 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonStartSync = new wxButtonWithImage( this, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonStartSync->SetDefault(); + m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonStartSync->SetToolTip( _("Start synchronization") ); + + bSizer158->Add( m_buttonStartSync, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline16 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer158->Add( m_staticline16, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + wxStaticBoxSizer* sbSizer28; sbSizer28 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Variant") ), wxVERTICAL ); @@ -3260,88 +3541,142 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i sbSizer28->Add( m_staticTextVariant, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer134->Add( sbSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer158->Add( sbSizer28, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizer141; - bSizer141 = new wxBoxSizer( wxHORIZONTAL ); + bSizer134->Add( bSizer158, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_buttonStartSync = new wxButtonWithImage( this, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); - m_buttonStartSync->SetDefault(); - m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); - m_buttonStartSync->SetToolTip( _("Start synchronization") ); + m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline14, 0, wxEXPAND, 5 ); - bSizer141->Add( m_buttonStartSync, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer141->Add( m_staticline14, 0, wxEXPAND|wxRIGHT, 5 ); - - - bSizer141->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer141; + bSizer141 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizer161; - sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Statistics") ), wxHORIZONTAL ); + sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Statistics") ), wxVERTICAL ); + + wxBoxSizer* bSizer157; + bSizer157 = new wxBoxSizer( wxHORIZONTAL ); wxFlexGridSizer* fgSizer5; fgSizer5 = new wxFlexGridSizer( 4, 2, 0, 5 ); fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + fgSizer5->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText94 = new wxStaticText( this, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText94->Wrap( -1 ); + m_staticText94->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + fgSizer5->Add( m_staticText94, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bitmapCreate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_textCtrlCreate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlCreate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); - m_textCtrlCreate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); + m_textCtrlCreateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreateL->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlCreateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreateL->SetToolTip( _("Number of files and directories that will be created") ); - fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer5->Add( m_textCtrlCreateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapUpdate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlUpdateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdateL->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlUpdateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdateL->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer5->Add( m_textCtrlUpdateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_bitmapDelete = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_textCtrlDelete = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlDelete->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); - m_textCtrlDelete->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); + m_textCtrlDeleteL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDeleteL->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlDeleteL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDeleteL->SetToolTip( _("Number of files and directories that will be deleted") ); - fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer5->Add( m_textCtrlDeleteL, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_bitmapUpdate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); + bSizer157->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + wxFlexGridSizer* fgSizer51; + fgSizer51 = new wxFlexGridSizer( 3, 1, 0, 5 ); + fgSizer51->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer51->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_textCtrlUpdate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlUpdate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); - m_textCtrlUpdate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); + m_staticText95 = new wxStaticText( this, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText95->Wrap( -1 ); + m_staticText95->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + fgSizer51->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlCreateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreateR->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlCreateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreateR->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer51->Add( m_textCtrlCreateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlUpdateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdateR->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlUpdateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdateR->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer51->Add( m_textCtrlUpdateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlDeleteR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDeleteR->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlDeleteR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDeleteR->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer51->Add( m_textCtrlDeleteR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer157->Add( fgSizer51, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizer5->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer161->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + sbSizer161->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer156; + bSizer156 = new wxBoxSizer( wxHORIZONTAL ); m_bitmapData = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); - fgSizer5->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer156->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); + + + bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); m_textCtrlData->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); - fgSizer5->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer156->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer161->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - bSizer141->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); + + sbSizer161->Add( bSizer156, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bSizer141->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - bSizer134->Add( bSizer141, 0, wxEXPAND, 5 ); + bSizer134->Add( bSizer141, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline12, 0, wxEXPAND|wxBOTTOM, 5 ); + bSizer134->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxBoxSizer* bSizer142; bSizer142 = new wxBoxSizer( wxHORIZONTAL ); @@ -3377,3 +3712,27 @@ SyncPreviewDlgGenerated::~SyncPreviewDlgGenerated() m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnStartSync ), NULL, this ); m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnCancel ), NULL, this ); } + +PopupFrameGenerated1::PopupFrameGenerated1( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxColour( 255, 255, 255 ) ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextMain = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextMain->Wrap( -1 ); + bSizer158->Add( m_staticTextMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizer158 ); + this->Layout(); + bSizer158->Fit( this ); +} + +PopupFrameGenerated1::~PopupFrameGenerated1() +{ +} diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index 5230128b..79c07c47 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -24,25 +24,25 @@ class wxButtonWithImage; #include <wx/font.h> #include <wx/colour.h> #include <wx/settings.h> +#include <wx/stattext.h> #include <wx/button.h> #include <wx/sizer.h> -#include <wx/radiobut.h> #include <wx/bmpbuttn.h> -#include <wx/statbox.h> -#include <wx/stattext.h> #include <wx/panel.h> #include <wx/combobox.h> #include <wx/filepicker.h> -#include <wx/statbmp.h> +#include <wx/statbox.h> #include <wx/scrolwin.h> #include <wx/grid.h> #include <wx/choice.h> #include <wx/hyperlink.h> #include <wx/checkbox.h> #include <wx/notebook.h> +#include <wx/statbmp.h> #include <wx/textctrl.h> #include <wx/statline.h> #include <wx/frame.h> +#include <wx/radiobut.h> #include <wx/dialog.h> #include <wx/gauge.h> #include <wx/animate.h> @@ -76,15 +76,14 @@ class MainDialogGenerated : public wxFrame wxPanel* m_panel71; wxBoxSizer* bSizer6; + wxStaticText* m_staticTextCmpVariant; + wxButtonWithImage* m_buttonCompare; wxButton* m_buttonAbort; - wxRadioButton* m_radioBtnSizeDate; - wxRadioButton* m_radioBtnContent; - wxBitmapButton* m_bpButton14; - + wxBitmapButton* m_bpButtonCmpConfig; - wxStaticText* m_staticTextVariant; + wxStaticText* m_staticTextSyncVariant; wxBitmapButton* m_bpButtonSyncConfig; wxButtonWithImage* m_buttonStartSync; @@ -101,10 +100,8 @@ class MainDialogGenerated : public wxFrame wxBitmapButton* m_bpButtonRemoveTopPair; wxComboBox* m_directoryRight; wxDirPickerCtrl* m_dirPickerRight; - wxBoxSizer* bSizer106; - wxStaticBitmap* m_bitmapShift; wxScrolledWindow* m_scrolledWindowFolderPairs; - wxBoxSizer* bSizerFolderPairs; + wxBoxSizer* bSizerAddFolderPairs; wxPanel* m_panelLeft; CustomGridLeft* m_gridLeft; wxPanel* m_panelMiddle; @@ -129,9 +126,13 @@ class MainDialogGenerated : public wxFrame wxBitmapButton* m_bpButtonDifferent; wxBitmapButton* m_bpButtonRightNewer; wxBitmapButton* m_bpButtonRightOnly; + wxBitmapButton* m_bpButtonSyncCreateLeft; wxBitmapButton* m_bpButtonSyncDirLeft; + wxBitmapButton* m_bpButtonSyncDeleteLeft; wxBitmapButton* m_bpButtonSyncDirNone; + wxBitmapButton* m_bpButtonSyncDeleteRight; wxBitmapButton* m_bpButtonSyncDirRight; + wxBitmapButton* m_bpButtonSyncCreateRight; wxBitmapButton* m_bpButtonConflict; wxBoxSizer* bSizerBottomRight; @@ -165,18 +166,15 @@ class MainDialogGenerated : public wxFrame virtual void OnCompare( wxCommandEvent& event ){ event.Skip(); } virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } virtual void OnSwitchView( wxCommandEvent& event ){ event.Skip(); } - virtual void OnMenuSaveConfig( wxCommandEvent& event ){ event.Skip(); } - virtual void OnMenuLoadConfig( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSaveConfig( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLoadConfig( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuQuit( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuGlobalSettings( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuBatchJob( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuCheckVersion( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuAbout( wxCommandEvent& event ){ event.Skip(); } - virtual void OnAbortCompare( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCompareByTimeSize( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCompareByContent( wxCommandEvent& event ){ event.Skip(); } - virtual void OnShowHelpDialog( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCmpSettings( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncSettings( wxCommandEvent& event ){ event.Skip(); } virtual void OnFolderHistoryKeyEvent( wxKeyEvent& event ){ event.Skip(); } virtual void OnDirSelected( wxFileDirPickerEvent& event ){ event.Skip(); } @@ -193,8 +191,6 @@ class MainDialogGenerated : public wxFrame virtual void OnRightGridDoubleClick( wxGridEvent& event ){ event.Skip(); } virtual void OnSortRightGrid( wxGridEvent& event ){ event.Skip(); } virtual void OnContextRimLabelRight( wxGridEvent& event ){ event.Skip(); } - virtual void OnSaveConfig( wxCommandEvent& event ){ event.Skip(); } - virtual void OnLoadConfig( wxCommandEvent& event ){ event.Skip(); } virtual void OnCfgHistoryKeyEvent( wxKeyEvent& event ){ event.Skip(); } virtual void OnLoadFromHistory( wxCommandEvent& event ){ event.Skip(); } virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); } @@ -206,9 +202,13 @@ class MainDialogGenerated : public wxFrame virtual void OnDifferentFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightNewerFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightOnlyFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncCreateLeft( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncDirLeft( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDeleteLeft( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncDirNone( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDeleteRight( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncDirRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncCreateRight( wxCommandEvent& event ){ event.Skip(); } virtual void OnConflictFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); } @@ -253,12 +253,15 @@ class BatchFolderPairGenerated : public wxPanel private: protected: + wxPanel* m_panel32; wxStaticText* m_staticText53; - wxPanel* m_panelLeft; wxStaticText* m_staticText541; + wxPanel* m_panelLeft; wxPanel* m_panelRight; + public: + wxBitmapButton* m_bpButtonRemovePair; wxTextCtrl* m_directoryLeft; wxDirPickerCtrl* m_dirPickerLeft; wxTextCtrl* m_directoryRight; @@ -289,20 +292,28 @@ class BatchDlgGenerated : public wxDialog wxNotebook* m_notebookSettings; wxPanel* m_panelOverview; wxScrolledWindow* m_scrolledWindow6; - wxBoxSizer* bSizerFolderPairs; + wxBoxSizer* sbSizerMainPair; + wxPanel* m_panelMainPair; + wxStaticText* m_staticText532; + wxStaticText* m_staticText5411; + wxPanel* m_panelLeft; + wxPanel* m_panelRight; + wxBoxSizer* bSizerAddFolderPairs; wxRadioButton* m_radioBtnSizeDate; wxRadioButton* m_radioBtnContent; - wxChoice* m_choiceHandleError; - - wxCheckBox* m_checkBoxUseRecycler; wxCheckBox* m_checkBoxFilter; wxCheckBox* m_checkBoxSilent; + wxChoice* m_choiceHandleError; + wxChoice* m_choiceHandleDeletion; + wxPanel* m_panelCustomDeletionDir; + wxTextCtrl* m_textCtrlCustomDelFolder; + wxDirPickerCtrl* m_dirPickerCustomDelFolder; wxStaticText* m_staticText21; wxStaticText* m_staticText31; @@ -341,11 +352,13 @@ class BatchDlgGenerated : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnAddFolderPair( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveTopFolderPair( wxCommandEvent& event ){ event.Skip(); } virtual void OnChangeCompareVar( wxCommandEvent& event ){ event.Skip(); } - virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } virtual void OnCheckFilter( wxCommandEvent& event ){ event.Skip(); } virtual void OnCheckLogging( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeDeletionHandling( wxCommandEvent& event ){ event.Skip(); } virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } @@ -357,6 +370,12 @@ class BatchDlgGenerated : public wxDialog public: + wxBitmapButton* m_bpButtonAddPair; + wxBitmapButton* m_bpButtonRemoveTopPair; + wxTextCtrl* m_directoryLeft; + wxDirPickerCtrl* m_dirPickerLeft; + wxTextCtrl* m_directoryRight; + wxDirPickerCtrl* m_dirPickerRight; BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create a batch job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~BatchDlgGenerated(); @@ -387,7 +406,7 @@ class CompareStatusGenerated : public wxPanel wxStaticText* m_staticText37; wxStaticText* m_staticTextTimeElapsed; wxStaticText* m_staticText30; - wxTextCtrl* m_textCtrlFilename; + wxTextCtrl* m_textCtrlStatus; wxGauge* m_gauge2; public: @@ -397,9 +416,9 @@ class CompareStatusGenerated : public wxPanel }; /////////////////////////////////////////////////////////////////////////////// -/// Class SyncDlgGenerated +/// Class SyncCfgDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncDlgGenerated : public wxDialog +class SyncCfgDlgGenerated : public wxDialog { private: @@ -421,10 +440,14 @@ class SyncDlgGenerated : public wxDialog wxStaticText* m_staticText9; wxBoxSizer* bSizer201; - wxCheckBox* m_checkBoxUseRecycler; - wxCheckBox* m_checkBoxIgnoreErrors; + wxChoice* m_choiceHandleError; - wxButton* m_button6; + wxChoice* m_choiceHandleDeletion; + wxPanel* m_panelCustomDeletionDir; + wxTextCtrl* m_textCtrlCustomDelFolder; + wxDirPickerCtrl* m_dirPickerCustomDelFolder; + + wxButton* m_buttonApply; wxButton* m_button16; @@ -453,7 +476,8 @@ class SyncDlgGenerated : public wxDialog virtual void OnSyncUpdate( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncBothSides( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncCostum( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeDeletionHandling( wxCommandEvent& event ){ event.Skip(); } virtual void OnApply( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } @@ -464,8 +488,39 @@ class SyncDlgGenerated : public wxDialog public: - SyncDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~SyncDlgGenerated(); + SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~SyncCfgDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class CmpCfgDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class CmpCfgDlgGenerated : public wxDialog +{ + private: + + protected: + wxRadioButton* m_radioBtnSizeDate; + wxButton* m_buttonTimeSize; + wxRadioButton* m_radioBtnContent; + wxButton* m_buttonContent; + wxStaticLine* m_staticline14; + wxBitmapButton* m_bpButtonHelp; + + wxButton* m_button6; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnTimeSize( wxCommandEvent& event ){ event.Skip(); } + virtual void OnContent( wxCommandEvent& event ){ event.Skip(); } + virtual void OnShowHelp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Comparison settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~CmpCfgDlgGenerated(); }; @@ -588,7 +643,8 @@ class AboutDlgGenerated : public wxDialog wxStaticText* m_staticText15; wxStaticText* m_build; - wxScrolledWindow* m_scrolledWindow4; + wxScrolledWindow* m_scrolledWindowCodeInfo; + wxBoxSizer* bSizerCodeInfo; wxStaticText* m_staticText72; wxStaticText* m_staticText73; wxStaticText* m_staticText74; @@ -598,14 +654,15 @@ class AboutDlgGenerated : public wxDialog wxFlexGridSizer* fgSizerTranslators; wxStaticLine* m_staticline3; - wxPanel* m_panel22; wxStaticText* m_staticText131; wxStaticLine* m_staticline12; wxStaticBitmap* m_bitmap9; wxHyperlinkCtrl* m_hyperlink1; + wxHyperlinkCtrl* m_hyperlink6; wxStaticBitmap* m_bitmap10; wxHyperlinkCtrl* m_hyperlink2; + wxAnimationCtrl* m_animationControl1; wxHyperlinkCtrl* m_hyperlink3; wxStaticLine* m_staticline2; @@ -613,7 +670,7 @@ class AboutDlgGenerated : public wxDialog wxStaticBitmap* m_bitmap13; wxHyperlinkCtrl* m_hyperlink5; - wxButton* m_button8; + wxButton* m_buttonOkay; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } @@ -652,7 +709,7 @@ class ErrorDlgGenerated : public wxDialog public: - ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Error"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 404,268 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Error"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,270 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~ErrorDlgGenerated(); }; @@ -682,7 +739,7 @@ class WarningDlgGenerated : public wxDialog public: wxStaticBitmap* m_bitmap10; - WarningDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Warning"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 382,249 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + WarningDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Warning"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,270 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~WarningDlgGenerated(); }; @@ -713,7 +770,7 @@ class QuestionDlgGenerated : public wxDialog public: - QuestionDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Question"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 391,237 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + QuestionDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Question"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,260 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~QuestionDlgGenerated(); }; @@ -853,14 +910,14 @@ class GlobalSettingsDlgGenerated : public wxDialog wxCheckBox* m_checkBoxIgnoreOneHour; wxStaticLine* m_staticline10; - wxStaticText* m_staticText97; - wxTextCtrl* m_textCtrlFileManager; + wxStaticText* m_staticTextCommand; + wxTextCtrl* m_textCtrlCommand; wxStaticLine* m_staticline101; wxStaticText* m_staticText100; wxButtonWithImage* m_buttonResetWarnings; - wxButton* m_button28; + wxButton* m_buttonOkay; wxButton* m_button9; wxButton* m_button29; @@ -886,18 +943,27 @@ class SyncPreviewDlgGenerated : public wxDialog private: protected: - wxStaticText* m_staticTextVariant; wxButtonWithImage* m_buttonStartSync; + wxStaticLine* m_staticline16; + wxStaticText* m_staticTextVariant; wxStaticLine* m_staticline14; + wxStaticText* m_staticText94; wxStaticBitmap* m_bitmapCreate; - wxTextCtrl* m_textCtrlCreate; - wxStaticBitmap* m_bitmapDelete; - wxTextCtrl* m_textCtrlDelete; + wxTextCtrl* m_textCtrlCreateL; wxStaticBitmap* m_bitmapUpdate; - wxTextCtrl* m_textCtrlUpdate; + wxTextCtrl* m_textCtrlUpdateL; + wxStaticBitmap* m_bitmapDelete; + wxTextCtrl* m_textCtrlDeleteL; + wxStaticText* m_staticText95; + wxTextCtrl* m_textCtrlCreateR; + wxTextCtrl* m_textCtrlUpdateR; + wxTextCtrl* m_textCtrlDeleteR; + wxStaticBitmap* m_bitmapData; + wxTextCtrl* m_textCtrlData; + wxStaticLine* m_staticline12; wxCheckBox* m_checkBoxDontShowAgain; @@ -915,4 +981,21 @@ class SyncPreviewDlgGenerated : public wxDialog }; +/////////////////////////////////////////////////////////////////////////////// +/// Class PopupFrameGenerated1 +/////////////////////////////////////////////////////////////////////////////// +class PopupFrameGenerated1 : public wxFrame +{ + private: + + protected: + + public: + wxStaticBitmap* m_bitmapLeft; + wxStaticText* m_staticTextMain; + PopupFrameGenerated1( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxSTATIC_BORDER ); + ~PopupFrameGenerated1(); + +}; + #endif //__guiGenerated__ diff --git a/ui/guiStatusHandler.cpp b/ui/guiStatusHandler.cpp index 7929c122..280328da 100644 --- a/ui/guiStatusHandler.cpp +++ b/ui/guiStatusHandler.cpp @@ -1,8 +1,8 @@ #include "guiStatusHandler.h" -#include "../library/customButton.h" #include "smallDialogs.h" -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" #include "mainDialog.h" +#include <wx/wupdlock.h> CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : @@ -10,47 +10,10 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : ignoreErrors(false), currentProcess(StatusHandler::PROCESS_NONE) { + wxWindowUpdateLocker dummy(mainDialog); //avoid display distortion + //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled - //it's not nice, but works - mainDialog->m_notebookBottomLeft->Disable(); - mainDialog->m_radioBtnSizeDate->Disable(); - mainDialog->m_radioBtnContent->Disable(); - mainDialog->m_bpButtonFilter->Disable(); - mainDialog->m_hyperlinkCfgFilter->Disable(); - mainDialog->m_checkBoxHideFilt->Disable(); - mainDialog->m_bpButtonSyncConfig->Disable(); - mainDialog->m_buttonStartSync->Disable(); - mainDialog->m_dirPickerLeft->Disable(); - mainDialog->m_dirPickerRight->Disable(); - mainDialog->m_bpButtonSwapSides->Disable(); - mainDialog->m_bpButtonLeftOnly->Disable(); - mainDialog->m_bpButtonLeftNewer->Disable(); - mainDialog->m_bpButtonEqual->Disable(); - mainDialog->m_bpButtonDifferent->Disable(); - mainDialog->m_bpButtonRightNewer->Disable(); - mainDialog->m_bpButtonRightOnly->Disable(); - mainDialog->m_panelLeft->Disable(); - mainDialog->m_panelMiddle->Disable(); - mainDialog->m_panelRight->Disable(); - mainDialog->m_panelTopLeft->Disable(); - mainDialog->m_panelTopMiddle->Disable(); - mainDialog->m_panelTopRight->Disable(); - mainDialog->m_bpButtonSave->Disable(); - mainDialog->m_bpButtonLoad->Disable(); - mainDialog->m_choiceHistory->Disable(); - mainDialog->m_bpButton10->Disable(); - mainDialog->m_bpButton14->Disable(); - mainDialog->m_scrolledWindowFolderPairs->Disable(); - mainDialog->m_menubar1->EnableTop(0, false); - mainDialog->m_menubar1->EnableTop(1, false); - mainDialog->m_menubar1->EnableTop(2, false); - - //show abort button - mainDialog->m_buttonAbort->Enable(); - mainDialog->m_buttonAbort->Show(); - mainDialog->m_buttonCompare->Disable(); - mainDialog->m_buttonCompare->Hide(); - mainDialog->m_buttonAbort->SetFocus(); + mainDialog->disableAllElements(); //display status panel during compare mainDialog->compareStatus->init(); //clear old values @@ -59,65 +22,34 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : mainDialog->bSizer1->Layout(); //both sizers need to recalculate! mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage mainDialog->Refresh(); + + //register abort button + mainDialog->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this ); } CompareStatusHandler::~CompareStatusHandler() { - //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between - //gridDataView and currentGridData!! avoid grid repaint at all costs!! + //ATTENTION: wxAPP->Yield() is called! at this point in time there is a mismatch between + //gridDataView and currentGridData!! make sure gridDataView does NOT access currentGridData!! - //just DON'T: updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks + updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks //reenable complete main dialog - mainDialog->m_notebookBottomLeft->Enable(); - mainDialog->m_radioBtnSizeDate->Enable(); - mainDialog->m_radioBtnContent->Enable(); - mainDialog->m_bpButtonFilter->Enable(); - mainDialog->m_hyperlinkCfgFilter->Enable(); - mainDialog->m_checkBoxHideFilt->Enable(); - mainDialog->m_bpButtonSyncConfig->Enable(); - mainDialog->m_buttonStartSync->Enable(); - mainDialog->m_dirPickerLeft->Enable(); - mainDialog->m_dirPickerRight->Enable(); - mainDialog->m_bpButtonSwapSides->Enable(); - mainDialog->m_bpButtonLeftOnly->Enable(); - mainDialog->m_bpButtonLeftNewer->Enable(); - mainDialog->m_bpButtonEqual->Enable(); - mainDialog->m_bpButtonDifferent->Enable(); - mainDialog->m_bpButtonRightNewer->Enable(); - mainDialog->m_bpButtonRightOnly->Enable(); - mainDialog->m_panelLeft->Enable(); - mainDialog->m_panelMiddle->Enable(); - mainDialog->m_panelRight->Enable(); - mainDialog->m_panelTopLeft->Enable(); - mainDialog->m_panelTopMiddle->Enable(); - mainDialog->m_panelTopRight->Enable(); - mainDialog->m_bpButtonSave->Enable(); - mainDialog->m_bpButtonLoad->Enable(); - mainDialog->m_choiceHistory->Enable(); - mainDialog->m_bpButton10->Enable(); - mainDialog->m_bpButton14->Enable(); - mainDialog->m_scrolledWindowFolderPairs->Enable(); - mainDialog->m_menubar1->EnableTop(0, true); - mainDialog->m_menubar1->EnableTop(1, true); - mainDialog->m_menubar1->EnableTop(2, true); + mainDialog->enableAllElements(); if (abortIsRequested()) mainDialog->pushStatusInformation(_("Operation aborted!")); - mainDialog->m_buttonAbort->Disable(); - mainDialog->m_buttonAbort->Hide(); - mainDialog->m_buttonCompare->Enable(); //enable compare button - mainDialog->m_buttonCompare->Show(); - //hide status panel from main window mainDialog->compareStatus->Hide(); mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage - mainDialog->Layout(); mainDialog->Refresh(); + + //de-register abort button + mainDialog->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this ); } @@ -167,7 +99,7 @@ void CompareStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong } -ErrorHandler::Response CompareStatusHandler::reportError(const Zstring& text) +ErrorHandler::Response CompareStatusHandler::reportError(const wxString& message) { if (ignoreErrors) return ErrorHandler::IGNORE_ERROR; @@ -175,7 +107,7 @@ ErrorHandler::Response CompareStatusHandler::reportError(const Zstring& text) mainDialog->compareStatus->updateStatusPanelNow(); bool ignoreNextErrors = false; - wxString errorMessage = wxString(text.c_str()) + wxT("\n\n") + _("Ignore this error, retry or abort?"); + const wxString errorMessage = message + wxT("\n\n\n") + _("Ignore this error, retry or abort?"); ErrorDlg* errorDlg = new ErrorDlg(mainDialog, ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, errorMessage, ignoreNextErrors); @@ -198,22 +130,22 @@ ErrorHandler::Response CompareStatusHandler::reportError(const Zstring& text) } -void CompareStatusHandler::reportFatalError(const Zstring& errorMessage) +void CompareStatusHandler::reportFatalError(const wxString& errorMessage) { mainDialog->compareStatus->updateStatusPanelNow(); bool dummy = false; ErrorDlg* errorDlg = new ErrorDlg(mainDialog, ErrorDlg::BUTTON_ABORT, - errorMessage.c_str(), dummy); + errorMessage, dummy); errorDlg->ShowModal(); abortThisProcess(); } -void CompareStatusHandler::reportWarning(const Zstring& warningMessage, bool& dontShowAgain) +void CompareStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) { - if (ignoreErrors) //if errors are ignored, then warnings should also + if (!warningActive || ignoreErrors) //if errors are ignored, then warnings should also return; mainDialog->compareStatus->updateStatusPanelNow(); @@ -222,19 +154,18 @@ void CompareStatusHandler::reportWarning(const Zstring& warningMessage, bool& do bool dontWarnAgain = false; WarningDlg* warningDlg = new WarningDlg(mainDialog, WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage.c_str(), + warningMessage, dontWarnAgain); - switch (warningDlg->ShowModal()) + switch (static_cast<WarningDlg::Response>(warningDlg->ShowModal())) { case WarningDlg::BUTTON_ABORT: abortThisProcess(); + break; case WarningDlg::BUTTON_IGNORE: - dontShowAgain = dontWarnAgain; - return; + warningActive = !dontWarnAgain; + break; } - - assert(false); } @@ -245,6 +176,12 @@ void CompareStatusHandler::forceUiRefresh() } +void CompareStatusHandler::OnAbortCompare(wxCommandEvent& event) +{ + requestAbortion(); +} + + void CompareStatusHandler::abortThisProcess() { requestAbortion(); @@ -265,23 +202,24 @@ SyncStatusHandler::SyncStatusHandler(wxWindow* dlg, bool ignoreAllErrors) : SyncStatusHandler::~SyncStatusHandler() { //print the results list - unsigned int failedItems = unhandledErrors.GetCount(); wxString result; - if (failedItems) + if (errorLog.messageCount() > 0) { - result = wxString(_("Warning: Synchronization failed for %x item(s):")) + wxT("\n\n"); - result.Replace(wxT("%x"), globalFunctions::numberToWxString(failedItems), false); - - for (unsigned int j = 0; j < failedItems; ++j) - { //remove linebreaks - wxString errorMessage = unhandledErrors[j]; - for (wxString::iterator i = errorMessage.begin(); i != errorMessage.end(); ++i) - if (*i == wxChar('\n')) - *i = wxChar(' '); + if (errorLog.errorsTotal() > 0) + { + wxString header(_("Warning: Synchronization failed for %x item(s):")); + header.Replace(wxT("%x"), globalFunctions::numberToWxString(errorLog.errorsTotal()), false); + result += header + wxT("\n\n"); + } - result += errorMessage + wxT("\n"); + const std::vector<wxString>& messages = errorLog.getFormattedMessages(); + for (std::vector<wxString>::const_iterator i = messages.begin(); i != messages.end(); ++i) + { + result += *i; + result += wxChar('\n'); } - result+= wxT("\n"); + + result += wxT("\n"); } //notify to syncStatusFrame that current process has ended @@ -291,7 +229,7 @@ SyncStatusHandler::~SyncStatusHandler() syncStatusFrame->setStatusText_NoUpdate(result.c_str()); syncStatusFrame->processHasFinished(SyncStatus::ABORTED); //enable okay and close events } - else if (failedItems) + else if (errorLog.errorsTotal() > 0) { result+= wxString(_("Synchronization completed with errors!")) + wxT(" ") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!"); syncStatusFrame->setStatusText_NoUpdate(result.c_str()); @@ -337,14 +275,11 @@ void SyncStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dat } -ErrorHandler::Response SyncStatusHandler::reportError(const Zstring& text) +ErrorHandler::Response SyncStatusHandler::reportError(const wxString& errorMessage) { - //add current time before error message - wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + text.c_str(); - if (ignoreErrors) { - unhandledErrors.Add(errorWithTime); + errorLog.logError(errorMessage); return ErrorHandler::IGNORE_ERROR; } @@ -353,66 +288,65 @@ ErrorHandler::Response SyncStatusHandler::reportError(const Zstring& text) bool ignoreNextErrors = false; ErrorDlg* errorDlg = new ErrorDlg(syncStatusFrame, ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - wxString(text) + wxT("\n\n") + _("Ignore this error, retry or abort synchronization?"), + errorMessage + wxT("\n\n\n") + _("Ignore this error, retry or abort synchronization?"), ignoreNextErrors); - int rv = errorDlg->ShowModal(); - switch (rv) + switch (static_cast<ErrorDlg::ReturnCodes>(errorDlg->ShowModal())) { case ErrorDlg::BUTTON_IGNORE: ignoreErrors = ignoreNextErrors; - unhandledErrors.Add(errorWithTime); + errorLog.logError(errorMessage); return ErrorHandler::IGNORE_ERROR; case ErrorDlg::BUTTON_RETRY: return ErrorHandler::RETRY; case ErrorDlg::BUTTON_ABORT: - unhandledErrors.Add(errorWithTime); + errorLog.logError(errorMessage); abortThisProcess(); } assert (false); - unhandledErrors.Add(errorWithTime); + errorLog.logError(errorMessage); return ErrorHandler::IGNORE_ERROR; } -void SyncStatusHandler::reportFatalError(const Zstring& errorMessage) -{ //add current time before error message - wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + errorMessage.c_str(); - - unhandledErrors.Add(errorWithTime); +void SyncStatusHandler::reportFatalError(const wxString& errorMessage) +{ + errorLog.logError(errorMessage); abortThisProcess(); } -void SyncStatusHandler::reportWarning(const Zstring& warningMessage, bool& dontShowAgain) -{ //add current time before warning message - wxString warningWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + warningMessage.c_str(); - - if (ignoreErrors) //if errors are ignored, then warnings should also - return; //no unhandled error situation! - - syncStatusFrame->updateStatusDialogNow(); +void SyncStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) +{ + errorLog.logWarning(warningMessage); - //show popup and ask user how to handle warning - bool dontWarnAgain = false; - WarningDlg* warningDlg = new WarningDlg(syncStatusFrame, - WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage.c_str(), - dontWarnAgain); - switch (warningDlg->ShowModal()) - { - case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! - dontShowAgain = dontWarnAgain; + if (ignoreErrors || !warningActive) //if errors are ignored, then warnings should also return; + else + { + syncStatusFrame->updateStatusDialogNow(); + + //show popup and ask user how to handle warning + bool dontWarnAgain = false; + WarningDlg* warningDlg = new WarningDlg(syncStatusFrame, + WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, + warningMessage, + dontWarnAgain); + switch (static_cast<WarningDlg::Response>(warningDlg->ShowModal())) + { + case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! + warningActive = !dontWarnAgain; + return; + + case WarningDlg::BUTTON_ABORT: + abortThisProcess(); + return; + } - case WarningDlg::BUTTON_ABORT: - unhandledErrors.Add(warningWithTime); - abortThisProcess(); + assert(false); } - - assert(false); } diff --git a/ui/guiStatusHandler.h b/ui/guiStatusHandler.h index 51a87c98..eb067102 100644 --- a/ui/guiStatusHandler.h +++ b/ui/guiStatusHandler.h @@ -2,14 +2,17 @@ #define GUISTATUSHANDLER_H_INCLUDED #include "../library/statusHandler.h" -#include <wx/arrstr.h> +#include <wx/event.h> +#include "../library/errorLogging.h" class SyncStatus; class MainDialog; class wxWindow; +class wxCommandEvent; + //classes handling sync and compare error as well as status information -class CompareStatusHandler : public StatusHandler +class CompareStatusHandler : private wxEvtHandler, public StatusHandler { public: CompareStatusHandler(MainDialog* dlg); @@ -20,11 +23,12 @@ public: virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); virtual void forceUiRefresh(); - virtual ErrorHandler::Response reportError(const Zstring& text); - virtual void reportFatalError(const Zstring& errorMessage); - virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); + virtual ErrorHandler::Response reportError(const wxString& text); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); private: + void OnAbortCompare(wxCommandEvent& event); //handle abort button click virtual void abortThisProcess(); MainDialog* mainDialog; @@ -44,16 +48,16 @@ public: virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); virtual void forceUiRefresh(); - virtual ErrorHandler::Response reportError(const Zstring& text); - virtual void reportFatalError(const Zstring& errorMessage); - virtual void reportWarning(const Zstring& warningMessage, bool& dontShowAgain); + virtual ErrorHandler::Response reportError(const wxString& text); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); private: virtual void abortThisProcess(); SyncStatus* syncStatusFrame; bool ignoreErrors; - wxArrayString unhandledErrors; //list of non-resolved errors + FreeFileSync::ErrorLogging errorLog; }; diff --git a/ui/sorting.h b/ui/sorting.h index 2716eceb..c3cf8f97 100644 --- a/ui/sorting.h +++ b/ui/sorting.h @@ -2,8 +2,7 @@ #define SORTING_H_INCLUDED #include "../structures.h" -#include "../library/resources.h" -#include "../library/globalFunctions.h" +#include "../shared/globalFunctions.h" namespace FreeFileSync @@ -14,31 +13,15 @@ namespace FreeFileSync SORT_ON_RIGHT, }; - enum SortDirection - { - ASCENDING, - DESCENDING, - }; - - template <SortDirection sortAscending> inline - bool stringSmallerThan(const wxChar* stringA, const wxChar* stringB) + bool stringSmallerThan(const DefaultChar* stringA, const DefaultChar* stringB) { -#ifdef FFS_WIN //case-insensitive comparison! - return sortAscending == ASCENDING ? - FreeFileSync::compareStringsWin32(stringA, stringB) < 0 : //way faster than wxString::CmpNoCase() in windows build!!! - FreeFileSync::compareStringsWin32(stringA, stringB) > 0; +#ifdef FFS_WIN + //case-insensitive comparison! + return FreeFileSync::compareStringsWin32(stringA, stringB) < 0; //way faster than wxString::CmpNoCase() in windows build!!! #else - while (*stringA == *stringB) - { - if (*stringA == wxChar(0)) //strings are equal - return false; - - ++stringA; - ++stringB; - } - return sortAscending == ASCENDING ? *stringA < *stringB : *stringA > *stringB; //wxChar(0) is handled correctly + return defaultCompare(stringA, stringB) < 0; #endif } @@ -46,7 +29,8 @@ namespace FreeFileSync inline int compareString(const wxChar* stringA, const wxChar* stringB, const int lengthA, const int lengthB) { -#ifdef FFS_WIN //case-insensitive comparison! +#ifdef FFS_WIN + //case-insensitive comparison! return FreeFileSync::compareStringsWin32(stringA, stringB, lengthA, lengthB); //way faster than wxString::CmpNoCase() in the windows build!!! #else for (int i = 0; i < std::min(lengthA, lengthB); ++i) @@ -55,11 +39,15 @@ namespace FreeFileSync return stringA[i] - stringB[i]; } return lengthA - lengthB; + + //equivalent: + //const int rv = strncmp(stringA, stringB, std::min(lengthA, lengthB)); + //return rv != 0 ? rv : lengthA - lengthB; #endif } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> inline bool sortByFileName(const FileCompareLine& a, const FileCompareLine& b) { @@ -76,7 +64,7 @@ namespace FreeFileSync if (descrLineA->objType == FileDescrLine::TYPE_DIRECTORY) //sort directories by relative name { if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) - return stringSmallerThan<sortAscending>(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); + return stringSmallerThan(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); else return false; } @@ -89,21 +77,21 @@ namespace FreeFileSync const wxChar* stringA = descrLineA->relativeName.c_str(); const wxChar* stringB = descrLineB->relativeName.c_str(); - size_t pos = descrLineA->relativeName.findFromEnd(FreeFileSync::FILE_NAME_SEPARATOR); //start search beginning from end + size_t pos = descrLineA->relativeName.findFromEnd(globalFunctions::FILE_NAME_SEPARATOR); //start search beginning from end if (pos != std::string::npos) stringA += pos + 1; - pos = descrLineB->relativeName.findFromEnd(FreeFileSync::FILE_NAME_SEPARATOR); //start search beginning from end + pos = descrLineB->relativeName.findFromEnd(globalFunctions::FILE_NAME_SEPARATOR); //start search beginning from end if (pos != std::string::npos) stringB += pos + 1; - return stringSmallerThan<sortAscending>(stringA, stringB); + return stringSmallerThan(stringA, stringB); } } } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> bool sortByRelativeName(const FileCompareLine& a, const FileCompareLine& b) { const FileDescrLine* const descrLineA = side == SORT_ON_LEFT ? &a.fileDescrLeft : &a.fileDescrRight; @@ -119,7 +107,7 @@ namespace FreeFileSync relLengthA = descrLineA->relativeName.length(); else if (descrLineA->objType == FileDescrLine::TYPE_FILE) { - relLengthA = descrLineA->relativeName.findFromEnd(FreeFileSync::FILE_NAME_SEPARATOR); //start search beginning from end + relLengthA = descrLineA->relativeName.findFromEnd(globalFunctions::FILE_NAME_SEPARATOR); //start search beginning from end if (relLengthA == wxNOT_FOUND) { relLengthA = 0; @@ -144,7 +132,7 @@ namespace FreeFileSync relLengthB = descrLineB->relativeName.length(); else if (descrLineB->objType == FileDescrLine::TYPE_FILE) { - relLengthB = descrLineB->relativeName.findFromEnd(FreeFileSync::FILE_NAME_SEPARATOR); //start search beginning from end + relLengthB = descrLineB->relativeName.findFromEnd(globalFunctions::FILE_NAME_SEPARATOR); //start search beginning from end if (relLengthB == wxNOT_FOUND) { relLengthB = 0; @@ -162,7 +150,7 @@ namespace FreeFileSync //compare relative names without filenames first const int rv = compareString(relStringA, relStringB, relLengthA, relLengthB); if (rv != 0) - return sortAscending == ASCENDING ? rv < 0 : rv > 0; + return rv < 0; else //compare the filenames { if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) //directories shall appear before files @@ -170,14 +158,12 @@ namespace FreeFileSync else if (descrLineA->objType == FileDescrLine::TYPE_DIRECTORY) return true; - return sortAscending == ASCENDING ? - compareString(fileStringA, fileStringB, fileLengthA, fileLengthB) < 0 : - compareString(fileStringA, fileStringB, fileLengthA, fileLengthB) > 0; + return compareString(fileStringA, fileStringB, fileLengthA, fileLengthB) < 0; } } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> inline bool sortByFullName(const FileCompareLine& a, const FileCompareLine& b) { @@ -191,18 +177,14 @@ namespace FreeFileSync return true; //empty rows always last else #ifdef FFS_WIN //case-insensitive comparison! - return sortAscending == ASCENDING ? - FreeFileSync::compareStringsWin32(descrLineA->fullName.c_str(), descrLineB->fullName.c_str()) < 0 : //way faster than wxString::CmpNoCase() in windows build!!! - FreeFileSync::compareStringsWin32(descrLineA->fullName.c_str(), descrLineB->fullName.c_str()) > 0; + return FreeFileSync::compareStringsWin32(descrLineA->fullName.c_str(), descrLineB->fullName.c_str()) < 0; //way faster than wxString::CmpNoCase() in windows build!!! #else - return sortAscending == ASCENDING ? - descrLineA->fullName.Cmp(descrLineB->fullName) < 0 : - descrLineA->fullName.Cmp(descrLineB->fullName) > 0; + return descrLineA->fullName.Cmp(descrLineB->fullName) < 0; #endif } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> inline bool sortByFileSize(const FileCompareLine& a, const FileCompareLine& b) { @@ -219,7 +201,7 @@ namespace FreeFileSync if (descrLineA->objType == FileDescrLine::TYPE_DIRECTORY) //sort directories by relative name { if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) - return stringSmallerThan<sortAscending>(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); + return stringSmallerThan(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); else return false; } @@ -228,14 +210,12 @@ namespace FreeFileSync if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) return true; else - return sortAscending == ASCENDING ? - descrLineA->fileSize > descrLineB->fileSize : //sortAscending shall result in list beginning with largest files first - descrLineA->fileSize < descrLineB->fileSize; + return descrLineA->fileSize > descrLineB->fileSize; //sortAscending shall result in list beginning with largest files first } } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> inline bool sortByDate(const FileCompareLine& a, const FileCompareLine& b) { @@ -251,7 +231,7 @@ namespace FreeFileSync if (descrLineA->objType == FileDescrLine::TYPE_DIRECTORY) //sort directories by relative name { if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) - return stringSmallerThan<sortAscending>(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); + return stringSmallerThan(descrLineA->relativeName.c_str(), descrLineB->relativeName.c_str()); else return false; } @@ -260,14 +240,11 @@ namespace FreeFileSync if (descrLineB->objType == FileDescrLine::TYPE_DIRECTORY) return true; else - return sortAscending == ASCENDING ? - descrLineA->lastWriteTimeRaw > descrLineB->lastWriteTimeRaw : - descrLineA->lastWriteTimeRaw < descrLineB->lastWriteTimeRaw; + return descrLineA->lastWriteTimeRaw > descrLineB->lastWriteTimeRaw; } } - template <SortDirection sortAscending> inline bool sortByCmpResult(const FileCompareLine& a, const FileCompareLine& b) { @@ -277,37 +254,28 @@ namespace FreeFileSync if (b.cmpResult == FILE_EQUAL) return true; - return sortAscending == ASCENDING ? - a.cmpResult < b.cmpResult : - a.cmpResult > b.cmpResult; + return a.cmpResult < b.cmpResult; } - template <SortDirection sortAscending> inline bool sortBySyncDirection(const FileCompareLine& a, const FileCompareLine& b) { - return sortAscending == ASCENDING ? - a.direction < b.direction : - a.direction > b.direction; + return a.syncDir < b.syncDir; } - template <SortDirection sortAscending, SideToSort side> + template <SideToSort side> inline bool sortByDirectory(const FolderCompareLine& a, const FolderCompareLine& b) { - const Zstring* const dirNameA = side == SORT_ON_LEFT ? &a.syncPair.leftDirectory : &a.syncPair.rightDirectory; - const Zstring* const dirNameB = side == SORT_ON_LEFT ? &b.syncPair.leftDirectory : &b.syncPair.rightDirectory; + const Zstring& dirNameA = side == SORT_ON_LEFT ? a.syncPair.leftDirectory : a.syncPair.rightDirectory; + const Zstring& dirNameB = side == SORT_ON_LEFT ? b.syncPair.leftDirectory : b.syncPair.rightDirectory; #ifdef FFS_WIN //case-insensitive comparison! - return sortAscending == ASCENDING ? - FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) < 0 : //way faster than wxString::CmpNoCase() in windows build!!! - FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) > 0; + return FreeFileSync::compareStringsWin32(dirNameA.c_str(), dirNameB.c_str()) < 0; //way faster than wxString::CmpNoCase() in windows build!!! #elif defined FFS_LINUX - return sortAscending == ASCENDING ? - dirNameA->Cmp(*dirNameB) < 0 : - dirNameA->Cmp(*dirNameB) > 0; + return dirNameA.Cmp(dirNameB) < 0; #endif } } diff --git a/version/version.h b/version/version.h index 295d318b..d5f88ca8 100644 --- a/version/version.h +++ b/version/version.h @@ -2,5 +2,5 @@ namespace FreeFileSync { - static const wxString currentVersion = wxT("2.1"); //internal linkage! + static const wxString currentVersion = wxT("2.2"); //internal linkage! } |