Compare commits

...
1304 Commits
Author SHA1 Message Date
schetnikovich 845315eeb5 Simplified LIBSSH2 CMake listfile 2016-04-05 16:19:42 +03:00
schetnikovich 803306eea5 Default to gnu99 for both GCC and Clang 2016-04-05 14:58:51 +03:00
schetnikovich 94ef0d75d7 Modified gitignore and missed header in OpenSSL 2016-04-05 13:24:37 +03:00
schetnikovich 604d439d57 OpenSSL CMake listfile tweaks 2016-04-05 12:39:25 +03:00
schetnikovich d37f8c7bab OpenSSL 1.0.1e 2016-04-04 21:47:50 +03:00
schetnikovich c7ab94a5a5 Ignore SIGPIPE signal 2016-04-04 20:01:42 +03:00
schetnikovich a6428ce968 Use of LIBSSH2 error codes 2016-04-04 16:31:42 +03:00
schetnikovich 8dd0cd3050 Restructuring of SSH submodule. Updated to the latest version of LIBSSH2. 2016-04-04 15:53:12 +03:00
schetnikovich baede8d8bd SSH tunnel: Log functions moved to separate file II 2016-04-02 13:34:28 +03:00
schetnikovich 2328ec7b31 SSH tunnel: Log functions moved to separate file 2016-04-02 13:34:01 +03:00
schetnikovich 719df7b241 Error handling for the most important operations is restored.
1. First steps to support automatic reconnection for SSH tunnel
2. UI tweaks for Explorer tree items (handling of errors and empty children)
3. Correct handling of invalid mongo::DBClientCursor
4. Null semantic of value type EventError is restored. Was broken by reliance on emptiness of error message string, dah!
5. Error state for several messages is restored. Not for all messages, but still something :)
6. Errors produced by MongoWorker now contains exact error message, instead of constant text.
7. More strict error handling for SSH worker
2016-04-02 01:19:58 +03:00
schetnikovich dff7f0539a Preparation to handle reconnection automatically 2016-03-31 13:56:37 +03:00
schetnikovich f03cf048d8 Minor changes with whitespace characters in the code 2016-03-29 20:43:41 +03:00
schetnikovich 22ffc2ec15 Do not print batch size in the logs 2016-03-29 19:51:49 +03:00
schetnikovich 09a0edb39a Check for availability of "rc" files (this removes unnecessary warnings in logs) 2016-03-29 19:44:10 +03:00
schetnikovich a0a8a7a13e Cleanup of SSH worker thread when no more connected clients 2016-03-29 18:06:05 +03:00
schetnikovich 8f97c06408 Shift + Return when selecting connection in order to enable debug level logging for SSH submodule 2016-03-29 14:57:13 +03:00
schetnikovich af9f8fc6a9 Shift + Connect in order to enable debug level logging for SSH submodule
Added WARN log level
2016-03-29 14:36:38 +03:00
schetnikovich ef6feb2377 Log levels for SSH submodule (ERROR, INFO, DEBUG) 2016-03-28 20:57:22 +03:00
schetnikovich 4e5ffae80c Single log function for SSH submodule 2016-03-28 20:16:45 +03:00
schetnikovich 3597f438cd Handling of different types of sockets moved to separate functions 2016-03-28 19:47:15 +03:00
schetnikovich ad9cc86117 Cleanup of SSH tunnel artifacts: sessions, channels, sockets. 2016-03-28 16:34:25 +03:00
schetnikovich 6656494fda Prefix all global or public C identifiers with "rbm_" 2016-03-27 18:23:57 +03:00
schetnikovich 06ac7dd8f1 Global set of SSH channels replaced with separate channels per each worker thread 2016-03-26 11:57:26 +03:00
schetnikovich 76f4d19b42 Logging to Log panel from SSH tunnel worker 2016-03-25 16:17:25 +03:00
schetnikovich d64a1f704b Real-time logging from SSH Tunnel worker thread. 2016-03-25 12:40:14 +03:00
schetnikovich aa27148868 Detailed errors messages for all system calls when establishing SSH tunnel. 2016-03-24 20:40:12 +03:00
schetnikovich 58c42df669 Better error handling when new connection is made (for normal and via SSH tunnel) 2016-03-24 17:16:10 +03:00
schetnikovich 9c0761826b Automatically bind local SSH tunnel to the first available local port 2016-03-22 23:51:43 +03:00
schetnikovich 63f90dfeb3 SSH tunnel on hard-coded local port 2016-03-22 22:28:40 +03:00
schetnikovich 10b31ef2a9 Two-step connection skeleton (SSH tunnel, and then MongoDB connection) 2016-03-22 20:25:36 +03:00
schetnikovich bb3fd81c4d SSH tunnel worker connection and auth 2016-03-19 20:36:05 +03:00
schetnikovich 2cd6ed2928 SSH public key 2016-03-18 18:42:24 +03:00
schetnikovich fde191f6aa SSH tunnel worker sketch 2016-03-18 18:05:01 +03:00
schetnikovich 1c76852b9c Enable C99 support 2016-03-17 16:27:43 +03:00
schetnikovich 2491f417da Loading and saving of SSH settings 2016-03-17 14:43:18 +03:00
schetnikovich 443b8070f2 SSH tab and settings stub 2016-03-15 22:53:07 +03:00
schetnikovich bb51c1395b Separate SSH channels for different socket connections on the same port
* Additional major fix: restored error handling when connectivity is lost
2016-03-15 20:52:51 +03:00
schetnikovich 3e03cf3d88 Single SSH channel for all socket connections 2016-03-13 21:28:37 +03:00
schetnikovich d6a6bf9719 SSH connection, handshake and authentication routines 2016-03-13 17:43:58 +03:00
schetnikovich 3a2a9d1b7d SSH tunnel config 2016-03-12 20:28:59 +03:00
schetnikovich dda68ff53f Direct port forwarding skeleton 2016-03-11 18:26:45 +03:00
schetnikovich 0ef17c6ad7 Libssh2 compilation 2016-03-11 13:47:29 +03:00
schetnikovich ac58d23713 Libssh2 1.7.0 2016-03-10 23:13:25 +03:00
schetnikovich 5971972525 CHANGELOG updated 2016-03-08 13:58:28 +03:00
schetnikovich 4cc6662837 Merge branch 'master' of github.com:paralect/robomongo 2016-03-06 15:52:50 +03:00
schetnikovich 226cbf48d8 CMake print utils changes 2016-03-06 15:52:01 +03:00
schetnikovich 7d9909c247 #1048: Support for CMake 3.0 2016-03-06 15:50:26 +03:00
Dmitry Schetnikovich 649c096e70 Update BuildingMongoDB.md 2016-03-06 12:47:34 +03:00
Dmitry Schetnikovich ce02d5f5c8 Update BuildingRobomongo.md 2016-03-06 12:45:27 +03:00
Dmitry Schetnikovich 90c667011d Update BuildingMongoDB.md 2016-03-06 12:42:22 +03:00
Dmitry Schetnikovich 0622e85e27 Update BuildingMongoDB.md 2016-03-06 12:41:29 +03:00
Dmitry Schetnikovich 355f01f0a4 Update BuildingMongoDB.md 2016-03-06 12:36:59 +03:00
Dmitry Schetnikovich b0d6cf0842 Update BuildingMongoDB.md 2016-03-06 12:35:35 +03:00
Dmitry Schetnikovich 16b15be81b Update BuildingMongoDB.md 2016-03-06 12:30:43 +03:00
schetnikovich 2b7a8ca14e Version updated to RC7 2016-03-03 18:12:23 +03:00
Dmitry Schetnikovich c338813d1c Update BuildingRobomongoOnWindows.md 2016-03-03 17:48:00 +03:00
schetnikovich 2f38d5b00d #1017: Disable editing in View Mode. Button "Validate" is also now hidden in this mode. 2016-03-03 17:09:17 +03:00
schetnikovich 7c6738e32b Config for "clang-format" tool 2016-03-01 20:32:49 +03:00
schetnikovich 86bfeba68a #929: Show keyboard shortcuts for expand/collapse in context menu 2016-03-01 19:40:37 +03:00
schetnikovich a94aa81c07 #1045: Logs are now shown in the panel at the bottom 2016-02-29 20:50:51 +03:00
schetnikovich 080c1ed865 #1042: Double click on collection should not expand it 2016-02-29 16:49:05 +03:00
schetnikovich c6f13e347c Confirmation dialog for BSON editor when ESC is hit and content is modified
And also clone url in documentation is changed to HTTPS instead of SSH, to allow
allow unauthorized cloning.

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2016-02-28 22:26:05 +03:00
schetnikovich 3cea361cc9 Merge of PR #1037 2016-02-28 22:16:31 +03:00
schetnikovich f6546fc336 Minor code cleanup 2016-02-28 22:08:35 +03:00
schetnikovich 8d12ab45c9 Mac way to "expand recursively" in a BSON subtree #929. Implemented by Anton Zering 2016-02-28 21:46:39 +03:00
schetnikovich 7dfd9184b7 Fix for broken keyboard shortcut for single document #1039 2016-02-28 21:09:10 +03:00
Anton Zering 0977bc00e3 #929: adds shortcut to expand nodes recursively 2016-02-25 01:13:31 +01:00
Anton Zering 2ea847ce0b #1039: fixes deletion of single documents with shortcut 2016-02-25 00:51:05 +01:00
Anton Zering fb2b5e0487 #1017: document editor ask to save changes when closing the window 2016-02-23 23:56:06 +01:00
Anton Zering cce30bb55b Changed clone url to use HTTPS instead of SSH
Use HTTPS instead of SSH to allow unauthorized cloning
2016-02-23 22:56:41 +01:00
Dmitry Schetnikovich 98af4fc747 CHANGELOG updated 2016-02-13 16:30:59 +03:00
schetnikovich 2c04edb1b3 List of collections is loading much faster now 2016-02-13 16:19:51 +03:00
Dmitry Schetnikovich e4500e0c5c Generate ZIP archives for Windows 2016-02-13 12:56:48 +03:00
Dmitry Schetnikovich 820c4a86f0 Fix for compilation error under Windows 2016-02-13 12:52:49 +03:00
Dmitry Schetnikovich d6253ca194 Merge pull request #1018 from CaptainPatate/CaptainPatate/fix-typo
Fix typo
2016-02-12 00:26:19 +03:00
schetnikovich 33e27917ee Version RC6 2016-02-11 15:20:06 +03:00
schetnikovich cea04368a9 Support for IPv6 addresses with and without square brackets 2016-02-11 15:19:16 +03:00
schetnikovich fe9eed7322 Removed use of monospaced font in Auth tab 2016-02-10 20:24:26 +03:00
Dmitry Schetnikovich 33304e2e7a README updated 2016-02-10 20:17:43 +03:00
schetnikovich 4cd51a7de6 IPv6 support 2016-02-10 20:16:22 +03:00
Amaury Gauthier 5ffd65b1a2 Fix typo 2016-02-09 15:18:04 +01:00
schetnikovich 82b96f4f63 Merge branch 'master' of github.com:paralect/robomongo 2016-02-06 19:00:45 +03:00
schetnikovich e0ea15adb9 Ad-free Robomongo 2016-02-06 19:00:29 +03:00
Dmitry Schetnikovich 209ce0c0a9 README updated 2016-02-03 14:34:01 +03:00
Dmitry Schetnikovich 620488c318 README updated 2016-02-03 14:31:27 +03:00
schetnikovich a270926397 CHANGELOG updated 2016-02-01 23:08:35 +03:00
schetnikovich 8c830b6f1a Robomongo RC4 2016-02-01 20:50:45 +03:00
schetnikovich 33d58189c4 All operations with MongoDB now over DBClientBase, instead of DBClientConnection 2016-02-01 18:28:21 +03:00
schetnikovich 5d8370a970 Support for SCRAM-SHA-1 and MONGODB-CR authentication mechanisms.
1. Ability to select auth mechanisms for each connection (defaults to SCRAM-SHA-1)
2. Diagnostic Dialog also now uses required mechanisms.
2016-02-01 15:17:10 +03:00
schetnikovich fb3d37e641 Message box with description of error when deleting documents. 2016-01-31 19:36:53 +03:00
schetnikovich b27f747ff2 Handling of errors when inserting/updating/removing documents. 2016-01-31 18:47:50 +03:00
schetnikovich 2854783aeb Always allow to read from slaves. 2016-01-31 17:32:28 +03:00
Dmitry Schetnikovich 4b8aa3deaf Shortcuts now will be created on Windows (on desktop and start menu)
1. A bit simplified syntax is used for NSIS commands
2. All Robomongo CMake files start from "Robomongo" (except "find" packages)
3. Clean uninstallation under Windows (only config file is not deleted)
2016-01-30 20:10:09 +03:00
schetnikovich f5397b7c68 CHANGELOG updated 2016-01-29 21:19:45 +03:00
schetnikovich 047620492c Typo fixed 2016-01-29 16:20:18 +03:00
schetnikovich bf51f5d6c9 Gray text color for hey message 2016-01-29 12:47:37 +03:00
schetnikovich d7f27e16fe Hey message added for the time of campaign. 2016-01-29 07:16:51 +03:00
schetnikovich cfb30c69c0 Merge of BSON utils 2016-01-29 05:00:13 +03:00
schetnikovich 8ed0335b7b Use of std::numeric_limits<double>::digits10 to get max float-point precision
Tests returned back.
2016-01-29 04:58:30 +03:00
Dmitry Schetnikovich 313179dfbe Temporary fix for compilation under Windows 2016-01-28 21:42:52 +03:00
schetnikovich 97503f2e81 Version RC3 2016-01-28 21:15:25 +03:00
schetnikovich 156bda2600 NumberDecimal write protection. 2016-01-28 20:59:48 +03:00
schetnikovich 6a5ad25bde Use of shortest representation for BSON double types.
#870, #831, #921, #842
2016-01-28 20:33:46 +03:00
schetnikovich 6d06a3c83c Cleanup of unused code 2016-01-28 19:50:25 +03:00
schetnikovich 76cb03b523 Correct handling and display of top-most JS/BSON arrays in tree and text modes. 2016-01-27 19:31:43 +03:00
schetnikovich 6a2f8c655e Built-in ISO date parser replaced with ptimeutil 2016-01-25 21:39:32 +03:00
schetnikovich 4f3bf50acd BSON parsing with support for ISODate and UUIDs.
1. Validate Json functionality is back
2. Use of MongoDB built-in parser for ISO Date format
3. Use of MongoDB built-in parser for NumberLong
2016-01-25 21:06:51 +03:00
Dmitry Schetnikovich 84c1679e14 Fix for Windows install directory 2016-01-25 18:39:08 +03:00
schetnikovich 5ce457b6f6 Use versioned install directory for not stable releases under Windows 2016-01-25 18:24:51 +03:00
schetnikovich 071d79b7f7 Uniformed package name for all platforms.
1. All letters are lowercase
2. Includes platform architecture in the name
2016-01-25 17:46:55 +03:00
Dmitry Schetnikovich c4ccae3ef8 Packaging for Windows
1. NSIS package is now generated for Windows
2. Images for NSIS installer added
3. DESCRIPTION file copied to installation package
4. Icon updated to have smaller resolutions (20, 24, 40 and 48)
2016-01-25 17:23:52 +03:00
Dmitry Schetnikovich 3e67fa00d4 Packaging of runtime libraries for Windows 2016-01-24 20:04:54 +03:00
Dmitry Schetnikovich e34ebdf0de Config for 0.9.x versions now namespaced in .config/robomongo/0.9 folder. Loading of .mongorc.js is turned off by default 2016-01-24 19:25:45 +03:00
Dmitry Schetnikovich c6bdd3a455 Multiresolution ICO file for Windows 2016-01-24 18:55:20 +03:00
Dmitry Schetnikovich 81f22b68d7 QAtomicInteger<int> instead of QAtomicInteger<_Bool or bool> 2016-01-24 16:49:18 +03:00
Dmitry Schetnikovich 888084b19b And now we are forced to use int instead of BOOL, because on Unix BOOL doesn't defined and bool cannot be used on Windows 2016-01-24 16:47:16 +03:00
Dmitry Schetnikovich e2ec2a2f0d Forced to use BOOL instead of bool, because on Windows –QAtomicInteger with bool template arg doesn't compile 2016-01-24 16:37:31 +03:00
schetnikovich e80245ba15 Bug fixed which made MongoWorker shutdown unsafe and incorrect. Proposed and implemented by Patrick Horlebein. 2016-01-24 16:22:02 +03:00
schetnikovich 3ef94811eb Migration notes updated 2016-01-24 15:13:56 +03:00
schetnikovich d78ff306e4 Removed notion about v0.9 branch in docs (which is merged with master) 2016-01-24 14:55:18 +03:00
Dmitry Schetnikovich 06285eb556 Merge pull request #996 from paralect/v0.9
Merge with v0.9 branch
2016-01-24 14:47:50 +03:00
schetnikovich 0a4378b9fc Always Use QProxyStyle (thanks to Patrick Allaert) 2016-01-24 14:33:50 +03:00
Dmitry Schetnikovich 8472201a36 Merge pull request #999 from alexbevi/patch-1
Sort system.js functions by name (_id)
2016-01-24 14:21:23 +03:00
Dmitry Schetnikovich 554d3f4950 Parallel build enabled for VS 2016-01-24 14:09:57 +03:00
Dmitry Schetnikovich 300713d1ad Temporary empty environment used when running under Windows 2016-01-23 21:57:17 +03:00
Dmitry Schetnikovich 0c06122b36 Documentation for building Robomongo under Windows updated 2016-01-23 21:47:13 +03:00
Dmitry Schetnikovich 08bf485229 Note to documentation added about use of SSH agent in Git Bash. 2016-01-23 21:39:33 +03:00
Dmitry Schetnikovich 0b3bc255e6 Fix for install.bat under Windows 2016-01-23 21:31:53 +03:00
Dmitry Schetnikovich c8f0acf144 MongoDB debug objects and support for debug builds on Windows. 2016-01-23 20:15:35 +03:00
Dmitry Schetnikovich 6152d64d6a Installation batch frontend for Windows 2016-01-23 19:42:16 +03:00
Dmitry Schetnikovich 916daa76c9 Windows build configuration
1. Platform integration plugins are now installed for Windows
2. Installation of Qt libraries for Windows
3. Warnings that are turned off in MongoDB code,  also turned when compiling Robomongo
2016-01-23 19:40:56 +03:00
Dmitry Schetnikovich 9636f5f0f5 Windows standard libraries 2016-01-22 22:03:57 +03:00
Dmitry Schetnikovich bda503d3c9 Compilation of QScintilla and QJson on Windows. 2016-01-22 21:30:15 +03:00
Dmitry Schetnikovich d39a79b121 Merge branch 'v0.9' of github.com:paralect/robomongo into v0.9 2016-01-22 20:09:00 +03:00
Dmitry Schetnikovich 68cd7ecc70 Towards Robomongo for Windows
1. Build objects for MongoDB in release mode
2. Shell frontend for common build operations
3. Support for basic packaging in installation phase
2016-01-22 20:07:54 +03:00
schetnikovich 3e82292cfc Prerequisites documentation for building Robomongo for Windows platform 2016-01-22 17:23:19 +03:00
schetnikovich f825309d6e Documentation stab for Building Robomongo on Windows 2016-01-21 21:38:12 +03:00
schetnikovich 852c7041d2 Safer operation for directory removing 2016-01-21 14:50:22 +03:00
schetnikovich a9e24caf67 Documentation updated for building Robomongo and MongoDB fork 2016-01-21 14:31:04 +03:00
schetnikovich f006547b37 Support for Mac SDK 10.9 2016-01-21 13:55:32 +03:00
schetnikovich fb796ce1c4 Style changes for Mac platform 2016-01-20 20:43:27 +03:00
schetnikovich 20301dd0dd Qt "qt.conf" file used for installation phase and some build code cleanup made. 2016-01-20 16:54:18 +03:00
schetnikovich 8178aa91d2 RuntimeDependencies.md troubleshooting guide 2016-01-20 13:18:44 +03:00
schetnikovich 47f963f7dc Getting rid of "robomongo.sh" on Linux.
1. RPATH is now used for both Linux and Mac
2. File "qt.conf" now embedded to binary for all platforms
2016-01-19 21:44:26 +03:00
schetnikovich dade11a029 Documentation stub for BuildingRobomongo.md 2016-01-19 20:09:56 +03:00
schetnikovich 4225dda194 Fix for 'bin/run' utility when run under Mac 2016-01-19 19:59:29 +03:00
schetnikovich e1fdff1db7 DMG .DS_Store file 2016-01-19 19:13:12 +03:00
schetnikovich 369a79b110 Creation of Application Bundle for Mac with all dependencies 2016-01-19 17:35:53 +03:00
schetnikovich a692d66106 Installation of frameworks for Mac 2016-01-18 20:48:08 +03:00
schetnikovich 5957ad03ab Readme for icns regeneration 2016-01-18 17:48:58 +03:00
schetnikovich 7dbba28a18 Logo in icns format added 2016-01-18 17:46:09 +03:00
schetnikovich 0c260945b1 Raw iconset for new logo 2016-01-18 17:41:40 +03:00
Alex Bevilacqua 9aaf94fb06 Sort system.js functions by name (_id) 2016-01-17 20:27:18 -05:00
schetnikovich 2ffc14a778 Creationg of databases fixed for MongoDB 3.x 2016-01-17 19:46:00 +03:00
schetnikovich 8910b2f0cb Default settings restored 2016-01-17 19:02:30 +03:00
schetnikovich e2323967e8 Correct background color for TabBar on Linux 2016-01-17 18:43:34 +03:00
schetnikovich d6fdffd59b First steps to style Tab bar for Mac 2016-01-17 18:28:37 +03:00
schetnikovich fd08b27857 Window position for main window and JSON editor now relative to screen size. 2016-01-17 16:31:23 +03:00
schetnikovich a6babd6e0e Bash helper script to run application 2016-01-17 14:38:02 +03:00
schetnikovich 7f371314ce List of MongoDB debug objects 2016-01-16 21:34:41 +03:00
schetnikovich 75e82917aa Compilation for Mac OS 2016-01-16 20:44:35 +03:00
schetnikovich 1befc7e7c5 Mac OS dependencies 2016-01-16 19:27:10 +03:00
schetnikovich ce86901784 Missed DBus library for Linux 2016-01-16 14:38:16 +03:00
schetnikovich 1e40dfa2c0 Several tweaks for building and packaging
1. Linux specific dependencies added
2. Current git commit hash added to package file name
3. Now we use known target Qt5::Core to find Qt lib folder
2016-01-16 14:09:58 +03:00
schetnikovich aa12fbe1c2 Fix installation and packaging for Linux 2016-01-16 13:34:08 +03:00
schetnikovich 510e699bbe Bash frontend intro documentation 2016-01-15 20:48:01 +03:00
schetnikovich 5956997e94 Bash frontends for CMake on Unix-like OSes
1. bin/configure to run CMake configuration
2. bin/build to run CMake build generator
3. bin/install to run CMake 'install/strip' target
4. bin/pack to run CMake 'package" target
5. bin/clean to completely clean 'build' folder
2016-01-15 20:42:13 +03:00
schetnikovich 6cd40d17fe TGZ package creation for Linux 2016-01-15 18:27:30 +03:00
schetnikovich e48fae561b Strip debug info when creating package 2016-01-15 17:54:58 +03:00
schetnikovich b814924352 Do not compile unused lexers for Scintilla (only CPP and JS are left) 2016-01-15 17:35:56 +03:00
schetnikovich dc674d1991 Identified set of Scintilla lexers that are not needed for Robomongo. 2016-01-15 17:15:46 +03:00
schetnikovich f3ecf42f9f PackageRobomongo.cmake added 2016-01-15 17:05:02 +03:00
schetnikovich c5f6f68225 Use relative paths in DESTINATION param of install() command. 2016-01-15 17:00:57 +03:00
schetnikovich 7aaaf6abb6 Several build tweaks for Linux (tested both for release and debug).
1. CMAKE_POSITION_INDEPENDENT_CODE turned on
2. THREADS_PREFER_PTHREADS_FLAT turned on as recommended in module documentation
3. Configuration summary moved to separate file
4. Cleanup of used CXX flags (only -fPIC and -std=c++11 are used for now)
5. Usage of Threads::Threads target instead of explicit link to "pthreads"
2016-01-15 15:35:48 +03:00
schetnikovich 63c942bd20 Installation of Qt plugins 2016-01-15 06:18:58 +03:00
schetnikovich ebbef08258 Robomongo configuration summary updated 2016-01-14 20:30:01 +03:00
schetnikovich 1aff489efe Installation of wrapper script and required ICU libraries 2016-01-14 20:26:09 +03:00
schetnikovich 83e088870e Qt5 libraries copied: Core, Gui and Widgets. 2016-01-14 19:23:10 +03:00
schetnikovich 173a4e7912 Install scripts for Linux. Qt5 libraries copied for distribution. 2016-01-14 19:22:28 +03:00
schetnikovich 9ba567752a JIT enabled (and new icon added :) 2016-01-13 19:48:27 +03:00
schetnikovich f0f0d448ae MongoDB ScriptEngine seems no longer needs to be cleaned 2016-01-13 19:11:14 +03:00
schetnikovich 63f63c4142 Diagnostic output removed from dbshell 2016-01-13 03:18:41 +03:00
schetnikovich 0a135a08b0 CMAKE_INCLUDE_CURRENT_DIR turned off 2016-01-13 03:10:01 +03:00
schetnikovich 802b15228c Several changes
1. Added missed BUILD_MINSIZEREL check
2. Cleanup of robomongo/CMakeLists.txt
3. Removed OS_WIN, OS_MAC and OS_LINUX definitions
4. Q_OBJECT added back to JSLexer
5. Manual moc for QScintilla (automatic doesn't work)
2016-01-12 21:24:49 +03:00
schetnikovich 2459a92a23 Switched to object linking mode with MongoDB instead of static libs.
1. List of objects now read from files
1. Release builds now supported for Linux (and by default)
2. Process of creation of object files is documented
3. In configuration summary we now show Build Type.
2016-01-12 18:52:47 +03:00
schetnikovich 34fc597cc8 FindMongoDB.cmake changes 2016-01-12 16:12:41 +03:00
schetnikovich 13483d3ea2 DefineDefaults.cmake with platform and build type checks 2016-01-11 20:15:14 +03:00
schetnikovich 2776da3660 Formating fix 2016-01-11 19:35:42 +03:00
schetnikovich d819ab361a Default CMAKE_BUILD_TYPE is RelWithDebInfo 2016-01-11 19:33:59 +03:00
schetnikovich 85cbe8e9cd CMake cache cleanuped. All unnecessary cache entries removed 2016-01-11 19:04:25 +03:00
schetnikovich 519fea6f66 FindMongoDB.cmake: INTERFACE IMPORTED instead of STATIC IMPORTED 2016-01-11 15:44:25 +03:00
schetnikovich f35aba90ab Minor changes in file names 2016-01-10 20:30:41 +03:00
schetnikovich 567c2cc2ad FindMongoDB.cmake module now publishes IMPORTED target with all required include dirs, libs and definitions 2016-01-10 20:22:59 +03:00
schetnikovich 47576ae8c0 FindMongoDB.cmake module integrated with Robomongo 2016-01-10 19:14:20 +03:00
schetnikovich b25b33a3a1 CMake target interface is used, instead of DIRECTORY scoped definitions and other compile options 2016-01-10 18:11:23 +03:00
schetnikovich 745bc86275 Readme updated 2016-01-10 17:22:12 +03:00
schetnikovich 128ef1e6fc QScintilla sources moved to third-party/qscintilla/sources folder. README file added 2016-01-10 17:09:48 +03:00
schetnikovich b550bb287a QJson sources moved to /third-party/qjson/sources folder. README file added 2016-01-10 16:54:22 +03:00
schetnikovich 0beb3c886a CMake scripts for QScintilla 2016-01-10 16:10:04 +03:00
schetnikovich b472e90849 CMake script for QJson 2016-01-10 15:41:02 +03:00
schetnikovich 16e09e7e82 Compilation and linking on Linux against MongoDB 3.2
1. Cleanup of CMake (in progress)
  2. FindModule for MongoDB (in progress)
2016-01-09 20:03:55 +03:00
schetnikovich 0eafa778b0 Tada! Robomongo embeds MongoDB 3.2 shell and runs. But for now it cannot connect to MongoDB :). This should be investigated in next days 2016-01-06 22:13:27 +03:00
schetnikovich f8f6f08de9 LogWidget now linked successfully 2016-01-06 21:11:57 +03:00
schetnikovich 226ebe0c75 Files in gui folders dialogs, editors, utils and widgets are compiled and linked 2016-01-06 20:59:45 +03:00
schetnikovich 8c59a8bebb New set of compiled and linked units 2016-01-06 20:48:44 +03:00
schetnikovich 08c72911c5 More compiled and linked units 2016-01-06 20:42:26 +03:00
schetnikovich 71ba8cf9e5 Logbook of migration notes 2016-01-06 20:19:57 +03:00
schetnikovich 81c27fe5dc Successfully linked against upgraded QScintilla2 2016-01-06 20:05:24 +03:00
schetnikovich a04773ccf3 Scintilla upgraded from 3.3.6 to 3.5.4. QScintilla wrapper upgraded from 2.8.4 to 2.9.1 2016-01-06 19:51:40 +03:00
schetnikovich 7273f790d6 Two additional files compiled and linked successfully 2016-01-06 19:47:39 +03:00
schetnikovich b69647d881 Third isolated scope of compilation units 2016-01-06 19:33:42 +03:00
schetnikovich 7226577fcb New isolated set of compilation units compiled and linked successfully 2016-01-06 19:11:23 +03:00
schetnikovich f323fa8b88 Compilation of isolated set of files. Log severity now uses new mongo::logger::LogSeverity() class 2016-01-05 20:31:12 +03:00
schetnikovich 875094a359 Linking with roboshell 2016-01-05 07:19:28 +03:00
schetnikovich 38e7d29a8f BsonUtils and Logger 2016-01-05 02:33:42 +03:00
schetnikovich c716ea4b30 StdUtils, QtUtils and Logger 2016-01-04 21:13:08 +03:00
schetnikovich a2c398540b CMake utils 2016-01-04 17:30:33 +03:00
schetnikovich 4d821f1261 Shell code moved to trash 2016-01-04 14:14:39 +03:00
schetnikovich baaac575c1 Radical project cleanup 2016-01-04 14:07:46 +03:00
schetnikovich ba78c201b8 Ignore vim's *.swp files 2016-01-04 13:31:16 +03:00
schetnikovich 0ec8d76220 Upgraded to newer version of QJson 2016-01-03 20:39:31 +03:00
schetnikovich 968a83c380 Ignore .idea files 2015-12-28 15:25:49 +03:00
Dmitry Schetnikovich b6a2db169e Update README.md 2015-12-11 18:28:34 +03:00
Dmitry Schetnikovich 4e615fbce4 Update README.md 2015-12-11 18:12:55 +03:00
Dmitry Schetnikovich 57251327ae Update README.md 2015-12-10 13:13:34 +03:00
Dmitry Schetnikovich 9a0becd470 Merge pull request #986 from myaskevich/patch-1
Update README.md
2015-12-10 13:11:55 +03:00
Maxim Yaskevich 974cc4b561 Update README.md
Fix Magic Backlog link
2015-12-10 12:48:17 +03:00
Andrew Orsich 165f23753f updated readme. features in mind :) feature -> future 2015-12-10 11:05:58 +03:00
Andrew Orsich 8ac6426d91 Updated readme, added notes about campaign. 2015-12-10 10:39:15 +03:00
Stephen Steneker 97c1cf55c8 Fix #831: Text mode number values displaying in scientific notation 2015-04-15 21:30:00 +10:00
Stephen Steneker c43ea0e690 Merge pull request #844 from hdeheer/patch-1
Fix missing ; for point size in settingsManager
2015-04-15 21:26:39 +10:00
Hubert 09d84aedb3 Fix missing ; 2015-04-15 13:01:20 +02:00
Stephen Steneker 40585da9a4 Merge pull request #803 from CraigKelly/bug-649
Allow font specification to work around issue #649
2015-04-15 16:43:50 +10:00
Stephen Steneker 5abd6029d5 Merge pull request #836 from candronikos/fix-CMAKE-INSTALL_PREFIX
Fixed CMAKE_INSTALL_PREFIX typo
2015-04-15 10:46:16 +10:00
Christopher Andronikos d766cf5c56 Fixed CMAKE_INSTALL_PREFIX now has effect 2015-04-04 17:07:59 +11:00
Stephen Steneker 91246d6c26 Ignore Qt5 Creator's user files 2015-03-20 17:12:28 +11:00
Stephen Steneker 7f54a7ec2c Fix #804: Some keys not working in 0.8.5 (Windows remote to Ubuntu
running xrdp)
2015-03-19 21:00:58 +11:00
Stephen Steneker f96ec0a1c2 Add a Support section and link to Gitter chat 2015-03-19 20:59:33 +11:00
Stephen Steneker e3af2978e1 Set dev version to 0.8.6 for bugfix release 2015-03-19 17:02:46 +11:00
Stephen Steneker 3298c06577 Fix #806: Respect setting of MACOSX_DEPLOYMENT_TARGET for min OS X SDK 2015-03-19 17:00:00 +11:00
Stephen Steneker 6a06ed57d2 Update README with current & upcoming release info and more ways to
contribute.
2015-03-18 05:49:38 +11:00
Craig Kelly 1204c5ddca Add text font family and point size to SettingsManager and honor in
GuiRegistry. This allows Linux users experiencing issue #649 to use a
different font (since the default monospace font appears to be giving Qt5
fits on some systems). It is also the first half of implementing #645
2015-03-16 17:30:13 -05:00
Stephen Steneker 28deda2425 Merge pull request #785 from rskvazh/master
Fix #475 wrong type for field (count) 1 != 16
2015-03-15 13:07:45 +11:00
Stephen Steneker 5446ecf43e Bump release version & copyright for 0.9.0dev 2015-03-15 13:06:39 +11:00
Stephen Steneker 3170d5dec1 Remove unused Circle icons 2015-03-15 11:02:20 +11:00
Stephen Steneker 092ba3e06d Remove unused bson-old icons 2015-03-15 11:00:23 +11:00
Stephen Steneker deaef6ca2b Fix #796: Incorrect description for RPM package 2015-03-14 14:22:55 +11:00
Stephen Steneker e2678c177d Fix #783: Create 0.8.5 64-bit RPM package
- update deps to install RPM on Centos 6.6 minimal w/ Qt 5.3.2
2015-03-14 05:30:27 +11:00
Stephen Steneker 9b1e65b95a Fix #787: 0.8.5 .deb package missing Qt xcb plugin
- remove hardcoded (and outdated deps) and re-enable auto-detection
2015-03-12 20:54:36 +11:00
Stephen Steneker 3b5d96f71f Merge branch 'master' of github.com:paralect/robomongo 2015-03-12 00:22:11 +11:00
Stephen Steneker eb54fbeb68 Remove copy-pasta backup of cmake files 2015-03-12 00:21:28 +11:00
Stephen Steneker aa2e887a55 Fix #733: make fails while building ExternalLexer 2015-03-12 00:16:15 +11:00
Stephen Steneker 64711a7056 Suppress deprecation warnings in third_party libs 2015-03-12 00:11:20 +11:00
Stephen Steneker 7b3550d474 Suppress C++11 literal-suffix warnings 2015-03-12 00:09:25 +11:00
Stephen Steneker 7bfe5b4dbb Fix #425: Build fails: error: 'uint64_t' does not name a type
- also suppress spurious warnings in gcc 4.8.x
2015-03-11 23:16:17 +11:00
Stephen Steneker 3f82453a64 Add Linux ICU dependencies for Qt 5.3 2015-03-11 22:55:25 +11:00
Stephen Steneker 1aefb681f9 Make cmake 3.0 policy checks conditional 2015-03-11 22:51:34 +11:00
Roman Skvazh 025295a330 Remove unnecessary include 2015-03-11 11:54:11 +03:00
Roman Skvazh d0980f215a Fix #475 wrong type for field (count) 1 != 16 2015-03-11 11:45:32 +03:00
Stephen Steneker 77e065082d Relax cmake version requirement since Ubuntu 14.04 LTS is still 2.8.12 2015-03-11 14:07:35 +11:00
Stephen Steneker c9db235664 FindOpenSSL.cmake fails to find new version (1.0.2) of OpenSSL 2015-03-11 09:11:15 +11:00
Stephen Steneker 5ea5adeb55 Update new default win32 policies for cmake 3.0 2015-03-11 08:54:57 +11:00
Stephen Steneker 24feab23a0 Update ICU libs for Qt 5.3.x on Win32 2015-03-11 08:45:48 +11:00
Stephen Steneker 183f1cdeca Typo: s/Deployng/Deploying/ 2015-03-10 21:32:06 +11:00
Stephen Steneker 84d76ac775 Fix #743: build/link error on OS X release build 2015-03-10 10:15:58 +11:00
Stephen Steneker 6d2099852b Add release date for 0.8.5 :) 2015-03-10 10:14:56 +11:00
Stephen Steneker c0739cf1ab Ignore debug/release build dirs 2015-03-10 09:53:24 +11:00
Stephen Steneker 4738ad7f56 Fix #728 .. typo in CMakelists 2015-01-05 14:33:26 +11:00
Stephen Steneker 2d5f01af29 Correct case for LexLaTeX.cpp 2015-01-01 01:08:09 +11:00
Stephen Steneker aef5cb8a2c Fix #726 (Update Robomongo icon) with updated images thanks to @anknetau 2014-12-30 23:51:30 +11:00
Stephen Steneker fd6033e1d4 Fix #726 (Update Robomongo icon) with updated images thanks to @anknetau 2014-12-30 23:50:08 +11:00
Stephen Steneker e98e8e90c4 Disable broken "Copy Collection to Database" misfeature (#398) 2014-12-30 16:16:49 +11:00
Stephen Steneker 5e5a87f0f9 Disable "Copy collection to database"; per issue #398 current
implementation is highly problematic
2014-12-30 16:08:53 +11:00
Stephen Steneker 0902e0c557 Remove RC patch version 2014-12-30 15:51:22 +11:00
Stephen Steneker 64a8244552 Merged PR#724 for retina text display 2014-12-30 15:46:56 +11:00
Stephen Steneker 9394e181c9 Merge pull request #724 from m--stein/master
Fix for Retina Display on Mac #248
2014-12-30 15:03:06 +11:00
Michael Steinacher 5c3bd1dc5a #248 updated QScintilla to 2.4.8 for retina display support 2014-12-29 00:23:52 +01:00
Michael Steinacher a6b6c2b57b #248 Fix Info.plist for Retina support 2014-12-21 13:26:53 +01:00
Michael Steinacher 708bc48823 #248 Fix Info.plist for Retina support 2014-12-21 13:26:22 +01:00
Stephen Steneker 4a1a938094 Merge branch 'master' of github.com:paralect/robomongo 2014-11-15 15:47:43 +11:00
Stephen Steneker 3d060d7bdf W00t! New app icon designed by Andres Kievsky (@anknetau) 2014-11-15 15:46:26 +11:00
Stephen Steneker e308b24d2e Merge pull request #693 from anknetau/master
Added new app icon in a variety of png and iDraw formats
2014-11-15 15:45:39 +11:00
Stephen Steneker a47343ff0a Set VERSION policy for cmake 3.0+ (CMP0048) 2014-11-15 15:42:12 +11:00
Stephen Steneker ac76b6411d Bump 0.8.5rc0 2014-11-15 15:26:01 +11:00
Stephen Steneker 843086634d Note contribution for PR #684 2014-11-15 15:12:20 +11:00
Stephen Steneker 0b2eb2d930 Merge pull request #684 from volans-/master
CreateUserDialog.cpp: fixed typo in warning message
2014-11-15 15:09:43 +11:00
Andres Kievsky ac9d26900b Added app icon in a variety of png and iDraw formats 2014-11-15 08:21:57 +11:00
volans- a7240d523f CreateUserDialog.cpp: fixed typo in warning message 2014-10-30 19:38:10 -07:00
Stephen Steneker f6e5e20cdb Add missing issue to changelog 2014-10-21 06:44:38 +11:00
Stephen Steneker 5eeff07d8c Changelog for 0.8.5 2014-10-21 00:19:45 +11:00
Stephen Steneker db7d0f7578 Merge pull request #637 from stennie/issue-636
Issue #636: Log errors if can't create settings path or write to config file
2014-08-14 08:54:25 +10:00
Stephen Steneker f5fad8f51b Issue #636: Log errors if can't create settings path or write to config file 2014-08-14 06:33:30 +10:00
Stephen Steneker 1237693762 Merge pull request #633 from stennie/issue-468
Document OS X editing shortcuts for begin/end of line/text
2014-08-11 11:04:28 +10:00
Stephen Steneker 6be1ad5fdf Add undocumented OS X editing shortcuts for begin/end of line/text
(mentioned in #468)
2014-08-11 11:01:49 +10:00
Stephen Steneker 35f7fd9df3 Merge pull request #632 from stennie/issue-631
Fix #631: "Duplicate Query In New Tab"
2014-08-10 08:19:01 +10:00
Stephen Steneker 83e722a99b Fix #631: "Duplicate Query In New Tab"
- add keyboard shortcut: Ctrl/Cmd+Shift+T
 - add to Window menu
2014-08-10 08:16:41 +10:00
Stephen Steneker bd5f8dc5f7 Merge pull request #629 from stennie/issue-455
Fix #455: Show execution time for operations that don't return results
2014-08-08 00:23:26 +10:00
Stephen Steneker 6dcd6f1665 Fix #455: Show execution time for operations that don't return results 2014-08-08 00:22:35 +10:00
Stephen Steneker a7ee61b586 Merge pull request #628 from stennie/issue-622
Fix #622: Type of Double changed to Int32 on save document
2014-08-07 22:05:29 +10:00
Stephen Steneker fbddb83cc7 Fix #622: Type of Double changed to Int32 on save document 2014-08-07 22:03:35 +10:00
Stephen Steneker 7d3bd637a9 Merge pull request #604 from VBelozyorov/issue-47
Include connection name in TopStatusBar
2014-06-22 11:39:07 -04:00
Vladimir Belozyorov fee5e5d027 Unused TopStatusBar::setCurrentConnection removed 2014-06-19 23:02:21 +04:00
Vladimir Belozyorov 585fe6afd1 Connection name in TopStatusBar 2014-06-19 00:14:54 +04:00
Stephen Steneker 183e9cfb09 Merge pull request #578 from gavruk/autocompldisable
Ability to disable autocompletion (#512)
2014-06-18 12:05:11 -07:00
Sergey Gavruk 2a32c4b828 Ability to disable autocompletion (#512) 2014-06-18 20:57:10 +03:00
Stephen Steneker e89ed86dae Merge pull request #595 from VBelozyorov/issue-457
Changes in toolbars visibility are saved in config file
2014-06-17 17:18:06 +10:00
Stephen Steneker 01581751b1 Merge pull request #591 from VBelozyorov/issue-384
Expand/collapse multiple selections
2014-06-17 17:15:15 +10:00
Vladimir Belozyorov 3cd29c0fbc Text in tooltips are changed in accordance to key shortcuts 2014-06-17 17:00:46 +10:00
Vladimir Belozyorov 1c5382af9e Expand/Collapse Recursively work not only for entire documents 2014-06-16 21:33:54 +04:00
Vladimir Belozyorov 33616550e8 Selected index doesn't pops up to the super-parent if only one item selected in BsonTreeView 2014-06-16 21:30:52 +04:00
Vladimir Belozyorov 344d7d0bf2 Merge branch 'master' of https://github.com/paralect/robomongo into issue-384 2014-06-16 20:16:16 +04:00
Vladimir Belozyorov 977270bf3c Merge branch 'master' of https://github.com/paralect/robomongo into issue-457
Conflicts:
	src/robomongo/core/settings/SettingsManager.cpp
2014-06-16 19:57:48 +04:00
Kanstantsin Kamkou 0dcd717a1b limit and offest sizes are increased 2014-06-16 15:11:13 +10:00
Stephen Steneker e4a91b2383 Merge pull request #593 from VBelozyorov/issue-514
Option to disable selected code autoexecution when opening a new tab
2014-06-16 07:10:09 +10:00
Stephen Steneker 137b8598e2 Merge pull request #596 from VBelozyorov/logs-time-format
Include full date/time for log entries
2014-06-16 07:03:47 +10:00
Vladimir Belozyorov dee472f026 Toolbars names changed 2014-06-15 13:08:58 +04:00
Vladimir Belozyorov 0b2edf612c Submenu for toolbars visibility management.
Using enable/disable instead of visible/invisible for exec toolbar and orientation action
2014-06-15 12:59:49 +04:00
Vladimir Belozyorov e234418f51 Date and hours leading zero 2014-06-15 12:46:01 +04:00
Vladimir Belozyorov abc698d32e Changing the toolbar visibility by program logic mustn't cause to config changing 2014-06-15 00:20:36 +04:00
Stephen Steneker c2a4cfeefc Merge pull request #592 from VBelozyorov/cursor-init
Cursor initialization - place between curly brackets for default find({}) query
2014-06-15 00:48:44 +10:00
Stephen Steneker c7995fa2b7 Merge pull request #594 from VBelozyorov/issue-433
"Show/Hide" buttons for password and passphrase fields
2014-06-15 00:41:47 +10:00
Vladimir Belozyorov cd03cebb91 AM/PM removed from records in LogWidget 2014-06-13 23:39:26 +04:00
Vladimir Belozyorov 7ccfcce9d7 SshTunelTab replaced with SshTunnelTab 2014-06-13 22:44:04 +04:00
Vladimir Belozyorov d6bc5d5a88 Changes in toolbars visibility are saved in config file
#457
2014-06-13 22:20:00 +04:00
Vladimir Belozyorov a02218d634 SettingsManager stores toolbars settings
only isVisisble, for now
2014-06-13 22:17:13 +04:00
Stephen Steneker 86edc64a19 Clean up GenericName 2014-06-12 23:54:43 +10:00
Vladimir Belozyorov 8f00ab3dfe Fix #433: "Show/Hide" buttons for password and passphrase fields 2014-06-12 15:37:20 +04:00
Vladimir Belozyorov 75a1112986 Fixed saving option into config file 2014-06-12 02:13:47 +04:00
Vladimir Belozyorov bb3ea494a6 Item for options menu 2014-06-12 02:04:50 +04:00
Vladimir Belozyorov 8117919fe5 Check setting state on new tab opening 2014-06-12 02:03:39 +04:00
Vladimir Belozyorov 9a6b3236af Setting for auto execution 2014-06-12 02:02:42 +04:00
Stephen Steneker e924b1a8ec Merge pull request #588 from gavruk/settingsmanagertypo
[-] SettingsManager typo
2014-06-12 07:18:41 +10:00
Vladimir Belozyorov 4fbfa1e3e0 "View documents" item of collection's context menu does the same query as double click on collection item 2014-06-12 01:10:17 +04:00
Vladimir Belozyorov eea3b74778 Cursor placed between curly braces after double click on collection item 2014-06-12 01:08:45 +04:00
Vladimir Belozyorov 47582bf729 "Collapse Recursively" feature for Tree Mode 2014-06-11 23:45:07 +04:00
Vladimir Belozyorov 882b2ed721 Robomongo::detail::uniqueRows() returns indexes of top-level items 2014-06-11 23:42:28 +04:00
Sergey Gavruk 4ab5ae3ad9 [-] SettingsManager typo 2014-06-11 21:40:14 +03:00
Vladimir Belozyorov ffe4491094 Expanding of multiple selected documents
#384
2014-06-10 21:55:30 +04:00
Vladimir Belozyorov fa4fa67b87 Typo Multy -> Multi 2014-06-10 21:35:02 +04:00
Stephen Steneker 366c3bab10 Merge pull request #584 from stennie/issue-559
Fix #559: Default ObjectID - Timestamp Tooltip
2014-06-10 09:33:21 +10:00
Stephen Steneker b3f21cbe32 Fix #559: Default ObjectID - Timestamp Tooltip
- add "Copy Timestamp from ObjectId" to context menu for ObjectId field
2014-06-10 09:29:31 +10:00
Stephen Steneker 50179cc27a Merge pull request #581 from stennie/issue-447
Issue #447: Reload actually re-executes query
2014-06-08 18:31:46 +10:00
Stephen Steneker 03c6abca60 Issue #447: Reload actually re-executes query
- rename "Reload" to "Re-execute Query"
 - rename "Duplicate" to "Duplicate Query In New Shell"
2014-06-08 18:29:14 +10:00
Stephen Steneker 2a663f658a Merge pull request #580 from stennie/issue-551
Fix #551: Reload Query with keyboard shortcut doesn't work
2014-06-08 18:02:30 +10:00
Stephen Steneker 46d4fb576d Fix #551: Reload Query with keyboard shortcut doesn't work 2014-06-08 18:01:15 +10:00
Stephen Steneker 9bc52f594e Merge branch 'master' of github.com:paralect/robomongo 2014-06-08 17:40:26 +10:00
Stephen Steneker 87bf0e121d Use setShortcuts() instead of setShortCut() with QKeySequence
combinations to catch alternate sequences in addition to primary.
2014-06-08 17:38:50 +10:00
Stephen Steneker 5560f5d721 Merge pull request #579 from stennie/issue-421
Fix #421: Consistent numbering for tree/table/text view items
2014-06-08 17:23:39 +10:00
Stephen Steneker aee1fea979 Fix #421: Consistent numbering for tree/table/text view items 2014-06-08 17:21:40 +10:00
Stephen Steneker c71dc28c76 Detab and fix indentation 2014-06-08 16:47:21 +10:00
Stephen Steneker dfffef1d9c Fix spello in comment 2014-06-08 16:46:43 +10:00
Stephen Steneker 6546511d2e Spello fixup: s/indexses/indexes/g 2014-06-08 16:37:30 +10:00
Stephen Steneker 34cf176e24 Merge pull request #577 from stennie/issue-548
Fix #548: Cannot make the Edit Document Window smaller
2014-06-08 01:31:48 +10:00
Stephen Steneker 0a5c086b26 Fix #548: Cannot make the Edit Document Window smaller
- minimumSize() of editor window was incorrectly set based on screen
   geometry
2014-06-08 01:28:29 +10:00
Stephen Steneker 44c1cb8e8f Merge pull request #576 from stennie/issue-87
Fix #87: Switching tabs using standard keys on OS X
2014-06-08 00:55:38 +10:00
Stephen Steneker 44f79cb03f Fix #87: Switching tabs using standard keys on OS X
- use QKeysequence::NextChild and QKeysequence::PreviousChild for
   standard cross-platform next/prev tab keyboard shortcuts
 - add Window menu including full screen, minimize, and prev/next tab
2014-06-08 00:51:11 +10:00
Stephen Steneker 62ea86c485 Merge pull request #570 from stennie/issue-405
Fix #405: expand current server as soon as you connect to it
2014-06-04 00:38:01 +10:00
Stephen Steneker 07eddfe53d Fix #405: expand current server as soon as you connect to it 2014-06-04 00:37:03 +10:00
Stephen Steneker 1f32363f66 Merge pull request #569 from stennie/issue-468
Issue 468: add Ctrl/Cmd+'/'' as comment/uncomment keyboard shortcut
2014-06-03 23:54:51 +10:00
Stephen Steneker 33fae9f482 Add note on new shortcuts to toggle comment/uncomment 2014-06-03 23:53:25 +10:00
Stephen Steneker 12a0281283 Per #468: add Ctrl/Cmd+'/'' as comment/uncomment keyboard shortcut 2014-06-03 23:41:39 +10:00
Stephen Steneker d4f2304c82 Merge pull request #568 from stennie/issue-544
Fix #544: Space after document causes validation error
2014-06-03 23:24:24 +10:00
Stephen Steneker db80ef4bfb Fix #544: Space after document causes validation error
- error messages for JSON validation could still be greatly improved
2014-06-03 23:21:43 +10:00
Stephen Steneker 0d85ac6a18 Remove obsolete instructions 2014-06-03 22:42:47 +10:00
Stephen Steneker 8e46fcfbb2 Grammar correction: s/is no results/are no results/ 2014-06-03 21:51:35 +10:00
Stephen Steneker c813fef558 Merge pull request #567 from stennie/issue-564
Fix #564: Add user preference to have line numbers displayed in editor by default
2014-06-03 20:20:09 +10:00
Stephen Steneker a9d21ddc39 Fix #564
- User preference to have line numbers displayed in editor by default
2014-06-03 20:17:57 +10:00
Stephen Steneker d489d9a83c Merge pull request #556 from VBelozyorov/issue-509
Saving previous view modes in private field of OutputWidget
2014-06-03 19:07:52 +10:00
Stephen Steneker ee89cd47f7 Merge pull request #555 from VBelozyorov/issue-467
Comment / uncomment selected code in the shell
2014-06-03 19:00:59 +10:00
Vladimir Belozyorov 6822013d5d Unnecessary typecast removed
#467
2014-06-03 08:15:44 +04:00
Stephen Steneker fa26dfe9c7 Merge pull request #565 from stennie/issue-449
Fixes #449: Add line numbers to JSON editing window (OS X)
2014-06-03 00:29:39 +10:00
Stephen Steneker 1ac22072a5 Fixes #449
- Line numbers in JSON views can be toggled with Ctrl+F11 on OS X
2014-06-03 00:21:03 +10:00
Stephen Steneker eaf484b9c7 Merge pull request #563 from stennie/issue-519
Fixes #519: Full screen mode not working on OS X
2014-06-02 23:58:08 +10:00
Stephen Steneker 1b7ad2c4f5 Fixes #519: Full screen mode not working on OS X
- changed fullscreen shortcut to Cmd/Ctrl+F11
2014-06-02 23:56:50 +10:00
Stephen Steneker d936a2b75c Merge pull request #560 from stennie/issue-408
Fixes #408
2014-06-02 23:21:11 +10:00
Stephen Steneker 62160ac662 Fixes #408
- use standard "New" shortcuts to open new connections
 - use standard "Open" shortcuts to open .js files
 - update shortcuts.txt with current shortcuts
2014-06-02 22:59:25 +10:00
Vladimir Belozyorov d51481faaa Saving previous view modes in private field of OutputWidget
#509
2014-06-01 18:13:04 +04:00
Vladimir Belozyorov 0d9a72b058 Ctrl+Shift+C shortcut toggle comments in the shell
#467
2014-06-01 16:20:51 +04:00
Vladimir Belozyorov 2de96e705f Public methods for managing value of ScriptWidget::_disableTextAndCursorNotifications 2014-06-01 16:13:05 +04:00
Vladimir Belozyorov 5ce6ead32e Ignore Ctrl+Shift+C in RoboScintilla::keyPressEvent() 2014-06-01 16:01:44 +04:00
Vladimir Belozyorov 1444197e50 Hotkey for comment toggling in KeyboardManager 2014-06-01 15:49:12 +04:00
Dmitry Schetnikovich 169a4ea24d Merge pull request #527 from stennie/issue-414
Fix #414: View documents fail if collection name is "group"
2014-05-14 19:24:34 +03:00
Dmitry Schetnikovich c9b0af1cfe Merge pull request #530 from stennie/issue-500
Fix #500: TTL index should allow expiry of 0 seconds
2014-05-12 20:57:04 +03:00
Dmitry Schetnikovich 3a542eb8d0 Merge pull request #529 from stennie/issue-505
Fix #505: OS specific keyboard shortcut tips
2014-05-12 20:56:50 +03:00
Dmitry Schetnikovich 4f83b8954b Merge pull request #528 from stennie/issue-506
Fix #506: Usability request - add initial curly braces to command bar
2014-05-12 20:56:20 +03:00
Dmitry Schetnikovich b2bbcc2836 Merge pull request #525 from stennie/issue-524
Fix #524: OS X build fixes for XCode 5 / libc++
2014-05-12 20:44:21 +03:00
Stephen Steneker 9fd7c93ef2 Fix #500: TTL index should allow expiry of 0 seconds
Docs example:
http://docs.mongodb.org/manual/tutorial/expire-data/#expire-documents-at-a-certain-clock-time
2014-05-05 23:31:40 +10:00
Stephen Steneker 2d09dc3763 Fix #505: OS specific keyboard shortcut tips 2014-05-05 20:06:11 +10:00
Stephen Steneker 819d6b2dba Fix #506: Usability request - add initial curly braces to command bar 2014-05-05 18:32:55 +10:00
Stephen Steneker bb988da66a Fix #414
Given that conflicting function names may vary between versions of MongoDB,
it is much saner to use the more explicit getCollection() syntax instead of
trying to enumerate all exceptions.
2014-05-05 12:19:53 +10:00
Stephen Steneker 2769173b5a Need to include locale.h for libc++ 2014-05-05 12:00:06 +10:00
Stephen Steneker 9373f1b57f Upgrade from gtest 1.6.0 to 1.7.0 2014-05-05 11:49:41 +10:00
Stephen Steneker 6f40ca27e3 Cherry-pick some libc++ fixes from: https://jira.mongodb.org/browse/SERVER-11070 2014-05-05 11:47:02 +10:00
Stephen Steneker 934aa32325 Fix typo: s/Openning/Opening/ 2014-05-04 23:23:53 +10:00
Stephen Steneker fd9d13e486 Include common rules from gitignore.io 2014-05-04 23:22:05 +10:00
schetnikovich 55428b80dc Resource entries configuration refactored 2013-12-20 00:14:50 +03:00
schetnikovich 029078e44f Tab character removed from source files 2013-12-19 20:30:03 +03:00
schetnikovich 7b6bb1f34a CMakeLists.txt cleanup 2013-12-19 20:19:42 +03:00
schetnikovich 9d4957a968 CMake cleanups, baby steps 2013-12-19 00:25:54 +03:00
schetnikovich ee6e6b84bd ComboBox setCurrentText emulation for Qt4 2013-12-18 22:18:33 +03:00
schetnikovich 84ec758cfe Merge branch 'master' of github.com:paralect/robomongo 2013-12-18 22:13:25 +03:00
schetnikovich e3219f3892 Qt4 support is back 2013-12-18 22:13:13 +03:00
Dmitry Schetnikovich 0ef9b18252 Spaces removed from EXTRAPATH 2013-12-14 22:05:45 +03:00
Dmitry Schetnikovich 6b462147e5 Fix for MongoDB build command with extrapath 2013-12-14 20:52:33 +03:00
schetnikovich 132629bc5a Merge branch 'v0.8.4' of github.com:topilski/robomongo into topilski-0.8.4 2013-12-13 20:56:35 +03:00
schetnikovich 9d2cc7a7b4 Changelog updated 2013-11-27 23:35:09 +03:00
schetnikovich 0d4813b711 Backup of CMake files 2013-11-21 22:26:56 +03:00
schetnikovich 1c42c60532 Minor changes in utils.cmake 2013-11-21 22:26:06 +03:00
schetnikovich c3a2fa8558 .gitignore updated 2013-11-20 22:13:20 +03:00
topilski 6c09bb657f Update App version 2013-11-15 15:07:08 +03:00
Dmitry Schetnikovich 61504814dd Merge branch 'master' of https://github.com/paralect/robomongo 2013-11-14 00:02:35 +03:00
Dmitry Schetnikovich a2051d0307 MSVC build fixes 2013-11-14 00:02:20 +03:00
schetnikovich 578e55a780 Support for all reserved words when building collection query and fix for collection names with slashes (#404) 2013-11-13 23:53:55 +03:00
schetnikovich 1a3fd7f731 Output is splited on executable and library. 2013-11-13 22:06:02 +03:00
Dmitry Schetnikovich eee0eb3665 Merge pull request #409 from topilski/084rc2
0.8.4 RC2
2013-11-11 12:01:32 -08:00
schetnikovich 60d80c4717 README.md updates 2013-11-11 01:51:26 +03:00
schetnikovich 1906ed61c0 README.md updates 2013-11-11 01:50:14 +03:00
schetnikovich 545194cb33 Vote for the feature 2013-11-11 01:49:22 +03:00
schetnikovich 619559eee8 Note about backlog 2013-11-11 01:46:28 +03:00
topilski 2b058231dd Fix unix builds 2013-11-08 15:04:42 +03:00
topilski 0200ff055e Some code update 2013-11-08 14:48:15 +03:00
topilski e36c399be7 Date min and max is not parsed or displayed correctly #356 (displaying) 2013-11-08 14:24:55 +03:00
topilski 2f5d8f3071 Date min and max is not parsed or displayed correctl(only crash) #356 2013-11-08 10:24:08 +03:00
Dmitry Schetnikovich 1ce2869a30 Merge pull request #403 from VBelozyorov/issue-402
Saving initial viewMode on forced downgrade, because #402
2013-11-05 13:46:35 -08:00
Vladimir Belozyorov f988474be6 Saving initial viewMode on forced downgrade, because #402 2013-11-05 21:09:20 +04:00
schetnikovich 365b5ce735 Change log updated for 0.8.4 2013-11-04 19:41:21 +03:00
schetnikovich 5d1348ff9b Whats new file updated for Robomongo 0.8.4 2013-11-04 01:37:54 +03:00
Alexandr 1cd59ebca3 Merge pull request #393 from topilski/084-beta2-bugfix
Some little bugfix
2013-10-31 23:16:41 -07:00
schetnikovich 08a5bfbfe1 Naming tweaks 2013-11-01 05:10:59 +03:00
topilski d0156f76dc Add fast build scripts for Windows 2013-10-31 15:57:44 +03:00
topilski 30a3634208 Add new build scripts 2013-10-31 15:20:56 +03:00
topilski 4380f75137 Delete not needed files 2013-10-31 13:57:13 +03:00
topilski 0d7e34f9d9 #386 Multiple confirmation at pressing "delete" key at deleting multiple documents. 2013-10-31 10:30:51 +03:00
schetnikovich 3b192c02e0 Robomongo 0.8.4 beta 2 2013-10-31 00:53:55 +03:00
schetnikovich f4b2cda8b6 SSH configuration UI tweaks 2013-10-31 00:42:35 +03:00
schetnikovich 1bd95d170e SSL configuration UI tweaks 2013-10-30 22:13:05 +03:00
Dmitry Schetnikovich 8f0947df70 Merge pull request #383 from topilski/bugfix
Bugfix
2013-10-28 15:13:49 -07:00
topilski 6dfe7ddab6 Connection context menu appears independently of position of Robomongo instance. 2013-10-28 16:46:53 +03:00
topilski 654fd3e6fb Design of diagnostic dialog while testing connection differs from 0.8.3 (new fix) 2013-10-28 16:20:28 +03:00
topilski aa039e5d18 Fix zlib search algorithm 2013-10-28 09:15:33 -04:00
topilski 95cabe1226 Add static link openssl to build script 2013-10-28 15:46:46 +03:00
topilski f9c9c7b27b Delete cmake warnings 2013-10-28 15:42:23 +03:00
topilski df99ba2e33 Fixup build cpack script 2013-10-28 15:36:43 +03:00
topilski 0ee046f2e6 Add zlib library to openssl static linking 2013-10-28 15:35:39 +03:00
topilski a77583dc2b Fix cpack build script 2013-10-28 11:57:27 +03:00
topilski 63e9e8a355 Design of "Create Database" dialog is changed from 0.8.3 2013-10-28 11:34:59 +03:00
topilski 23d550b1b0 Design of diagnostic dialog while testing connection differs from 0.8.3 2013-10-28 11:20:53 +03:00
topilski 376453e988 Fix rpm package 2013-10-28 03:39:29 -04:00
topilski 0860f3e0c8 Crash at expanding something that you has no permissions to expand. 2013-10-25 13:17:22 +03:00
topilski bd7ff6a67c Create or edit index problem #341 2013-10-25 13:07:59 +03:00
topilski a8000fe1d0 Manage connection: SSH support checkbox unchecks automatically at checking/unchecking authentication. 2013-10-25 12:58:15 +03:00
topilski 1070c33fe6 Merge remote-tracking branch 'upstream/master' 2013-10-24 12:31:02 +03:00
Dmitry Schetnikovich 90a8a2dea5 Merge pull request #375 from topilski/bugfix
Bugfix and Code polishing
2013-10-22 11:02:05 -07:00
topilski f7975f9f06 Add CollectionInfo struct, some refactoring 2013-10-22 16:03:21 +03:00
topilski 8cb033e2b2 Fix modeles dialogs problem 2013-10-22 14:38:06 +03:00
topilski 274d6dc07a [UI] Cannot downsize edit/view document windows. (rbm0.8.3, win7x32) #369 2013-10-22 11:49:24 +03:00
topilski 710d0775d7 Crash at pressing "Ctrl+T" without any connection. 2013-10-21 10:52:07 +03:00
topilski f15e22ae58 SSH option "Security" always switched to "password" after unchecking SSH and saving connection. 2013-10-21 10:45:29 +03:00
topilski 5fbc38d4bd Fix linux package build 2013-10-18 15:29:02 +03:00
topilski 4b009ce440 Update cmakefile 2013-10-18 14:09:33 +03:00
topilski 18726e76eb Add creating symlinks for libssl libraries 2013-10-18 12:59:07 +03:00
topilski 9929332dd2 Crash when add ISODate field #350 2013-10-18 09:35:54 +03:00
topilski 41a29ab74d Merge branch 'master' of https://github.com/topilski/robomongo 2013-10-18 09:05:45 +03:00
Dmitry Schetnikovich e871ea1539 Merge pull request #367 from topilski/117-ssh
#117 and #100: SSH+SSL
2013-10-17 09:11:39 -07:00
topilski 4a8e32c490 Add libssl to install phase 2013-10-17 14:26:51 +03:00
topilski 0f50a30cbe Update error message in case of SSL+SSH are enabled together. 2013-10-17 09:02:25 +03:00
topilski 0352799a55 Once checked SSH, cannot be unchecked. 2013-10-17 09:00:15 +03:00
topilski d21102c8cb Update beta version 2013-10-16 16:32:53 +03:00
topilski f0515056fc Fix displaying server name, and direct connection to ssl server 2013-10-16 15:12:51 +03:00
topilski f75acc76f4 Stable build 2013-10-16 15:03:20 +03:00
topilski e934292152 Typos in Manage Connection dialog. 2013-10-16 12:06:36 +03:00
topilski f76db62c5a Stable ssl pemFile 2013-10-16 12:06:35 +03:00
topilski 592f3653c0 Regexp error (with non-latin symbols) #351 2013-10-16 12:06:35 +03:00
topilski b3781ea229 Fix displaying server name 2013-10-16 12:06:34 +03:00
topilski 6f3c902c73 Added log messages if ssh connect failed 2013-10-16 12:06:34 +03:00
topilski 9eaf490781 Merge libssh2_win and libssh_linux configs 2013-10-16 12:06:33 +03:00
topilski 0fe17b8fa1 SSH support #117 (work on Mac) added needed mac header 2013-10-16 12:06:33 +03:00
topilski 7755912732 SSH support #117 (work on fedora) added needed linux header 2013-10-16 12:06:32 +03:00
topilski 62068bd910 ssh support #117 first stable windows version (without ssh+ssl) 2013-10-16 12:06:32 +03:00
topilski 025997b62d Stable ssh connection (intermediate commit) 2013-10-16 12:06:32 +03:00
topilski 6d3f9ca769 ssh support #117 (only windows, some problem with shell, intermediate commit) 2013-10-16 12:06:31 +03:00
topilski 358628a447 Added SSH tunnel dialog 2013-10-16 12:06:30 +03:00
topilski 633a2dce6a Added RDBClientConnection (Robomongo client connection) 2013-10-16 12:06:30 +03:00
topilski 0a3a4e6778 ScriptEngine global mutex 2013-10-16 12:06:29 +03:00
topilski 14d805c960 Fix build 2013-10-16 12:06:28 +03:00
topilski 4c04c9a3e7 Delete include directory 2013-10-16 12:06:28 +03:00
topilski c80de5ac63 Remove pcre not needed includes 2013-10-16 12:06:25 +03:00
topilski fd655e5afa Stable global variables 2013-10-16 12:06:23 +03:00
topilski 06ec74ded7 Support for mongod's with SSL #100 (work also with sslPEMKeyFile) 2013-10-16 12:06:21 +03:00
topilski f3ba08608c Support for mongod's with SSL #100 (Work as mongo --ssl only) 2013-10-16 12:06:20 +03:00
topilski fa962e9727 Added ssh first step. 2013-10-16 12:06:20 +03:00
topilski fcc03d62f2 Move parse algoritm to mongo jsonparser 2013-10-16 10:54:20 +03:00
Dmitry Schetnikovich 4c5a409f27 Merge pull request #359 from VBelozyorov/issue-345
Auto expand of first item in tree view. #345
2013-10-15 12:50:28 -07:00
Dmitry Schetnikovich 59bae954a4 Merge pull request #365 from VBelozyorov/urls-in-about-dlg
GitHub url doesn't work in About Dialog (Mac)
2013-10-15 11:38:32 -07:00
Dmitry Schetnikovich 7db2b70af5 Merge pull request #364 from rskvazh/patch-1
Url doesn't work in About Dialog (Mac)
2013-10-15 11:37:37 -07:00
Vladimir Belozyorov 2f696080ef Specified protocol in url for issues on github 2013-10-15 21:23:13 +04:00
Vladimir Belozyorov ba3b2471cc Menu option for auto expanding of first item 2013-10-15 19:56:15 +04:00
Roman Skvazh 1e58918abd fix url in about dialog
In Mac OS X link "Visit Robomongo website:" does not work.
2013-10-15 06:19:40 -07:00
topilski 45b6326aa3 Fix ssh checkbox 2013-10-15 16:05:21 +03:00
topilski ec819f5eca Typos in Public and Private key dialogs 2013-10-15 15:27:04 +03:00
topilski 5b926da192 Stable ssh and ssl suport, final build 2013-10-15 15:00:12 +03:00
topilski 7ad06822fd Ssh add publicKey connection 2013-10-15 11:19:58 +03:00
Vladimir Belozyorov 943e06425f Auto expand of first item in tree view. #345 2013-10-12 23:04:59 +04:00
topilski 23e9e44136 Typos in Manage Connection dialog. 2013-10-11 16:56:42 +03:00
topilski f21e0db417 Stable ssl pemFile 2013-10-11 11:43:12 +03:00
topilski 731e5d2aea Regexp error (with non-latin symbols) #351 2013-10-11 10:53:17 +03:00
topilski 57c0007249 Fix displaying server name 2013-10-11 09:24:31 +03:00
topilski 48d98f5657 Added log messages if ssh connect failed 2013-10-10 14:43:54 +03:00
topilski 5e25e62b8f Merge libssh2_win and libssh_linux configs 2013-10-10 14:01:15 +03:00
topilski dff8f9dfd7 SSH support #117 (work on Mac) added needed mac header 2013-10-10 10:39:21 +01:00
topilski 5931cd8cca SSH support #117 (work on fedora) added needed linux header 2013-10-10 13:09:47 +04:00
topilski 55ae8f05f5 ssh support #117 first stable windows version (without ssh+ssl) 2013-10-10 10:49:24 +03:00
Dmitry Schetnikovich acef635b77 License mentioned in README.md 2013-10-10 01:25:59 +03:00
Dmitry Schetnikovich 1017822d0e License is mentioned in README.md 2013-10-10 01:24:42 +03:00
topilski 76ed180ce5 Stable ssh connection (intermediate commit) 2013-10-09 17:00:07 +03:00
topilski 51073a55d1 ssh support #117 (only windows, some problem with shell, intermediate commit) 2013-10-08 14:44:50 +03:00
topilski 1f1c6b7971 Added SSH tunnel dialog 2013-10-07 15:58:11 +03:00
topilski fc8e4b9df4 Added RDBClientConnection (Robomongo client connection) 2013-10-07 09:41:00 +03:00
topilski 7981cee5ae ScriptEngine global mutex 2013-10-04 16:15:48 +03:00
topilski 84f41ba312 Fix build 2013-10-04 12:03:43 +03:00
topilski 8c227ca509 Delete include directory 2013-10-04 11:24:21 +03:00
topilski cb5f2d9d51 Remove pcre not needed includes 2013-10-03 16:35:03 +03:00
topilski 231067ba14 Stable global variables 2013-10-03 16:02:20 +03:00
topilski 6b24d5c6b5 Support for mongod's with SSL #100 (work also with sslPEMKeyFile) 2013-10-03 14:41:39 +03:00
topilski 7ec623b224 Support for mongod's with SSL #100 (Work as mongo --ssl only) 2013-10-03 11:03:30 +03:00
topilski 4a0c30526b Merge remote-tracking branch 'upstream/master' 2013-10-02 09:47:05 +03:00
topilski a91c598c07 Merge branch 'master' of https://github.com/topilski/robomongo 2013-10-02 08:00:19 +03:00
topilski 69ec7474b7 Added ssh first step. 2013-10-02 07:59:24 +03:00
Dmitry Schetnikovich 608c036abd Merge pull request #343 from topilski/master
Stable 0.8.3 release
2013-10-01 07:55:00 -07:00
topilski 840f95f800 Fix context menu "view documents" 2013-10-01 14:17:42 +03:00
topilski 4af6e6614b Expand Recursively broken in 0.8.3 beta 2 #342 2013-10-01 14:03:30 +03:00
schetnikovich 9a6dd0d0cf Robomongo log file now located in temp directory 2013-10-01 13:16:36 +03:00
topilski ecd29ca7f0 Update version number 2013-10-01 10:46:16 +03:00
Dmitry Schetnikovich 896dc10d60 What's new in 0.8.3 updated 2013-09-30 21:49:52 +03:00
schetnikovich eec540133d Description for Copy to Database operation 2013-09-30 19:57:36 +03:00
schetnikovich de0e64e97e Padding in Copy Collection dialog 2013-09-30 18:41:04 +03:00
Dmitry Schetnikovich 51747ac72a Merge pull request #330 from topilski/master
Several issues fixed, code prepared to release
2013-09-30 08:16:53 -07:00
topilski 919e97b582 Stable build 2013-09-30 16:51:12 +03:00
topilski 51930d3ca2 Clone collection to different server bugs. 2013-09-30 14:28:26 +03:00
topilski f47454d88b Cannot connect to server 2.4 with authorization 2013-09-30 12:49:50 +03:00
topilski 1060034af1 Add 'Clone collection to different server' function #58 (remove not connected servers) 2013-09-27 17:54:04 +03:00
topilski 4590e22b24 Add 'Clone collection to different server' function #58(Update) 2013-09-27 17:38:27 +03:00
topilski 3fafaf78b8 Empty command is shown in log after opening new shell. 2013-09-27 16:35:50 +03:00
topilski e296dfdea8 Empty command is shown in log at selecting "Rebuild" 2013-09-27 15:36:00 +03:00
topilski c017f5a644 Update "Native" style 2013-09-27 15:24:10 +03:00
topilski 11e262142c DataBase doesn't created if its name is long enough. 2013-09-27 14:33:13 +03:00
topilski e63a563096 Copy JSON behave differently in Tree View than in Table View #325 2013-09-27 12:49:54 +03:00
topilski ff10a19317 In Table Mode multiple selection works only for first 3 colums #327 2013-09-27 12:30:30 +03:00
topilski fc9fb66e85 Log messages are always in one line #326 2013-09-27 09:35:59 +03:00
topilski 4b21461727 Tree View multiple selection inside one document #328 2013-09-27 09:25:18 +03:00
topilski 721f9c224a Cannot connect to remote server when you are not admin #324 2013-09-27 08:54:28 +03:00
topilski bd3be11170 Collection query building with invalid symbols broken #323 2013-09-27 08:47:05 +03:00
Dmitry Schetnikovich f21b3324cb Merge pull request #322 from topilski/master
Bugs fixes, stable build
2013-09-26 07:34:36 -07:00
topilski 4185b50f10 Revert js 2013-09-26 17:09:12 +03:00
topilski 60cf1d0c34 TTL Index troubles #313 2013-09-26 17:06:55 +03:00
topilski 4d70a31748 ProgressBarPopup placed on center. 2013-09-26 15:43:48 +03:00
topilski dd263864eb When inserting/deleting documents, all documents from collection loaded #318 2013-09-26 15:16:36 +03:00
topilski 28b34d2d57 After edit of document, list of documents doesn't updated #319 2013-09-26 14:23:09 +03:00
topilski 74f356347a TTL Index troubles #313 2013-09-26 11:39:02 +03:00
topilski bafeece05c Add "Copy JSON" menu item to context menu #298 2013-09-26 10:26:13 +03:00
topilski 7cf2ee2b3d Strange padding of collumns in Tree View and inability to select row #310 2013-09-26 09:51:39 +03:00
topilski cb34107b77 Log message tweaks #317 2013-09-26 09:17:34 +03:00
topilski 51b9d9ed04 Toggle result orientation doesn't work anymore #320 2013-09-26 08:38:26 +03:00
topilski b470d0a38e Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/robomongo/gui/widgets/LogWidget.cpp
and Right click on empty area in Tree View and Table View doesn't show "Insert Document" #321
2013-09-26 08:35:27 +03:00
schetnikovich 530abab888 Row numbers in Tree View starts from 1 (as in Table View) 2013-09-26 02:24:02 +03:00
schetnikovich e870fef87a Logs button in the status bar 2013-09-26 01:49:39 +03:00
topilski d153271bc4 Added "Clear All" action in LogWidget context menu 2013-09-25 20:51:25 +03:00
Dmitry Schetnikovich 80f1580ce9 Merge pull request #312 from topilski/master
Loading bar doesn't centered #309
2013-09-25 10:15:19 -07:00
topilski 4e8d58655c KeapAlive On 2013-09-25 19:56:16 +03:00
topilski 25979a94bc Stable code 2013-09-25 19:44:16 +03:00
topilski 4d3814d34d Fix linux build 2013-09-25 16:44:25 +03:00
topilski 572f3871c3 Update MongoWorker 2013-09-25 16:35:34 +03:00
topilski c84f753462 Delete not needed events, some refactoring 2013-09-25 15:52:40 +03:00
topilski 7bffc999fd Size of Tooltip for User can be increased. Now, user ID is cutted of in tooltip. 2013-09-25 12:58:15 +03:00
topilski 81834e330b Allow multiple deleting of documents by selecting two cells in Table View #311 2013-09-25 11:58:01 +03:00
topilski 6277329c5d Loading bar doesn't centered #309 2013-09-25 11:36:20 +03:00
topilski e06100accb Delete WorkAreaTabWidget 2013-09-25 09:55:22 +03:00
schetnikovich 1165bf2101 Menu items text changes, larger Document Editor with added maximize button. 2013-09-25 02:52:25 +03:00
schetnikovich a3e95519de 0.8.3 beta 2 2013-09-25 01:40:09 +03:00
schetnikovich cf8ee5b116 Padding between indicators corrected 2013-09-25 01:39:09 +03:00
schetnikovich b00351f633 WorkAreaWidget added in order to set correct padding of inner tab widget 2013-09-25 01:11:01 +03:00
schetnikovich 4d815852ee _id field existence check and minor UI tweaks 2013-09-25 00:52:37 +03:00
schetnikovich c7ea906836 QToolBar separators removed, because they were drawn automatically on Windows 2013-09-24 23:37:23 +03:00
schetnikovich 87a9506816 QToolBar style removed 2013-09-24 23:33:52 +03:00
Dmitry Schetnikovich dc2939d092 Merge pull request #308 from topilski/master
BSON Undefined type doesn't rendered to string correctly #306
2013-09-24 11:54:34 -07:00
topilski 6429b7bec1 Minor refactoring 2013-09-24 19:55:44 +03:00
topilski 66cf8220da Update ConnectionDialog 2013-09-24 16:52:18 +03:00
topilski 71af9f24c4 Add the document _id in the tree view #142 2013-09-24 15:25:30 +03:00
topilski e4ef7fff58 Refactoring ConnectionsDialog 2013-09-24 14:50:34 +03:00
topilski d705dc371f "X" symbol in "Diagnostic" window should be shown in RED for "Authorization failed" reason 2013-09-24 13:05:04 +03:00
topilski 77e4abf2b0 Fixed linux build 2013-09-24 12:30:02 +03:00
topilski c5d94c9aa4 Preferences dialog #80 (start implementation) 2013-09-24 12:04:04 +03:00
topilski a6bf499270 BSON Undefined type doesn't rendered to string correctly #306 2013-09-24 08:53:30 +03:00
schetnikovich 30998934fa UI tweaks and code formatting 2013-09-24 02:06:44 +03:00
Dmitry Schetnikovich 32d254a2fb Merge pull request #305 from topilski/master
Update Logger, fixed some little bugs
2013-09-23 09:24:34 -07:00
topilski 4feda47af1 Code cleanup 2013-09-23 16:49:42 +03:00
topilski 0156b7c436 Fixed text mistakes 2013-09-23 16:02:37 +03:00
topilski bf677f21b3 Update Logger, add color messages to LogWidget 2013-09-23 15:23:09 +03:00
topilski 9140648502 New collection doesn't appear after executing "Duplicate Connection" from context menu. #277 2013-09-23 13:49:27 +03:00
topilski 055d1cabf9 Small refactoring 2013-09-23 12:29:37 +03:00
topilski f3fbc2f530 Code cleanup ScriptWidget 2013-09-23 11:30:04 +03:00
topilski 4bf0810482 When Authorization fails to server - show corresponding message. 2013-09-23 10:38:13 +03:00
Dmitry Schetnikovich f24898ee4d Merge pull request #302 from topilski/master
Line breaks extends height of row in Tree View #300
2013-09-21 08:44:17 -07:00
topilski 35494d6c6e Empty server shown in "Copy collection" dialog after disconnection from one server. 2013-09-20 16:53:47 +03:00
topilski c6b6311e56 Add "Copy JSON" menu item to context menu #298 (inner copy) 2013-09-20 16:04:38 +03:00
topilski e70211a49e Line breaks extends height of row in Tree View #300 (little fix) 2013-09-20 15:25:05 +03:00
topilski ff9ea74a5f Fix tooltips for tablemodel 2013-09-20 15:16:20 +03:00
topilski 58bda8d93b Update shortcuts, refactoring QueryWidget 2013-09-20 13:52:15 +03:00
topilski d8b63bcc35 Delete WorkAreaWidget 2013-09-20 11:37:27 +03:00
topilski 0501a57cd4 Refactoring WorkAreaWidgets 2013-09-20 11:13:17 +03:00
topilski 4bbd7a0964 Show tooltips for items in Table View and Tree View #301 2013-09-20 09:05:19 +03:00
topilski 3858980412 Line breaks extends height of row in Tree View #300 2013-09-20 08:44:48 +03:00
schetnikovich 39a34c2a38 Code formating tweaks 2013-09-20 02:55:20 +03:00
Dmitry Schetnikovich 7b28c64d0c Merge pull request #299 from topilski/master
JSON list validation #246
2013-09-19 09:27:39 -07:00
topilski fdea92acc0 Minor code cleanup 2013-09-19 16:33:09 +03:00
topilski a62acd7550 Fix up setlocate 2013-09-19 05:00:43 -07:00
topilski d8f2917e71 JSON list validation #246 (new more stable fix) 2013-09-19 04:25:17 -07:00
topilski 3cb1b0d126 Update stylesheets 2013-09-19 03:16:13 -07:00
topilski 8ed94a087c Add styles support to application 2013-09-19 12:35:20 +03:00
topilski 7b90d2c459 Add "Copy JSON" menu item to context menu #298 2013-09-19 10:34:14 +03:00
topilski 229fca6c48 Removing multiple documents from UI #174 (added context menu if multiply selection) 2013-09-19 10:03:34 +03:00
topilski f7b0fd6af1 Add 'Clone collection to different server' function #58 (fix loading databases) 2013-09-19 09:25:27 +03:00
topilski 34b6fb9eef Make UI for Adding Users in 2.2 mongodb the same as was in 0.8.2 version. 2013-09-19 09:05:07 +03:00
topilski 52b12aaeda Support old mongouser style 2013-09-18 22:16:42 +03:00
Dmitry Schetnikovich 772fa339cb Merge pull request #294 from topilski/master
Clone collection to different server function #58
2013-09-18 12:12:28 -07:00
topilski 59797f5303 Support mongodb 2.4.x style users #139 2013-09-18 16:30:06 +03:00
topilski 8e4c5b8762 Add 'Clone collection to different server' function #58, minor fixes 2013-09-18 14:28:56 +03:00
topilski 5863235fa3 Speed up fill model process 2013-09-18 13:44:22 +03:00
topilski 0f4a466366 Disable copy collection its own database 2013-09-17 19:44:09 +03:00
topilski 30ad951357 Refactoring Output widget. 2013-09-17 16:35:52 +03:00
topilski 1ed73e3a38 unique name in CopyCollectionDialog 2013-09-16 19:22:19 +03:00
topilski 21ac3392c2 Fix F11 keypress 2013-09-16 16:39:58 +03:00
topilski 7d87cb0667 Fix Mac Os build 2013-09-16 14:15:05 +01:00
topilski 3f8211a829 Fix memory leaks 2013-09-16 16:08:26 +03:00
topilski 7fbdac8c11 Small refactoring 2013-09-16 15:48:01 +03:00
topilski a478268ce6 Add 'Clone collection to different server' function #58 2013-09-16 15:07:51 +03:00
topilski d6b3f17b15 Add 'Clone collection to different server' function #58(intermediate commit) 2013-09-16 13:18:48 +03:00
Alexandr 026a304678 Merge pull request #293 from topilski/master
Crash creating new Database (Mac OS X 10.8.4) #291
2013-09-16 00:35:25 -07:00
topilski 0b041b6570 Crash creating new Database (Mac OS X 10.8.4) #291 2013-09-16 10:33:11 +03:00
topilski 3eccfedd17 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/robomongo/core/utils/Logger.h
2013-09-16 09:47:48 +03:00
schetnikovich 1a91a569df Minor style cleanups in /core folder 2013-09-15 21:29:27 +03:00
topilski 88bb9ba1e4 Code cleanup 2013-09-15 21:25:20 +03:00
Dmitry Schetnikovich 652fff66b5 Merge pull request #292 from topilski/master
Enable query logging #108
2013-09-13 11:26:53 -07:00
topilski f6b8e33210 Some code cleanup 2013-09-13 16:47:48 +03:00
topilski fcdaa015f5 Fix logfile name 2013-09-13 16:14:36 +03:00
topilski 1618c67b48 Add View context menu 2013-09-13 15:35:55 +03:00
topilski e57c64b032 Enable query logging #108 2013-09-13 14:53:23 +03:00
Dmitry Schetnikovich 7b2e237bea Merge pull request #289 from topilski/master
Implement new fetures, fix bugs
2013-09-12 13:00:00 -07:00
topilski 2cdbac1d83 Some code cleanup 2013-09-12 16:45:31 +03:00
topilski 67609cb408 Traansform tablemodel to proxy model 2013-09-12 16:18:28 +03:00
topilski ce459447f2 Fix copy value on TableView 2013-09-12 13:33:10 +03:00
topilski dcd2635832 Removing multiple documents from UI #174 (Added delete and shift+del shortcuts in table/tree views) 2013-09-12 12:15:11 +03:00
topilski d0adb2f810 Hot key "F5" doesn't work 2013-09-12 11:33:16 +03:00
topilski 79782759b4 Support mongodb 2.4.x style users #139 2013-09-12 11:13:23 +03:00
topilski cdf5feaed0 Fixed linux build 2013-09-11 19:33:47 +03:00
topilski 5fe7f0470e Refactoring OutputItemContentWidget.h 2013-09-11 17:13:55 +03:00
topilski 2e4aa09168 0.8.1 left panel collections/functions/users navigation doesn't work when authenticating against the DB #282 2013-09-11 14:34:39 +03:00
topilski ce35821546 Removing multiple documents from UI #174 (Added delete and shift+delete shortcuts in table/tree views, intermediate commit) 2013-09-11 13:11:50 +03:00
topilski d0dcfad20c Inserting multiple documents from UI #173 2013-09-11 11:55:38 +03:00
topilski b3f7c4dd37 Support mongodb 2.4.x style users #139 2013-09-11 10:59:42 +03:00
topilski 5d3b712b59 Support mongodb 2.4.x style users #139 (intermediate commit) 2013-09-11 10:25:55 +03:00
Dmitry Schetnikovich 99dc33fcd4 Merge pull request #285 from topilski/master
BsonTreeWidget transform to BstonTreeView
2013-09-10 11:03:42 -07:00
topilski 17ee0a031e A way to disable Alt + number shortcut #192 2013-09-10 15:42:32 +03:00
topilski 08bcc59fe7 Retain current view mode when running search #93 2013-09-10 15:17:30 +03:00
topilski 1df05dfa02 OutputWidget refactoring 2013-09-10 14:41:24 +03:00
topilski 0e968058db Added Notifier 2013-09-10 10:19:59 +03:00
topilski 7869ec0b32 Code update 2013-09-10 10:13:37 +03:00
topilski 4bbdec3478 Update context menu in views 2013-09-10 09:00:59 +03:00
topilski 96b54a4ebf Finished merging BsonTreeView and BsonTableView 2013-09-09 17:27:20 +03:00
topilski 54d50ef33f Inheritance BsonTableModel from BsonTreeModel 2013-09-09 15:56:34 +03:00
topilski 08decea6fb Merge remote-tracking branch 'upstream/master' 2013-09-09 14:09:06 +03:00
topilski 8c397f93f7 BsonTreeWidget transform to BstonTreeView intermediate commit 2013-09-09 14:01:51 +03:00
Dmitry Schetnikovich 62c1c3de16 What's new updated 2013-09-07 22:42:17 +03:00
Dmitry Schetnikovich ce66b63371 What's new for 0.8.1 updated 2013-09-06 16:40:35 +03:00
Dmitry Schetnikovich 7be356a06f Merge pull request #281 from topilski/master
Release 0.8.1
2013-09-06 06:23:51 -07:00
topilski d4d6243025 Add background to tableview 2013-09-06 16:16:32 +03:00
topilski 01d5a0c382 Showgrid = true 2013-09-06 09:41:19 +03:00
topilski 1222ad7519 Remove beta postfix 2013-09-06 08:28:22 +03:00
schetnikovich 8b69556f50 Default value for batchSize 2013-09-06 03:30:01 +03:00
schetnikovich 5c7f5733f0 Fixed height for header removed, because this doesn't work correctly on Mac 2013-09-06 03:11:28 +03:00
schetnikovich 0bbd3add0a Paging tweaks 2013-09-06 02:45:26 +03:00
schetnikovich 15e47170d5 .mongorc.js and .robomongorc.js fixes 2013-09-05 23:24:09 +03:00
schetnikovich d2977badca Several minor tweaks for TableMode 2013-09-05 21:59:49 +03:00
schetnikovich 9dacc82be5 Paging Left problem fixed 2013-09-05 18:30:32 +03:00
Dmitry Schetnikovich 98f2c6254b Merge pull request #279 from topilski/master
Copy value in Table Mode fixed
2013-09-05 07:02:43 -07:00
topilski d1a435c55c Fix copy value 2013-09-05 16:49:27 +03:00
Dmitry Schetnikovich cdba4bae7c Merge pull request #278 from topilski/master
Release candidate 0.8.1 beta 2
2013-09-05 06:21:36 -07:00
topilski dc894a3b95 Fixed little bugs, design issues 2013-09-05 16:04:35 +03:00
topilski f76012b967 Fix dependencies for deb package 2013-09-05 07:38:44 -04:00
topilski aceb46ed35 Fix package dependencies rpm 2013-09-05 08:57:24 +03:00
Dmitry Schetnikovich 878782296d Fixed heights of headers removed - it may vary between platforms 2013-09-05 00:51:55 +03:00
schetnikovich 2d7de46020 TableView visual tweaks 2013-09-05 00:12:02 +03:00
Dmitry Schetnikovich f62f718f18 Merge pull request #275 from topilski/master
Release Candidate
2013-09-04 07:55:27 -07:00
topilski 30a7b3c2b1 Stable build 2013-09-04 11:19:51 +03:00
topilski 7ce7383597 Entering incorrect symbols as database name isn't handled properly. #262(New fix) 2013-09-04 11:18:59 +03:00
topilski d2399668cb Same height of the rows in Tree Mode and Table mode would be very nice. #267 2013-09-04 10:36:11 +03:00
topilski fdc1ad7afd Some improvement code 2013-09-04 10:24:02 +03:00
topilski d29576bd5a Fix linux build 2013-09-04 10:03:06 +03:00
topilski 6805fc931f Fix build script 2013-09-04 09:49:27 +03:00
topilski f7fcaf68f3 Display context menu in Table Mode as in Tree Mode #266 2013-09-04 09:43:45 +03:00
topilski cac53576b7 Added bsonElemnt to bsontableitem 2013-09-03 21:19:15 +03:00
topilski 74881feb4e Fix rpm dependencies 2013-09-03 17:08:19 +03:00
topilski 4f6ab6ebbd Fix linux dependencies 2013-09-03 16:13:54 +03:00
topilski 3ce325f0f4 Display context menu in Table Mode as in Tree Mode #266 intermediate commit 2013-09-03 15:10:44 +03:00
topilski 3780e677d4 Border colors in Table Mode should be the same as in Tree Mode. #268 2013-09-03 13:55:36 +03:00
topilski b675764379 Align text in table's header to the left (when in Table Mode) #270 2013-09-03 13:52:08 +03:00
topilski 231957815d Tweaks of View Modes Switcher #271 2013-09-03 13:46:03 +03:00
topilski d3eb20c72e Fix dependencies 2013-09-03 11:35:37 +03:00
Dmitry Schetnikovich a50598b454 Merge pull request #265 from topilski/master
Entering incorrect symbols as database name isn't handled properly. #262
2013-09-02 14:13:23 -07:00
topilski 13b262c261 Desktop icon isn't created despite corresponding checkbox was checked at installation. #260 2013-09-02 20:31:28 +03:00
topilski 3c9374582a Entering incorrect symbols as database name isn't handled properly. #262 2013-09-02 15:13:57 +03:00
Alexandr c00ae01d89 Merge pull request #264 from topilski/master
Fix Linux build
2013-09-02 00:31:00 -07:00
topilski e67f5199f4 Fix Linux build 2013-09-02 10:30:11 +03:00
Dmitry Schetnikovich 874b4d2582 Merge pull request #263 from topilski/master
First implementation of TableView
2013-09-01 11:36:48 -07:00
topilski dda7328b2a Update MongoElement sources 2013-09-01 18:48:27 +03:00
topilski 7d56289235 Update icons for TableView, some improvement code 2013-09-01 11:17:18 +03:00
topilski ea906fb864 Added support Array and Documents in TableView 2013-08-31 16:51:10 +03:00
topilski 8a6be15bea First implementation simple BsonTableWidget 2013-08-31 15:11:11 +03:00
topilski bc63331fdf Merge branch 'master' of https://github.com/topilski/robomongo 2013-08-30 20:52:18 +03:00
topilski 57c66e6958 Table implementation intermediate commit 2013-08-30 19:15:51 +03:00
topilski f98ec5a52e TableView intermediate commit 2013-08-30 11:56:43 +03:00
topilski 936d46e211 TableView start implementation 2013-08-30 10:44:01 +03:00
topilski b376076e15 Fixed build according Dmitry Schetnikovich recommendations 2013-08-30 09:27:05 +03:00
schetnikovich 01c960be2b Several std::string-related fixes and Settings Manager cleanup. 2013-08-30 00:39:15 +03:00
Dmitry Schetnikovich 5c80996fe3 Merge pull request #257 from topilski/master
Several bugs fixed
2013-08-29 11:59:50 -07:00
topilski 077e43fbf2 Added Load .robomongo.js to initscript, fixed return keypress in paging widget, fix limits 2013-08-29 18:36:00 +03:00
topilski 00e2783cc5 Added VERIFY macro 2013-08-29 14:47:07 +03:00
topilski d0f12a0450 Fix up line numbers in QsciScintilla widget. 2013-08-29 11:18:28 +03:00
topilski c379862ce4 the limit() method not auto completed #245 2013-08-29 10:29:36 +03:00
topilski 492e7560c3 JSON list validation #246 2013-08-28 17:41:16 +03:00
topilski 375b6bb9cc Error installing on CentOS 6 #252 2013-08-28 10:08:39 +03:00
topilski ce167ca71b Error installing on CentOS 6 #252 intermediate commit 2013-08-27 20:25:19 +04:00
topilski b700324d92 Fix dependencies for project 2013-08-27 17:01:11 +03:00
topilski 80fcb46079 Some refactoring 2013-08-27 15:10:06 +03:00
Alexandr 784e847b16 Merge pull request #251 from topilski/master
Fix unicode problem
2013-08-26 22:48:25 -07:00
topilski 9a444f8aeb Fix unicode problem 2013-08-27 08:47:38 +03:00
Dmitry Schetnikovich 779366ed3a Readme updated 2013-08-26 23:00:59 +03:00
Dmitry Schetnikovich 47bcd54b1e Merge pull request #250 from topilski/master
Replace QString to std::string where possible
2013-08-26 12:59:09 -07:00
topilski cabd7c77f9 Remove Concatenator class 2013-08-26 18:04:23 +03:00
topilski 65fc52fb8c Some improvement code (QString to std::string) 2013-08-26 17:31:12 +03:00
topilski 9df2181ee6 Replace QString to std::string completed 2013-08-26 15:45:51 +03:00
topilski c594b3ad79 Merge remote-tracking branch 'upstream/master' 2013-08-26 15:23:58 +03:00
topilski 2b3a03bac7 QString replace to std string where possible, next step, intermediate commit 2013-08-26 14:42:09 +03:00
topilski 4a2c6274b6 Fixup linux build 2013-08-26 12:50:47 +03:00
topilski 85a88d3f82 QString replace to std string where possible, intermediate commit 2013-08-26 12:24:22 +03:00
topilski 20012daa93 Merge remote-tracking branch 'upstream/master' 2013-08-24 14:35:38 +03:00
topilski b3e4728e90 Merge branch 'master' of https://github.com/topilski/robomongo 2013-08-24 14:33:26 +03:00
topilski fc109feab6 Replace QList container to std::vector 2013-08-24 14:32:19 +03:00
Dmitry Schetnikovich 4dacb2b4ad What's new file updated 2013-08-23 21:21:36 +03:00
Dmitry Schetnikovich b6d82d6b3a What's new file updated 2013-08-23 20:42:56 +03:00
Dmitry Schetnikovich 0f59516569 Merge pull request #241 from topilski/master
Stable package building
2013-08-23 10:40:32 -07:00
topilski d8e4a69692 Fixed Windows packages build script 2013-08-23 18:46:23 +03:00
topilski 625513c948 Fix description 2013-08-23 18:01:48 +03:00
topilski f2ad2e55fd Theme for Linux #239 2013-08-23 17:41:33 +03:00
topilski 3f7c8bfe0c Add README file to the Linux packages #240 2013-08-23 16:47:24 +03:00
topilski 4f2294e0e9 Merge remote-tracking branch 'upstream/master' 2013-08-23 16:19:19 +03:00
schetnikovich d68d432690 Minor changes in package description 2013-08-23 11:13:00 -02:00
schetnikovich def0a8a4a2 README for Linux and minor changes in json.cpp 2013-08-23 11:06:40 -02:00
topilski 107f6a0a30 Stable package build script for windows 2013-08-23 09:49:26 +03:00
Dmitry Schetnikovich 8861a65d0f Merge pull request #237 from topilski/master
Added check of BUILD variable in CMakeLists.txt
2013-08-22 10:22:02 -07:00
topilski 73dcbfe3cc Added check of BUILD variable in CMakeLists.txt 2013-08-22 18:43:57 +03:00
Dmitry Schetnikovich 61ef69860d Merge pull request #236 from topilski/master
Packages build scripts
2013-08-22 08:23:26 -07:00
topilski 0ce4bcdf00 Fix tar.gz package generation 2013-08-22 17:40:42 +03:00
topilski 953104cbd6 Fix Visual studio 11 find behavior, update package build script for mac 2013-08-22 17:04:24 +03:00
topilski 39bc003182 Fix package bash script 2013-08-22 15:30:49 +03:00
topilski 6088080a44 Added some cache variables to main CMakeLists.txt 2013-08-22 12:34:51 +03:00
topilski 2558203b3a Fix deb package generation 2013-08-22 11:54:49 +03:00
topilski 96171d6dbc Fix package build scripts on Linux 2013-08-22 10:20:13 +03:00
topilski a93807ec68 Added package generator scripts 2013-08-22 08:46:35 +03:00
topilski 8bda162f9f Merge remote-tracking branch 'upstream/master' 2013-08-22 08:21:00 +03:00
Dmitry Schetnikovich 13d3033699 Changelog updated 2013-08-21 18:48:35 +03:00
topilski 6a42f6c429 Fix project description and summary, actual for packages only 2013-08-21 18:48:24 +03:00
Dmitry Schetnikovich 42a1e89b23 Changelog updates 2013-08-21 18:06:00 +03:00
topilski cbae3a1bd3 Merge remote-tracking branch 'upstream/master' 2013-08-21 18:01:31 +03:00
schetnikovich 86ea046fc3 DBRef correct parsing (#113)
Robomongo understand three fields in  DBRef sub-objects:

{
  "$ref" : "my_collection",
  "$id" : "my_id",
  "$db" : "my_db"
}

$id and $db fields can be of any type (int, string, date etc.).
2013-08-21 12:35:14 -02:00
topilski c58cbf2828 Add dependencies to test target 2013-08-21 16:57:52 +03:00
schetnikovich 5e90cf2615 Version updated (now beta 2) 2013-08-21 11:32:08 -02:00
topilski bd436b0e85 Fix up CMAKE_BUILD_TYPE variable 2013-08-21 15:17:52 +03:00
topilski c614a64769 Delete not needed headers, small refactoring 2013-08-21 13:54:00 +03:00
topilski 52cba4c70e Cmake refactoring MSVC 2013-08-21 11:54:40 +03:00
Dmitry Schetnikovich 11d221a927 Merge pull request #234 from topilski/master
Stable build
2013-08-20 09:24:36 -07:00
topilski b74525e674 Fix Mac OS build 2013-08-20 15:16:23 +01:00
topilski 914c2621c9 Fixed cmake linker flags 2013-08-20 15:31:22 +03:00
topilski dec1ccab7e Added cmake linker flags 2013-08-20 15:00:28 +03:00
topilski fbf2b7cb2e Fix gif image displaying, added CHANGELOG and COPYRIGHT files to install target 2013-08-20 11:05:35 +03:00
Dmitry Schetnikovich 9883b9509b Fix for incorrect handling of Dates mentioned in changelog 2013-08-19 14:38:16 -07:00
Dmitry Schetnikovich b9f66c91fc Changelog updated 2013-08-19 23:55:04 +03:00
schetnikovich 28b840d165 COPYRIGHT file added. build-requirements.txt removed 2013-08-19 23:00:15 +03:00
Dmitry Schetnikovich fa982de537 Merge pull request #232 from topilski/master
Icon in windows installer should be corrected #182
2013-08-19 10:50:29 -07:00
topilski 336995c914 Fix displaying Date in BsonTreeWidget 2013-08-19 16:42:42 +03:00
topilski e01aee0b20 Added validation user input in the PagingWidget class 2013-08-19 11:42:44 +03:00
topilski 4489b34975 Improve EventBus code 2013-08-19 10:55:06 +03:00
topilski 4e4f186814 Icon in windows installer should be corrected #182 2013-08-19 08:48:58 +03:00
topilski 0894ee1bac Common refactoring. 2013-08-19 06:52:11 +03:00
topilski 3514297954 Refactoring, delete not needed includes, fix code style 2013-08-18 19:15:27 +03:00
topilski 45aeade92d Delete old not needed files, added QtUtils 2013-08-18 12:38:09 +03:00
schetnikovich a018f1ddb5 Merge branch 'master' of https://github.com/paralect/robomongo 2013-08-17 23:25:59 +03:00
schetnikovich d164ec578a Fixed incorrect text for OK button in ConnectionDialog 2013-08-17 23:25:41 +03:00
Dmitry Schetnikovich 2c5158bb45 NSIS top logo images 2013-08-17 23:19:11 +03:00
schetnikovich f229735320 Unified placement order of Ok and Cancel buttons in dialogs 2013-08-17 23:04:44 +03:00
schetnikovich d9be00174e Date conversion tests cleanup 2013-08-17 21:15:34 +03:00
schetnikovich 82ee82158c Integer overflow protection in brute-force test 2013-08-16 22:42:04 +03:00
Dmitry Schetnikovich 98a0456ea7 Merge pull request #231 from topilski/master
Update min and max anchors in datesystem
2013-08-16 10:25:18 -07:00
topilski 05a979e160 Update min and max anchors in datesystem 2013-08-16 18:54:30 +03:00
topilski 5fe3a8e88b Merge remote-tracking branch 'upstream/master' 2013-08-16 18:47:21 +03:00
schetnikovich e60288770d 'Display Dates in' is now before 'Legacy UUID encoding' menu item. View mode items moved to their own group 'Default View Mode' 2013-08-16 18:29:02 +03:00
topilski 5519b473c2 Merge remote-tracking branch 'upstream/master' 2013-08-16 17:47:10 +03:00
schetnikovich 6848e82d48 Long long for dates 2013-08-16 17:41:12 +03:00
topilski 9d7d0bc3a8 Fix test 2013-08-16 17:32:49 +03:00
topilski d483f5bd07 Merge remote-tracking branch 'upstream/master' 2013-08-16 17:29:50 +03:00
schetnikovich ec046fc737 Minor test changes 2013-08-16 17:27:39 +03:00
topilski f751d02dee Some improvement of code 2013-08-16 11:34:27 -02:30
Dmitry Schetnikovich 386f1f3ea2 Merge pull request #230 from topilski/master
Correct MongoDB Date rendering and parsing. #224
2013-08-16 06:25:52 -07:00
topilski dc2ef38d51 Correct MongoDB Date rendering and parsing. #224 2013-08-16 14:25:42 +03:00
topilski ae494c5236 Fix Mac Os build 2013-08-16 11:48:08 +03:00
topilski 0cede0e9cc Fix data parsing 2013-08-16 11:33:20 +03:00
topilski 92761f68c4 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/robomongo/core/settings/SettingsManager.cpp
	tests/test_parser.cpp
2013-08-16 09:11:41 +03:00
schetnikovich 27e6da71d7 Brute-force test for dates parsing and rendering. Some minor tweaks of tests 2013-08-16 02:04:00 +03:00
schetnikovich a944e41b83 Merge 2013-08-15 22:08:19 +03:00
schetnikovich bf18b905b8 Default View Mode is a Custom View Mode 2013-08-15 21:04:44 +03:00
schetnikovich c58a342a07 Long tooltip now cut to 700 symbols. Monospace font is used for tooltips 2013-08-15 20:43:39 +03:00
topilski 01536ff673 Fix bsonTreeView 2013-08-15 19:22:43 +03:00
topilski 651034ba07 Fix timeZones 2013-08-15 19:15:18 +03:00
schetnikovich 255191e799 Document context menu items now have 'Document' suffix for all operations on full Document 2013-08-15 16:41:02 +03:00
schetnikovich 47a71227e5 Expand Recursively context menu position changed 2013-08-15 16:37:10 +03:00
schetnikovich 81a1c5f896 Indexes context menu cleanup 2013-08-15 16:30:36 +03:00
schetnikovich 1032aec7cd Edit Index goes before Delete Index 2013-08-15 16:23:35 +03:00
schetnikovich e34a7b92ce Tooltips for Open/Save buttons 2013-08-15 16:04:58 +03:00
topilski 3cdf020bde Refactoring BsonTreeItem 2013-08-15 14:45:29 +03:00
topilski bb3e15c68a Correct MongoDB Date rendering and parsing. #224 (Added some tests) 2013-08-15 12:26:39 +03:00
topilski 8ec1b3b6c1 Merge remote-tracking branch 'upstream/master' 2013-08-15 08:27:28 +03:00
schetnikovich b2d6429a50 Text width calculation using Scintilla methods 2013-08-15 01:06:55 +03:00
schetnikovich 274f1c6445 Line number margin tweaks.
1) Background and foreground color set.
  2) Automatic margin width calculation, based on number of digits.
  3) ScriptWidget autocompletion popup now respects Line Number margin.
2013-08-15 00:35:04 +03:00
schetnikovich ea4ba0e98d ToolBar icon size fixed (#169) 2013-08-14 22:41:07 +03:00
schetnikovich 1edf65bb5d Index icon 2013-08-14 22:13:06 +03:00
Dmitry Schetnikovich 092df6bec9 Merge branch 'master' of https://github.com/paralect/robomongo 2013-08-14 22:04:38 +03:00
Dmitry Schetnikovich a4ed823b76 Index icon 2013-08-14 22:04:13 +03:00
topilski 3f320362cf Correct MongoDB Date rendering and parsing. (intermediate commit) 2013-08-14 19:36:31 +03:00
topilski 39dea95a48 Refactoring CollectionStatsTreeItem 2013-08-14 15:14:21 +03:00
topilski d8b532ac33 Small refactoring 2013-08-14 14:24:04 +03:00
topilski e55803680a Correct MongoDB Date rendering and parsing. #224 (intermediate commit) 2013-08-14 11:13:11 +03:00
Dmitry Schetnikovich cbbb5321a5 Merge pull request #223 from topilski/master
Floats keep rounding off to 4 or 5 decimal places in the view when converted from string to float
2013-08-13 14:47:22 -07:00
topilski ed694f2e32 Floats keep rounding off to 4 or 5 decimal places in the view when converted from string to float #115 2013-08-13 20:35:08 +03:00
topilski beabf7dbc9 Deleted not needed functions 2013-08-13 19:24:05 +03:00
Dmitry Schetnikovich c2e0e7379f Merge pull request #222 from topilski/master
Added unit test support, based on GTest library
2013-08-13 09:13:57 -07:00
topilski edb3285c3a Fix unit tests build on linux platform 2013-08-13 15:00:07 +03:00
topilski c166f4ad7a Added first test case, using gtest solution 2013-08-13 14:16:10 +03:00
Dmitry Schetnikovich 2553c92218 Merge pull request #221 from topilski/master
Checked all package instalation on clean machines
2013-08-12 12:32:43 -07:00
topilski 1f610a4bfe Fix license for rpm package 2013-08-12 19:25:42 +03:00
topilski 0b7ff09491 Hide component window in NSIS package 2013-08-12 19:03:18 +03:00
topilski 6d093699fc Fix Mac os dmg generation. 2013-08-12 15:53:41 +01:00
topilski 9eb94ac0ea Updated nsis package creation. 2013-08-12 12:08:59 +03:00
topilski bfdeb452a7 Fix linux build 2013-08-12 10:59:57 +03:00
topilski a8d412501d Update js cmakefile according SConscript 2013-08-12 09:33:58 +03:00
topilski af46b1191c Fix deb package generation, after cpack execution simple exec fixup_deb.sh 2013-08-11 17:21:35 +03:00
Dmitry Schetnikovich 596ab5d131 Merge pull request #219 from topilski/master
Stable version, little bugs fixed
2013-08-09 08:57:26 -07:00
topilski cc42ea251a Sparse checkbox incorrect behavior. #215 2013-08-09 18:15:44 +03:00
topilski ed7f9c873c Memory not released, when closing shell tab. #213 2013-08-09 17:48:28 +03:00
topilski e3a1a0dc14 Fixed Mac Os build problem 2013-08-09 15:08:01 +01:00
topilski cc9f36a939 "Expire after" in Index Editor is an optional field. #218 2013-08-09 11:39:04 +03:00
topilski 97d4a98c17 Text Weight should be BSONObj, not just string. #216 2013-08-09 10:25:57 +03:00
topilski 9618f6a724 0 (zero) is a valid value for "Expire after" field in Index Editor. #217 2013-08-09 10:05:08 +03:00
topilski e7b2b497f1 When saving scripts, file name extension should be ".js" if not specified otherwise. #185 2013-08-09 09:50:10 +03:00
topilski 898b9c0270 Merge branch 'master' of https://github.com/topilski/robomongo 2013-08-09 08:35:37 +03:00
topilski 898bde0617 If file save was unsuccessful, Robomongo doesn't show any message. #212 2013-08-09 08:17:04 +03:00
schetnikovich f5c5172044 Minor tweaks of help label text on EditIndex dialog 2013-08-09 00:24:32 +03:00
Dmitry Schetnikovich 11d677fc39 Merge pull request #214 from topilski/master
Bug fixes
2013-08-08 10:26:49 -07:00
topilski 34da1dd6c0 After successful build on Mac OS X, cannot run Robomongo #211 2013-08-08 16:29:27 +01:00
topilski eb2e71e5a7 Some fixes in creating deb package.Some fixes in generation deb package. 2013-08-08 14:52:47 +03:00
topilski 0c2ce8c617 If file save was unsuccessful, Robomongo doesn't show any message. #212 2013-08-08 09:40:29 +03:00
topilski e7ee3f9641 Index "key" field renders incorrectly #210 2013-08-08 09:31:09 +03:00
Dmitry Schetnikovich cb96fe63ab Merge pull request #209 from topilski/master
Added support to monitor document change according behaviors of text edi...
2013-08-07 09:09:48 -07:00
topilski 7afebbb5e4 Added support to monitor document change according behaviors of text editors . 2013-08-07 19:07:06 +03:00
Alexandr d630b8b919 Merge pull request #208 from topilski/master
Fix bugs new step
2013-08-07 06:59:07 -07:00
topilski 29fc346131 Search Problem #196 2013-08-07 16:51:53 +03:00
Dmitry Schetnikovich f87dd74956 Merge pull request #201 from topilski/master
Fixed little bugs, stable build
2013-08-06 11:15:55 -07:00
topilski d7decff092 Add support crosscompile for Mac Os system, needed only specify CMAKE_OSX_SYSROOT (Mac OS sdk path) 2013-08-06 17:02:43 +01:00
topilski c338009200 On all platforms application name is Robomongo (first letter is uppercase) #186 2013-08-02 22:12:53 +03:00
topilski bc2bc66f85 Search Problem #196, improving code 2013-08-07 10:12:58 +03:00
topilski d6d5589fb0 Indicator of empty results in ExplorerWidget. #195 2013-08-07 08:32:55 +03:00
topilski 9f1b71e600 Horizontal ScrollBar Policy for FindFrame #189 2013-08-07 08:18:22 +03:00
topilski c88d65486c Remove tab symbols from all source files. #197 2013-08-02 18:42:35 +03:00
topilski 879402dcf9 Merge branch 'master' of https://github.com/topilski/robomongo 2013-08-06 11:43:03 +03:00
topilski 3fab28028d Remove tab symbols from all source files. #197 2013-08-06 11:42:12 +03:00
topilski f1f517541f Cannot connect to MongoDB on Windows #183 2013-08-06 09:50:35 +03:00
topilski af9e47edcf Fix Mac os buttons images problem 2013-08-05 15:56:28 +01:00
topilski 0f47c4e225 Fix Mac Os build 2013-08-05 14:56:10 +01:00
topilski a3e01b5d7e Some shortcuts are not working now #193 2013-08-02 16:45:05 +03:00
topilski 9348872711 Profile Robomongo with valgrind #194 2013-08-02 16:11:12 +03:00
topilski 38320c9cc2 Profile Robomongo with valgrind #194 (intermediate commit) 2013-08-05 10:37:30 +03:00
topilski 939b76b141 Refactoring MongoDocument and MongoCollection, 2013-08-04 19:05:19 +03:00
topilski cf8025c88a Fix build 2013-08-04 10:42:39 +03:00
topilski c9e6dfead2 Refactoring settings 2013-08-04 10:19:21 +03:00
topilski aea3c730be Small refactoring SettingsManager 2013-08-03 13:49:19 +03:00
topilski 33b435eff4 ScriptWidget blinking, when adding/removing lines. #184 2013-08-02 20:20:09 +04:00
topilski 952b065ae2 Fix font height for qsciScintilla 2013-08-02 18:18:21 +03:00
topilski e3ad46cfb5 Search Problem #196 2013-08-02 15:18:06 +03:00
topilski 6130d1daca Drop Duplicates should depend on Unique checkbox #190 2013-08-02 14:12:05 +03:00
topilski 6dfa7ebf61 ScriptWidget blinking, when adding/removing lines. #184 2013-08-02 12:07:51 +03:00
topilski 2478b94822 Horizontal ScrollBar Policy for FindFrame #189 2013-08-02 12:51:47 +03:00
topilski 31188b4591 Horizontal ScrollBar Policy for FindFrame #189 2013-08-02 12:40:49 +03:00
topilski b2dc22e57b Merge branch 'master' of https://github.com/topilski/robomongo 2013-08-02 11:52:43 +03:00
topilski 9646700b3f "make install" problem on Linux #200 2013-08-02 11:45:54 +03:00
Dmitry Schetnikovich 8d07dcb8ec Merge pull request #199 from topilski/master
Fixed packages and tested on clean machines (Windows and Linux only)
2013-08-01 12:07:00 -07:00
topilski aebc3f20cc Fix rc files 2013-08-01 19:49:25 +03:00
topilski 6aa8d522b2 On all platforms application name is Robomongo (first letter is uppercase) #186 2013-08-01 19:14:57 +03:00
topilski 2342e46a7d In Index Editor we missed Server indicator. #191 2013-08-01 19:08:05 +03:00
topilski e65e81365a Indicator of empty results in ExplorerWidget. #195 2013-08-01 18:58:49 +03:00
topilski 66583f6d64 Fix Mac Os package on clean machine 2013-08-01 16:06:45 +01:00
topilski 45c515bb9c ESC should close any opened dialog #188 2013-08-01 14:35:03 +03:00
topilski 8d851a28d8 Horizontal ScrollBar Policy for FindFrame #189 2013-08-01 14:09:51 +03:00
topilski db76d14075 FileDialog filter #187, When saving scripts, file name extension should be ".js" if not specified otherwise. #185 2013-08-01 13:53:27 +03:00
topilski 0e6ad5e56a Fix Linux build 2013-07-31 16:31:53 +03:00
topilski 2c966cc567 Refactoring integrate-qt.cmake 2013-08-01 12:20:49 +03:00
topilski e24476beae Check linux build, fix cmake 2013-07-31 16:06:30 +03:00
topilski 1ac3e14486 Update CmakeFile for windows 2013-08-01 08:40:00 +03:00
topilski f9dd5b5977 Some refactoring CMakeFile 2013-07-31 21:59:09 +03:00
topilski 5815dba0ad Fix linking error on release Mac Os, add lib cocoa to install target 2013-07-31 17:11:25 +01:00
topilski 0f141201f8 Add Qtbus to install target, fix linux package, tested on clean machine 2013-07-31 14:44:11 +03:00
topilski 6da2117087 Add qt.conf for plugins 2013-07-31 12:09:36 +03:00
topilski 67480b3280 Merge remote-tracking branch 'upstream/master' 2013-07-31 10:08:13 +03:00
topilski 39f7ffb779 Add needed libs to install target(Windows) 2013-07-31 09:45:55 +03:00
Dmitry Schetnikovich 3ebd168026 Merge pull request #179 from topilski/master
Packages for all systems created.
2013-07-30 12:03:00 -07:00
topilski dfb7f5ad3a Changed desktop entry according standarts 2013-07-30 16:58:02 +01:00
topilski 9e6cc9194c Use CPACK_GENERATOR=DragNDrop on Mac Os 2013-07-30 16:29:26 +01:00
topilski 60ff0f14d7 Delete not needed libraries on Windows platform 2013-07-30 14:58:54 +03:00
topilski b04c72af9b Linux package #177, delete not needed files 2013-07-30 12:25:22 +03:00
topilski 2b3666bb05 Fix Deb package 2013-07-30 09:21:59 +03:00
topilski 5c3bc4b742 Delete RPM spec template, add post install and postuninstall scripts 2013-07-30 04:20:55 -04:00
topilski 10bf3f8cc8 Linux package #177(Deb) 2013-07-30 08:45:47 +03:00
topilski 6deaefab61 Add postbuild step to deb package 2013-07-29 19:48:36 +03:00
topilski 6972718028 Fix windows build 2013-07-29 16:52:34 +03:00
topilski 324077ee6d Fix desktop entry template 2013-07-29 14:49:57 +03:00
Dmitry Schetnikovich 1c30744db7 Merge pull request #178 from topilski/master
Fixed linking errors, added LICENSE and robomongo.sh to install target.
2013-07-26 10:54:09 -07:00
topilski cd7dcda66b Added desktop template for linux 2013-07-26 19:49:42 +03:00
topilski 0d2c77aa81 Fix linking errors, add LICENSE and robomongo.sh to install target 2013-07-26 17:35:17 +03:00
topilski 2d8a22a65c Add search capability in text mode view results #32 2013-07-26 14:57:28 +03:00
Dmitry Schetnikovich d8bfbcb491 Merge pull request #176 from topilski/master
Fix Mac OS build, added more info to bundle
2013-07-25 11:30:57 -07:00
topilski acc5ae6c36 Fix Mac Os build, added more info to bundle 2013-07-25 15:08:14 +01:00
Dmitry Schetnikovich 0b7367d23c Merge pull request #168 from topilski/master
Check new build system of Robomongo on Mac OS X #153
2013-07-24 10:36:38 -07:00
topilski 1b7286567a Check new build system of Robomongo on Mac OS X #153 2013-07-24 17:32:53 +01:00
topilski e1cb6fba79 Added needed files 2013-07-24 16:58:35 +01:00
topilski eb8c23d5c5 Fix Mac Os bundle 2013-07-24 16:46:45 +01:00
Dmitry Schetnikovich ed1878be67 Merge pull request #167 from topilski/master
Windows build fixed
2013-07-24 07:14:23 -07:00
topilski 836fac7dcd Fix windows build 2013-07-24 17:12:36 +03:00
Dmitry Schetnikovich ab28727373 Merge pull request #162 from topilski/master
Create package target for windows, fix make install on linux
2013-07-24 06:32:02 -07:00
topilski 1adf581272 Make searches looped #170, Search: show the number of results found #171 (only warning message) 2013-07-23 23:26:22 +03:00
topilski 2645eb8f17 Fix deb package 2013-07-28 12:11:20 -04:00
topilski 47baeaa1b7 Delete symlinks, rename libraies on install step 2013-07-28 16:29:38 +03:00
topilski b2d8b596fd Fix ln links 2013-07-28 11:09:10 +03:00
topilski 178671fcb1 Fix linux build 2013-07-27 22:37:18 +03:00
topilski 123dc40b44 CMakeFiles refactoring 2013-07-27 16:52:17 +03:00
topilski 5b7b364b5e Add symlinks and needed libs to install target 2013-07-27 14:55:06 +03:00
topilski da4dc09b28 Merge branch 'master' of https://github.com/topilski/robomongo 2013-07-23 22:08:08 +03:00
topilski 0c3b352a2d Update rpm spec file, fix debain package process 2013-07-23 22:07:15 +03:00
topilski 68021d97d0 Fix linux CmakeFile 2013-07-23 17:44:55 +03:00
topilski 7d798feeac Update CmakeFile for Mac 2013-07-25 15:15:39 +03:00
topilski f7b05a55a4 Generate win.rc file, add template rc for other platforms 2013-07-25 13:33:51 +03:00
topilski 68552f028d First stable implementation of DEB and RPM packages 2013-07-23 16:37:21 +03:00
topilski 825d06ba68 Start implementation of DEB package 2013-07-24 22:05:25 +03:00
topilski 614643cb2e First implementation of rpm package for linux 2013-07-23 15:30:56 +03:00
topilski 387b68335b Windows package #163 2013-07-24 12:30:29 +03:00
topilski 1acc1765ad Robomongo icon missed on Windows #164 2013-07-24 09:41:46 +03:00
topilski 6f4d0a61a5 Fix shortcut in nsis installer 2013-07-23 22:36:18 +03:00
topilski 586e667dfc Fix windows build 2013-07-23 19:42:36 +03:00
topilski 493502ab61 Fix linux build 2013-07-23 19:29:15 +03:00
topilski 4763eadfa9 First implementation of Windows nsis package 2013-07-23 19:13:09 +03:00
topilski 3d5951aa0e Add Cpack option 2013-07-23 15:43:44 +03:00
topilski 5300195781 Fix linux make install target 2013-07-23 12:31:32 +03:00
topilski e09334ec63 Upper case for qjson project 2013-07-23 11:29:45 +03:00
schetnikovich 4bcdc0e091 Design/Layout tweaks of Index Properties Dialog 2013-07-23 01:29:32 +03:00
Dmitry Schetnikovich e0e43ac747 Merge pull request #160 from topilski/master
Fixed json text displaying
2013-07-22 11:33:52 -07:00
topilski 1d75b662e1 fix json text displaying 2013-07-22 21:17:50 +03:00
Dmitry Schetnikovich 4f50dad5cf Merge pull request #159 from topilski/master
Fixed Linux build
2013-07-22 10:35:30 -07:00
topilski a5f9729c3e Fix linux build 2013-07-22 17:37:52 +01:00
Dmitry Schetnikovich 89f5cd6c28 Merge pull request #158 from topilski/master
Support all index options #151
2013-07-22 08:38:01 -07:00
topilski 4c579b4f74 Support all index options #151 2013-07-22 18:28:17 +03:00
schetnikovich 8415170638 NumberLong() support in BJSON Parser and Writer #157
All int64 values now represented as NumberLong(x).
2013-07-22 18:28:11 +03:00
topilski 3e9305b408 Link qjson static on linux, upper case for cmake files 2013-07-22 17:07:34 +03:00
topilski 0e9361f4e8 Support all index options #151 (without dropDups, sparse default_language, language_override, weights) 2013-07-22 14:30:07 +03:00
topilski 4845b0f260 Fix linux build 2013-07-21 20:20:40 +03:00
topilski e432065f3d Allow full editing of Indexes #152 (intermediate commit) 2013-07-21 20:05:15 +03:00
topilski b7c0d69068 Fix linux build 2013-07-20 16:26:54 +03:00
topilski 30a6c29d8d Code cleanup 2013-07-20 15:07:56 +03:00
topilski ea7af33bd9 Added EnsureIndexInfo class 2013-07-20 11:41:37 +03:00
schetnikovich 26781183c1 CMake Scons fix 2013-07-19 20:29:21 +03:00
Dmitry Schetnikovich 564b746dbb Merge pull request #156 from topilski/master
Check new build system of Robomongo on Mac OS X (intermediate) #153
2013-07-19 10:12:03 -07:00
topilski b3736c4c7d Merge branch 'master' of https://github.com/topilski/robomongo 2013-07-19 18:08:15 +01:00
topilski e1c6ef169d Check new build system of Robomongo on Mac OS X (intermediate) #153 2013-07-19 18:01:22 +01:00
topilski 59b5c7f843 fix scincila displaying text on linux 2013-07-19 19:26:20 +03:00
topilski bd86d730a4 fix qsciscintilla rendering text on Windows 2013-07-19 19:04:23 +03:00
Dmitry Schetnikovich c4942e3e24 Merge pull request #155 from topilski/master
Implement Ctrl + F in all editors #134

Show collection's indexes in explorer tree #74
Save button shouldn't be disabled #146
2013-07-19 05:52:29 -07:00
topilski adde1c8bce Implement Ctrl + F in all editors #134 2013-07-19 15:13:46 +03:00
topilski c27b38ee7b refactoring ScriptWidget 2013-07-19 13:56:21 +03:00
topilski 7dc22a9104 Show collection's indexes in explorer tree #74 2013-07-19 11:19:12 +03:00
topilski e078b12eda Save button shouldn't be disabled #146 2013-07-19 09:02:14 +03:00
Dmitry Schetnikovich 97703b19e0 Merge pull request #154 from topilski/master
CMake default arguments #145
2013-07-18 13:07:46 -07:00
topilski 033310a275 CMake default arguments #145 2013-07-18 23:01:07 +03:00
topilski 90e02f88bd fix linux build, add UserResponce action 2013-07-18 18:37:16 +03:00
topilski b526131185 fix hide console on Qt5 2013-07-18 16:56:26 +03:00
topilski 26c7f41797 hide console on windows,intermediate commit (Allow full editing of Indexes) #152 2013-07-18 15:59:35 +03:00
topilski af8635939b Drop Index confirmation required #149 2013-07-18 11:06:03 +03:00
topilski ada7ff48e2 For Index creation, use mongo::Robomongo::fromjson() parser, instead of QJson #150 2013-07-18 09:39:33 +03:00
schetnikovich e74e24da97 Index operations tweaks (Ensure, Drop, Rename).
1) MongoClient::ensureIndex() now accepts name of index.
  2) Name of index is used on UI (instead of key name).
  3) MongoClient::deleteIndexFromCollection() simplified.
  4) MongoClient::renameIndexFromCollection() correctly
     performs rename of Index name.
  5) MongoClient::getIndexes() now gets Index names, not key names.
  6) Minor formatting tweaks.
2013-07-18 03:15:51 +03:00
Dmitry Schetnikovich 330c1aa878 Merge pull request #148 from topilski/master
Edit Index implementation #74
2013-07-17 09:32:08 -07:00
topilski 438e4f3096 added edit index item menu 2013-07-17 19:24:21 +03:00
Dmitry Schetnikovich a389433e6a Merge pull request #147 from topilski/master
CMake architecture auto definitions fixed. Added icons to header EditIndexDialog. Replaced QTextEdit to QScincila. Checkbox isUnique() and isBackground() properties of index. Added common base class to ExplorerTreeItems. Added showContextMenuAtPos() method.
2013-07-17 06:04:35 -07:00
topilski 937c3ffab6 code cleanup, fix some little bugs 2013-07-17 15:05:52 +03:00
topilski d68f058beb added common base class to ExplorerTreeItems, added showContextMenuAtPos method 2013-07-17 11:51:21 +03:00
topilski 742442b54d fix showcontextmenu intermediate commit 2013-07-16 19:44:05 +03:00
topilski 473c657e2b start implementation of showcontextmenu for treeitems 2013-07-16 15:55:30 +03:00
topilski 2c3b9b9a5b fix count of Index displaying 2013-07-16 14:50:19 +03:00
topilski 78037d2bf0 fix CMake architecture auto definitions, added icons to header EditIndexDialog, replace QTextEdit to QScincila, fix checkbox isunique and isbackground properties of index 2013-07-16 12:08:36 +03:00
Dmitry Schetnikovich c4bc632a64 Build documentation (Linux only) #124 2013-07-15 23:36:17 +02:00
Dmitry Schetnikovich 462a63e490 Merge pull request #144 from topilski/master
View/Refresh context menu items for Indexes subcategory
2013-07-15 12:35:58 -07:00
topilski cb6829659f add refresh/view index menu items 2013-07-15 22:14:58 +03:00
Dmitry Schetnikovich ac057568e8 Merge pull request #143 from topilski/master
toUtf8() instead of toAscii()
2013-07-15 09:14:13 -07:00
topilski 045e90afb5 fix build 2013-07-15 19:12:09 +03:00
Dmitry Schetnikovich 72aeed0d73 Merge pull request #140 from topilski/master
CMake fixed according to the new requests. Implementation of Index Management started (#74)
2013-07-15 08:58:15 -07:00
topilski a74a35bdbb fix compile error 2013-07-15 18:49:19 +03:00
topilski 992932cc78 and next fix 2013-07-15 18:39:13 +03:00
topilski bdcd4897cb next fix code style 2013-07-15 18:37:51 +03:00
topilski 27bc816ba1 fix code style 2013-07-15 18:19:11 +03:00
topilski 0c0fea2c9b Show collection's indexes in explorer tree #74 2013-07-15 14:59:40 +03:00
topilski b8fed3f119 add EditIndexDialog sources 2013-07-15 12:08:29 +03:00
topilski 8d7acad6a2 add delete index implementation 2013-07-15 10:21:16 +03:00
topilski 1a314e8330 add "delete index" to menu 2013-07-14 21:27:58 +03:00
topilski 21ed7d26c5 replace tabs to space, style fixes 2013-07-14 13:40:25 +03:00
topilski c8e404fd16 Added MongoIndex sources, some refatoring 2013-07-14 12:06:52 +03:00
topilski 0cc2292be5 fix linux build 2013-07-12 19:52:19 +03:00
topilski d14526090a fix cmake according new spec 2013-07-12 18:55:49 +03:00
topilski 105525fa54 Show collection's indexes in explorer tree #74 (only displaying) 2013-07-12 15:37:54 +03:00
topilski a8fd4882b8 add index item intermediate commit 2013-07-12 10:31:21 +03:00
Dmitry Schetnikovich 1d187e13cd Update README.md 2013-07-11 22:55:20 +02:00
Dmitry Schetnikovich edd5c3813b README updated 2013-07-11 21:05:26 +02:00
Dmitry Schetnikovich b84875c6d1 Merge pull request #137 from topilski/master
Refactoring
2013-07-11 11:35:45 -07:00
topilski e43be4447c fix KeyboardManager 2013-07-11 15:39:08 +03:00
topilski 62922d0731 minor refactoring 2013-07-11 13:47:20 +03:00
topilski 37f65c8697 small clean up 2013-07-11 09:14:15 +03:00
schetnikovich 29c753d98b Platform specific icons for Save/Open actions 2013-07-09 22:34:24 +03:00
schetnikovich d035457bda Open/Save toolbar set to be not movable 2013-07-09 22:18:00 +03:00
schetnikovich 5dc4a07ecb Fix for black background color of Search Box in Insert/Edit Document Text Editor 2013-07-09 21:54:56 +03:00
schetnikovich 2b4f9b9e57 Default view mode returned back to Tree mode 2013-07-09 21:46:31 +03:00
Dmitry Schetnikovich 1702047968 Merge pull request #136 from topilski/master
Expand all children #106
2013-07-09 11:12:43 -07:00
topilski 736da106b3 expand all children #106 2013-07-09 21:04:52 +03:00
schetnikovich e79d205db5 Fixed text line height for Linux. 2013-07-09 19:02:15 +03:00
Dmitry Schetnikovich c6f07c4530 Merge pull request #135 from topilski/master
Add button to toggle line numbers #112
2013-07-09 08:37:51 -07:00
topilski a55d281527 fix openAction behavior 2013-07-09 18:34:25 +03:00
topilski 5a3ae9877d start refactoring ScriptWidget 2013-07-09 15:56:43 +03:00
topilski 74a6a67411 intermediate commit (Implement Ctrl + F in all editors) 2013-07-10 01:20:17 +03:00
topilski 5403c96328 Add button to toggle line numbers #112 2013-07-09 22:53:35 +03:00
Dmitry Schetnikovich 95f1a8d1e5 Merge pull request #130 from topilski/master
Ability to save and open script files in shell #120 & #96
2013-07-08 08:24:02 -07:00
topilski ae0d2fa8b0 refactoring GuiiRegistry 2013-07-08 16:12:03 +03:00
schetnikovich ba3ea7b27c Find text tweaks (#32)
1) Next / Previous key bindings (Enter and Shift+Enter)
  2) All find text will be selected by default
  3) QLineEdit now used, instead of QTextEdit
  4) Fix for incorrect scrolling of selected text.
     Seems this is a bug of Scintilla (see comments in the code)
  5) Minor UI tweaks (spaces added)
2013-07-05 21:07:20 +03:00
schetnikovich d36b3b1097 Minor formatting changes 2013-07-05 20:01:07 +03:00
schetnikovich 32da5c6d45 Merge branch 'master' of https://github.com/paralect/robomongo 2013-07-05 17:15:13 +03:00
schetnikovich 8f58581a1c Ignoring *.user and jswgen from SpiderMonkey 2013-07-05 17:15:05 +03:00
Dmitry Schetnikovich b0fd42ea13 Merge pull request #129 from topilski/master
Added search capability in text mode view results (#32)
2013-07-05 07:10:53 -07:00
Dmitry Schetnikovich 4ad664f0cd Merge pull request #128 from mirmasej/patch-1
robomongo.sh updated
2013-07-05 06:01:58 -07:00
mirmasej 0e5c0873cb Update robomongo.sh
Use absolute paths so the script can be run from anywhere including .desktop file.
2013-07-05 07:59:09 +02:00
schetnikovich 3f052f821e Dumb file added 2013-07-04 20:17:05 +03:00
Dmitry Schetnikovich 9cc5176e9d Merge pull request #127 from topilski/master
Build scripts for linux fixed according to the new build system
2013-07-04 10:11:38 -07:00
Alexandr bd139b97bf fix path to qscintilla 2013-07-04 20:02:50 +03:00
topilski c6dba02995 fix build script for linux 2013-07-04 19:24:17 +03:00
schetnikovich bfa08fe778 SConstruct removed from the root folder
We are using CMake, instead of SCons.
2013-07-04 18:31:47 +03:00
Dmitry Schetnikovich 4c896f1d38 Merge pull request #126 from topilski/master
CMake for Windows and Linux
2013-07-04 08:26:29 -07:00
Alexandr 9c9f661534 fix bat files for building application 2013-07-04 10:26:44 +03:00
topilski f384f45fbe Open/Save/Save As in toolbar and File menu #131 2013-07-03 22:28:34 +03:00
Alexandr e43ca35633 fix build.bat for windows 2013-07-03 22:25:01 +03:00
topilski f21af37163 add line numbers to RoboScintilla 2013-07-03 22:06:40 +03:00
topilski df6dda8c50 add open implementation on FileMenu 2013-07-03 21:09:47 +03:00
topilski 7e6af15cd9 add actions to file menu 2013-07-08 21:51:29 +03:00
Alexandr 8a12f4f4a2 fix linux build, project ready to development 2013-07-03 20:50:13 +03:00
Alexandr b6b39c862a fix windows build 2013-07-03 19:00:55 +03:00
topilski a8737c4bef Ability to save and open script files in shell #120 (implemented) 2013-07-03 17:20:31 +03:00
topilski 209c9605cc fix crash 2013-07-03 16:38:01 +03:00
topilski cef5444259 next step of clean up code 2013-07-08 10:24:12 +03:00
topilski 5666875462 some refactoring cmake files, code style fixes 2013-07-07 22:20:03 +03:00
topilski b3eb137a79 add open file implementation 2013-07-07 11:36:37 +03:00
topilski 68fac49667 add open to popup menu 2013-07-06 19:32:55 +03:00
topilski 1cf0df0097 save script intermediate commit 2013-07-06 15:20:31 +03:00
topilski f6b0a5ac50 Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/robomongo/gui/editors/FindFrame.cpp
2013-07-06 08:53:41 +03:00
topilski 2c0a92955b add actions to filemenu 2013-07-05 20:03:24 +03:00
Alexandr 1269ed8aec fix install script for windows 2013-07-03 13:07:55 +03:00
Alexandr ab0ff7e4df fix prev search behavior, add icon to close button 2013-07-03 12:06:05 +03:00
Alexandr 3336aece80 added findFrame, intermediate commit (Add search capability in text mode view results) 2013-07-03 11:29:02 +03:00
Alexandr 4933112ff0 add_subdirectory for boost mongo thrid-party, fix install behavior on Windows 2013-07-03 09:19:29 +03:00
Alexandr dc55b99041 fix linux build 2013-07-03 07:23:49 +03:00
Alexandr ec9231a652 add architecture switch option 2013-07-02 21:41:30 +03:00
Alexandr 010e12fdea fix windows build 2013-07-02 14:55:43 +03:00
schetnikovich dfdf918a63 LICENSE file added 2013-06-30 21:39:12 +03:00
schetnikovich 46a40ba12f Libs folder now ignored 2013-06-30 21:32:23 +03:00
Alexandr 2255bc5cce fix linux link errors 2013-06-29 18:23:01 +03:00
Alexandr d3d4f204cc fix qjson on linux 2013-06-29 17:13:50 +03:00
Alexandr e4d77d9c87 fix qjson CMakeLists.txt 2013-07-02 09:14:16 +03:00
Alexandr bf1f1ae529 change build options to MDd for debug mode 2013-07-01 22:07:57 +03:00
Alexandr 1e62ff1b1c some updates in CMakeLists.txt 2013-07-01 16:30:30 +03:00
Alexandr d5eea82afe some build fixes, add project_helper cmake 2013-07-01 11:50:53 +03:00
topilski e1ce85b0bb fix build,add prefix and suffix for mongoclient library 2013-06-30 21:13:05 +03:00
topilski a1189083f3 fix windows build 2013-06-30 16:52:08 +03:00
topilski 3ffd95eaf9 start fixing windows build 2013-06-30 14:08:05 +03:00
Alexandr 94eac0a635 some refactoring 2013-06-29 15:41:19 +03:00
Alexandr 17a7057481 Delete not needed sources, fix build on linux 2013-06-29 12:31:42 +03:00
Alexandr 3203b29969 fix linux build 2013-06-29 09:16:29 +03:00
Alexandr 87c7e9c008 add cmake inner files 2013-06-28 21:37:31 +03:00
Alexandr c41ec75cfd add cmake files 2013-06-28 21:34:30 +03:00
schetnikovich c927c09efc Robomongo ported to Qt 5 #46
Qt 5 is now required. Robomongo will not compile for Qt 4.

Only Linux version now known to be compiled with Qt 5.
Windows and Mac OS are need to be verified.
2013-06-19 23:51:36 +03:00
schetnikovich 3e09a7f1e1 QJson now compiled with qmake (instead of cmake). Scons script update to automate build/clean/rebuild tasks of QJson 2013-06-19 19:13:05 +03:00
schetnikovich 19ebabfa4e QScintilla and QJson now part of the source (as third-parties) 2013-06-18 20:12:43 +03:00
schetnikovich 494bd677ef MongoDB now part of sources (as third-party) and Scons will be used to build Robomongo
MongoDB sources now located in /src/third-party/mongodb. SConstruct file added that
will be used to automate build process.
2013-06-18 00:36:16 +03:00
Dmitry Schetnikovich a98a7fbf9e Merge pull request #114 from luketn/master
Persist the view mode setting
2013-06-10 09:05:13 -07:00
Luke Thompson b68113142e Persist the view mode setting. 2013-06-09 21:42:40 +10:00
Dmitry Schetnikovich b2123665bf Merge pull request #109 from Gavruk/master
#90: Collection starting with underscore cannot be browsed
2013-06-01 08:29:40 -07:00
Sergey Gavruk b5035f0cf3 fix for #90 2013-06-01 18:12:18 +03:00
Dmitry Schetnikovich 693b875c2d Merge pull request #110 from Gavruk/autocomplete-tab
#95: autocomplete on tab
2013-06-01 07:55:49 -07:00
schetnikovich 7ba7ca5901 Minor version changes in install script 2013-06-01 17:49:38 +03:00
Sergey Gavruk 434e8a9aa0 #95: autocomplete on tab 2013-06-01 16:35:39 +03:00
schentikovich 8fddd7fb7b Install script fixes 2013-04-28 12:59:20 -07:00
schentikovich 81bd91d4cb Merge branch 'master' of https://github.com/paralect/robomongo 2013-04-28 12:22:42 -07:00
schentikovich 63419ba1f8 Install script for Linux 2013-04-28 12:16:26 -07:00
schetnikovich ba9a4a6d85 Merge branch 'master' of https://github.com/paralect/robomongo 2013-04-28 22:10:10 +03:00
schentikovich 5918bdd777 Linux i386 release libs 2013-04-28 10:20:24 -07:00
Dmitry Schetnikovich b5c6fc4469 Merge pull request #92 from Lardjo/patch-1
whats-new.txt updated.
2013-04-26 04:45:41 -07:00
Konstantin 9f4d4f8a76 Update whats-new.txt
fix year
2013-04-26 14:45:30 +04:00
Dmitry Schetnikovich de32695c45 Merge pull request #88 from Gavruk/master
Tab circling
2013-04-17 07:35:49 -07:00
Sergey Gavruk 89c29ccdba tab circling 2013-04-17 09:40:33 +03:00
Dmitry Schetnikovich 2c316fc31b Changelog for 0.7.1 2013-04-13 01:29:54 +04:00
Dmitry Schetnikovich 19ea21f21c Incorrect date for 0.7.0 version in changelog 2013-04-13 01:23:43 +04:00
Dmitry Schetnikovich 13e5bc9232 Changelog updated 2013-04-13 01:14:27 +04:00
schetnikovich 254bfcddd8 Version changed 2013-04-13 00:56:31 +03:00
schetnikovich b0da33d9de Switch tabs by alt+cmd+arrow for Mac (#82) 2013-04-12 20:04:57 +03:00
schetnikovich f33abf6054 Fixed crash when mouse right-click on non-primitive elements (#85) 2013-04-12 17:05:33 +03:00
Dmitry Schetnikovich 5368381242 Merge branch 'master' of https://github.com/paralect/robomongo 2013-04-08 21:19:05 +04:00
schetnikovich 0b8b1cec92 Update template fixed (#83) 2013-04-08 21:11:00 +03:00
Dmitry Schetnikovich b89b6fb005 "whats-new" and "shortcuts" files added (#78) 2013-04-08 21:18:13 +04:00
schetnikovich e3b8611eab Copy value in context menu for UUIDs 2013-04-04 23:52:55 +03:00
schetnikovich c36c177382 Version changed 2013-04-04 22:38:47 +03:00
schetnikovich 70067e8616 UUID binary subtypes support (#59)
Three encodings supported for legacy UUID subtype (3):
  - Java Encoding
  - .NET Encoding
  - Python Encoding

New UUID subtype (4) is also supported.

JSON Parser now understand 5 additional types:
      UUID("...")  =>  HexData(4, "...")
     NUUID("...")  =>  HexData(3, "...") in .NET GUID encoding
     JUUID("...")  =>  HexData(3, "...") in Java UUID encoding
    PYUUID("...")  =>  HexData(3, "...") in Python UUID encoding
    CSUUID("...")  =>  alias for NUUID("...")

Encoding for legacy UUID subtype can be selected from
    Options -> Legacy UUID Encoding
2013-04-04 22:27:38 +03:00
schetnikovich cdb83c5a2d HexUtils for some UUID formats (C#, Java, Python).
Setting added for UUID default encoding. On UI it is in "Options" menu.
2013-04-04 01:25:48 +03:00
Dmitry Schetnikovich 43ead6f172 Merge branch 'master' of https://github.com/paralect/robomongo 2013-04-03 00:25:10 +04:00
schetnikovich 8eb1a59f50 Version changed 2013-04-03 00:24:26 +03:00
schetnikovich 516da38502 Fixed rendering of collection names that are invalid JS names (#71) 2013-04-03 00:20:41 +03:00
Dmitry Schetnikovich 40eb132146 Logo 2013-04-03 00:24:55 +04:00
schetnikovich aa50e8309b Fixed incorrect rendering of large values for the db.stats() results (#70)
Such fields as count, size, storageSize, totalIndexSize and avgObjSize
now correctly manipulated when they exceed sizeof(int).
2013-04-01 19:26:51 +03:00
schetnikovich 272cb836e7 Password is hidden by default (#65)
You still can view password, by clicking Show button.
2013-04-01 18:34:21 +03:00
Dmitry Schetnikovich 4c8c8518f7 Merge pull request #67 from Gavruk/master
Hide text in password fields
2013-04-01 08:00:05 -07:00
Dmitry Schetnikovich bfdd2a72fe Update README.md 2013-03-30 02:50:14 +03:00
Dmitry Schetnikovich 6d462aaf55 Version in Inno Setup script updated 2013-03-30 02:35:22 +03:00
schetnikovich f2a5a2cefd Version changed 2013-03-30 01:40:19 +03:00
Sergey Gavruk 5d9f71fdad Merge branch 'master' of github.com:paralect/robomongo 2013-03-29 23:18:38 +03:00
schetnikovich f9506f49cb Mac install script that also creates dmg image 2013-03-29 21:29:07 +03:00
schetnikovich a20432a2c2 Robomongo.app folder template. For Mac executable starts from capital letter. 2013-03-29 19:35:43 +03:00
Sergey Gavruk 4ba12938c6 Merge branch 'master' of github.com:paralect/robomongo 2013-03-29 10:31:09 +03:00
schetnikovich ecc3fb1822 Ability to copy simple values (string, dates, numerics, bools) of Bson Elements in the tree (#33) 2013-03-29 01:48:19 +03:00
schetnikovich b33c14893d Space for header indicators 2013-03-29 00:41:09 +03:00
schetnikovich a5b1bc771c Explorer background color for Mac tweaked 2013-03-29 00:31:09 +03:00
Dmitry Schetnikovich 8f2f2fa3ee Minor changes in inno setup 2013-03-29 00:17:08 +03:00
schetnikovich acd7a5a99e Spacing removed for OutputViewer. Spaces on scroll bar in Explorer also removed 2013-03-29 00:16:03 +03:00
schetnikovich a438cd7c9c Autocompletion position tweaks 2013-03-29 00:02:02 +03:00
Sergey Gavruk ff6ca9659f hide text in password fields 2013-03-28 23:40:58 +03:00
schetnikovich 0d3346082e Alternating color for lists on Mac 2013-03-28 23:35:09 +03:00
Dmitry Schetnikovich 6c93ffd81c Merge pull request #64 from Gavruk/master
OS X: make connect/save/add buttons default in dialogs
2013-03-28 12:42:57 -07:00
schetnikovich f4f63ab31b Fix for crash on Mac when pressing CMD+W (#60) 2013-03-28 22:37:39 +03:00
Sergey Gavruk 80cfe328a1 Mac: make connect/save/add buttons default in dialogs 2013-03-28 21:11:41 +03:00
schetnikovich 86a8cad1a4 Diffs between MongoDB r2.4.0-rc0 and Robomongo 0.6.7 2013-03-27 18:51:11 +03:00
schetnikovich 1dcc027728 Support for '~/.mongorc.js' file (#44)
This file will be loaded for every shell.
2013-03-27 17:46:03 +03:00
schetnikovich 1e4a04bc60 Fix for -l option of build scripts 2013-03-27 03:45:00 +03:00
schetnikovich afe81257e2 Version changed 2013-03-26 23:25:37 +03:00
schetnikovich 6c4583d77b Tab that is closed with keyboard shortcut (Ctrl+W) now disposed in the same way as for middle-click and cross icon click (#42) 2013-03-26 23:10:27 +03:00
schetnikovich f184cf0ab2 Reindex on collection will not be executed immediately (#53) 2013-03-26 22:23:35 +03:00
schetnikovich b80d997b96 Support for collection names that start from number (#54) 2013-03-26 22:19:06 +03:00
schetnikovich a3d596fcfb Fix for incorrect default database, when cloning or duplicating collection (#56)
Also, you now can double click on "empty space" in tabbar, in order to open
new tab with the same server/database, as currenlty active shell (it is the
same as pressing Ctrl+T)

This feature can be seen as partially implemented #7.
2013-03-26 19:15:56 +03:00
schetnikovich 9e0f19b7a2 Autocompletion minor tweak 2013-03-26 00:48:14 +03:00
Dmitry Schetnikovich fa848b95ad Update README.md 2013-03-25 18:49:35 +03:00
Dmitry Schetnikovich 306366deca Update README.md 2013-03-25 02:02:48 +03:00
Dmitry Schetnikovich 4b552d68f4 Update README.md 2013-03-25 02:01:43 +03:00
Dmitry Schetnikovich 142f83bc9d Update README.md 2013-03-25 02:00:00 +03:00
Dmitry Schetnikovich 0b5e8d70d1 Update README.md 2013-03-25 01:56:55 +03:00
Dmitry Schetnikovich d1b7fb4279 Update README.md 2013-03-25 01:54:10 +03:00
Dmitry Schetnikovich a4a63b58e0 Update README.md 2013-03-25 01:41:54 +03:00
schetnikovich 36037f0494 Merge branch 'master' of https://github.com/paralect/robomongo 2013-03-25 00:52:59 +03:00
schetnikovich 1f9e2f9d8b Build options for build.sh, clean.sh and rebuild.sh changed
Options
-------

Option -d          build in debug mode
Option -r          build in release mode
Option -a          build both in debug and release modes
Option -l <path>   use specified path as path to libs folder

If lib path (-l) wasn't specified, <robomongo>/libs folder will be used.
If no args were specified, it will be debug build.

Example
--------

./build.sh -r
./build.sh -d -l /path/to/libs
2013-03-25 00:47:51 +03:00
Dmitry Schetnikovich 6dab43bb02 Merge pull request #45 from Gavruk/master
OS X release libs
2013-03-24 13:43:23 -07:00
Sergey Gavruk 366a2091dc mac release libs 2013-03-24 20:49:08 +03:00
Dmitry Schetnikovich bec9a12ed2 Merge pull request #41 from stennie/master
Add namespace for keepAlive() ping when not using auth credentials
2013-03-24 08:01:46 -07:00
Dmitry Schetnikovich 624a0dacc4 Merge pull request #40 from Gavruk/master
Server explorer bg color like in Finder and buttons layout on OS X + space added in document position number
2013-03-24 08:00:34 -07:00
Stephen Steneker 4d9a98f303 Add namespace for keepAlive() ping when not using auth credentials;
fixes "assertion 16256 Invalid ns [.$cmd]" on ping.
2013-03-24 11:35:44 +11:00
Sergey Gavruk 23e9223ec5 document position number fixed (space added) 2013-03-23 23:53:46 +03:00
Sergey Gavruk 62cc0b86cf server explorer background color like in Finder and buttons layout on OS X 2013-03-23 23:29:31 +03:00
Dmitry Schetnikovich b9339f53ab Merge pull request #39 from Gavruk/master
Remove Mac focus rect from BsonTreeWidget and ExplorerTreeWidget
2013-03-23 13:01:18 -07:00
Sergey Gavruk 32989a0c50 Remove Mac focus rect from BsonTreeWidget and ExplorerTreeWidget 2013-03-23 22:32:02 +03:00
Dmitry Schetnikovich 60ddf2b640 Merge pull request #38 from Gavruk/master
OS X UI fixes + duplicate collection feature
2013-03-23 12:25:26 -07:00
Sergey Gavruk 49d7aa2d83 duplicate collection from context menu added 2013-03-23 21:41:13 +03:00
Sergey Gavruk 89664b449e Merge branch 'master' of github.com:paralect/robomongo 2013-03-23 18:26:39 +03:00
Sergey Gavruk ef9be3aab2 OS X UI fixes 2013-03-23 18:25:14 +03:00
Dmitry Schetnikovich 7dc49a1bd0 Update README.md 2013-03-23 17:37:53 +03:00
Dmitry Schetnikovich 62847c12f0 Update README.md 2013-03-23 17:37:19 +03:00
Dmitry Schetnikovich 482d3fd511 Update README.md 2013-03-23 17:34:14 +03:00
Dmitry Schetnikovich f95b1bd07b Update README.md 2013-03-23 17:32:13 +03:00
Dmitry Schetnikovich 203d622685 Update README.md 2013-03-23 17:31:13 +03:00
Dmitry Schetnikovich b32edb7ece inno setup changes 2013-03-22 21:56:25 +03:00
schetnikovich d18e4c8427 version changed 2013-03-22 21:46:25 +03:00
schetnikovich 5a8777071c Fix for #34 (Crashing when viewing results in text mode) 2013-03-22 21:35:10 +03:00
Dmitry Schetnikovich 48bc52a587 correct QThread disposing 2013-03-22 20:50:50 +03:00
Dmitry Schetnikovich a033fefdff Merge pull request #35 from stennie/master
Instructions for creating standalone OS X Robomongo.app
2013-03-22 06:24:26 -07:00
Stephen Steneker 9a50324e7b Instructions for creating standalone OS X Robomongo.app 2013-03-23 00:15:11 +11:00
Dmitry Schetnikovich df4ddfb8f3 windows installer InnoSetup scripts 2013-03-17 21:01:03 +03:00
schetnikovich 20bee4568f version changed 2013-03-17 01:14:07 +03:00
schetnikovich 586c9d7367 Keep alive via { ping : 1 } every minute 2013-03-16 21:52:54 +03:00
schetnikovich 3d5d2919f3 Beta mark 2013-03-10 22:31:44 +03:00
schetnikovich 8187ab9a17 Settings schema version added 2013-03-10 22:29:37 +03:00
schetnikovich f9818246ed Function code skeleton when adding new one 2013-03-10 21:54:46 +03:00
schetnikovich cde350f7b8 Ability to rename function 2013-03-10 21:41:56 +03:00
schetnikovich 4b4a306fe1 About dialog 2013-03-10 20:28:47 +03:00
schetnikovich 62242e5c03 Minor three dots tweak 2013-03-10 19:00:08 +03:00
schetnikovich c164ab9dcd Count indicators for server folder 2013-03-10 18:42:53 +03:00
schetnikovich a6f4da8ef6 Count indicators for collections, users and functions folders 2013-03-10 18:16:34 +03:00
schetnikovich c9e2698600 Support for JS functions. Create/Edit/Remove/View 2013-03-09 23:07:41 +03:00
schetnikovich a1cca5647f Support for RegEx, Code and CodeWScope element types 2013-03-09 20:27:23 +03:00
schetnikovich 82c2079822 Label names tweaks 2013-03-09 19:42:42 +03:00
schetnikovich 1fd367b3b9 To print source of function, you do not need to type .toString() - it will print source automatically 2013-03-06 21:31:38 +03:00
schetnikovich 3401364fc5 Stop button added 2013-03-05 23:22:48 +03:00
schetnikovich 281de80bcc Version changed 2013-03-05 23:07:38 +03:00
schetnikovich 4f1e19d9d9 Title changed 2013-03-05 23:06:52 +03:00
schetnikovich 74dc520693 Changed label text in ConnectionsDialog 2013-03-05 22:02:46 +03:00
schetnikovich 701545f7ad Manage Connections window opened when application starts 2013-03-05 21:24:48 +03:00
schetnikovich 6dd75df09d Menu and toolbar changes 2013-03-05 20:48:18 +03:00
schetnikovich 2255fd5ba9 Comments color in script editor changed 2013-03-05 20:28:51 +03:00
Dmitry Schetnikovich 630b3b5c6e Separator on toolbar removed 2013-03-05 20:24:32 +03:00
schetnikovich e3d3ef675f Context menu items reposition (#25, #26) 2013-03-05 19:55:01 +03:00
schetnikovich 529c64a3c5 ToolBar buttons shown only if needed (#21, #20) 2013-03-05 19:29:24 +03:00
schetnikovich b9b05a59ac Ability to stop execution of script (#23) 2013-03-05 18:44:44 +03:00
schetnikovich d3f5aa9d83 Interrupt functionality 2013-03-05 00:58:06 +03:00
schetnikovich 13e2a25231 minor 2013-03-04 00:02:21 +03:00
schetnikovich 0bad88cbde Version changed 2013-03-03 23:52:47 +03:00
schetnikovich d240e0d76a View/Add/Edit/Remove users 2013-03-03 23:51:53 +03:00
schetnikovich 4d315212b3 Identical look of all editors 2013-03-02 20:11:06 +03:00
schetnikovich 18a967cb81 Shell keywords for MongoDB. Changes in highlighting schema 2013-03-02 19:22:42 +03:00
schetnikovich 0d7fb6bd80 run.sh for OS X 2013-03-02 18:50:07 +03:00
schetnikovich 7d81b8e896 Unix conditition in qmake pro files 2013-03-02 18:09:11 +03:00
schetnikovich 892f88b62d processinfo_darwing absolute include paths 2013-03-02 17:57:44 +03:00
schetnikovich f91bc3af84 Merge branch 'master' of https://github.com/paralect/robomongo 2013-03-02 17:55:07 +03:00
schetnikovich d4e072089f mongo processinfo_darwin.cpp 2013-03-02 17:54:47 +03:00
Sergey Gavruk 4502335115 -fpermissive compilation flag 2013-03-02 17:48:32 +03:00
schetnikovich 66e93e5109 XP_UNIX def for OS X 2013-03-02 17:21:51 +03:00
schetnikovich 8052a9d468 OS X third party libs var 2013-03-02 17:16:23 +03:00
Sergey Gavruk 0b8c97fe21 Merge branch 'master' of github.com:paralect/robomongo 2013-03-02 17:13:43 +03:00
schetnikovich 9f65190c9c OS X build files 2013-03-02 17:10:15 +03:00
Sergey Gavruk fd68f494a8 OS X build script 2013-03-02 16:23:27 +03:00
schetnikovich 51f51545fc Highlighting schema changed 2013-03-01 22:38:19 +03:00
schetnikovich 5c9eb2e497 Single connection per thread is used now, instead of pool of connections. 2013-03-01 18:25:24 +03:00
schetnikovich 45b7f8adc7 Background color for script text searches... 2013-03-01 02:05:58 +03:00
schetnikovich 2ce536a665 Version changed 2013-02-28 23:15:12 +03:00
schetnikovich 3dd9481ffe Memory leaks of CreateDatabaseDialog 2013-02-28 23:12:08 +03:00
schetnikovich 89cbb4c731 Remove All Documents from collection implemented 2013-02-28 22:21:58 +03:00
schetnikovich 8db16cce76 Support for Create/Drop/Rename of collections in UI. Corresponded context menu items added 2013-02-28 21:59:16 +03:00
schetnikovich ac3ab02f69 Support for database drop in UI. (Drop Database context menu item) 2013-02-28 19:40:22 +03:00
schetnikovich 93fa544cd3 Support for database creation in UI. (Create Database context menu item added) 2013-02-28 19:17:32 +03:00
Dmitry Schetnikovich ab6d39eda9 Borders for CollectionStatsTreeWidget made the same as for BsonTreeWidget 2013-02-28 00:34:20 +03:00
schetnikovich 571ecef370 Version changed. 2013-02-28 00:06:53 +03:00
schetnikovich 8c3373deaa Icons for Custom Mode. Tooltips for all mode buttons in results view 2013-02-28 00:06:03 +03:00
schetnikovich cd80e0d4a4 Correct selection of supported view mode. Repair now not executed automatically. 2013-02-27 23:35:15 +03:00
schetnikovich 53e374a6f2 Support for custom view modes added. Collections Statistics (db.printCollectionStats()) custom view mode partially implemented 2013-02-27 23:13:53 +03:00
schetnikovich a8cf91e4e2 Show Log context menu item for server 2013-02-27 02:10:30 +03:00
schetnikovich 5f1e545736 Version changed 2013-02-26 23:24:05 +03:00
schetnikovich 5f18c34d66 Refresh of server, database and collections implemented. 'Drop Collection' menu item added 2013-02-26 23:23:09 +03:00
schetnikovich eb12caab0f White list is used for one-line commands 2013-02-26 18:37:00 +03:00
schetnikovich dd69cdf5e1 Fix for CRLF/CR PCRE dectection for one-line commands (show dbs, show log etc.) 2013-02-26 17:29:49 +03:00
schetnikovich 5b7b4e5b6d Support for MongoDB one-line commands (show dbs, show collections, use some_db etc.) 2013-02-26 01:24:08 +03:00
schetnikovich 1c023685c4 debug/release fork 2013-02-24 21:50:12 +03:00
schetnikovich f01adb2d47 icons for buttons in DocumentTextEditor 2013-02-23 22:23:20 +03:00
schetnikovich 484b913209 version updated 2013-02-21 23:50:08 +03:00
Dmitry Schetnikovich e7f364ec6a win version upgraded to MongoDB r2.4.0-rc0 2013-02-21 23:17:11 +03:00
schetnikovich ae43e837b3 Fix for #18 (Loading icon does not disappear) 2013-02-21 20:29:30 +03:00
schetnikovich 6b1adeb860 fix for documents without _id fields 2013-02-21 20:04:21 +03:00
schetnikovich 13dca0770c Ability to insert new document right from tree widget 2013-02-21 19:52:53 +03:00
schetnikovich 5512203177 Better formatted JSON output with nicer indention. Dates in JSON are displayed as ISODate('...'), like in shell. Fix for missed subscribers in EventBus. 2013-02-21 19:39:40 +03:00
schetnikovich f719a938de View document functionality implemented 2013-02-21 17:17:06 +03:00
schetnikovich 93ebd1e863 1) Editing of documents in text mode implemented. 2) Deleting of single document by right-click implemented. 2013-02-21 00:42:31 +03:00
schetnikovich bb96baf638 validation of JSON data in DocumentEditDialog 2013-02-20 22:01:25 +03:00
schetnikovich 5d812d3b38 changes in json.h and json.cpp wrapped in ROBOMONGO ifdef endif 2013-02-20 19:23:58 +03:00
schetnikovich 80e4b5d7d2 ptimeutil and ISO 8601 date format parsing 2013-02-20 17:50:41 +03:00
schetnikovich a6f7a903f9 parsing of ISODate(...) partially implemented 2013-02-20 01:02:53 +03:00
schetnikovich 0905c03147 upgraded to MongoDB r2.4.0-rc0 2013-02-19 20:50:16 +03:00
schetnikovich 93c8f0f3ef several diff files 2013-02-18 18:22:43 +03:00
Dmitry Schetnikovich 3f0803a17c shell impl for r2.4.0-rc0 2013-02-17 03:12:08 +03:00
Dmitry Schetnikovich 3d7b9ebc0a changes in misc.h and SConstruct documented 2013-02-17 02:19:53 +03:00
schetnikovich 0a6d6dc1ee docs folder 2013-02-17 02:13:50 +03:00
schetnikovich a4804eafde ignoring *.pro.user.* files 2013-02-16 21:36:00 +03:00
schetnikovich 06f8fcf05d ability to add and view document 2013-01-31 03:27:35 +03:00
schetnikovich 9118de36c1 unused header removed 2013-01-29 23:22:37 +03:00
schetnikovich 50b97eed00 JsonBuilder added, used when preparing json string 2013-01-29 23:21:02 +03:00
schetnikovich c9102a17be DocumentTextEditor dialog skeleton 2013-01-29 22:05:45 +03:00
schetnikovich 6dcd7dd18b date-time format changed 2013-01-29 17:59:17 +03:00
schetnikovich edbd5a1c0f Signed milliseconds handled now correctly (#5) 2013-01-29 01:20:34 +03:00
schetnikovich 0c1aad60a4 Default database now empty, when creating new connection (#16) 2013-01-27 19:24:46 +03:00
schetnikovich dab7f5584a Encoding problem for text view fixed (#17) 2013-01-27 19:19:21 +03:00
schetnikovich 47b70d3415 version changed 2013-01-26 00:50:18 +03:00
schetnikovich ad3f949208 stop symbols extended to support partial editing with autocompletion. now we also support editing in the middle of the text, with autocompletion, if possible 2013-01-26 00:45:38 +03:00
schetnikovich 43a8b9f1ef small refactoring of sanitize function 2013-01-25 21:44:25 +03:00
schetnikovich b5a3aabcf3 autocompletion box positioned now near typed text 2013-01-25 21:37:11 +03:00
schetnikovich 64c3f839ec autocompletion popup in logical place now. font of items in completion list now match the one in script widget 2013-01-25 00:53:25 +03:00
schetnikovich f9d90c87bb word wrap disabled for ScriptWidget 2013-01-24 22:59:48 +03:00
7197 changed files with 1242028 additions and 797415 deletions
+93 -4
View File
@@ -1,9 +1,98 @@
# Ignore *.pro.user files
*.pro.user
# Robomongo-specific
CMakeLists.txt.user*
.sconsign.dblite
.sconf_temp
.scons
*.kate-swp
*.swp
target/
*~
*.autosave
target-debug/
target-release/
libs/
/build
/build2
/src/robomongo/robomongo.pro.user.1.3
.idea/
# Created by http://www.gitignore.io
### C++ ###
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Compiled Dynamic libraries
*.so
*.so.*
*.dylib
*.dll
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
### Linux ###
*~
# KDE directory preferences
.directory
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
### Qt ###
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt-es
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.moc
# QtCreator
*.autosave
*.creator.user
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
+400
View File
@@ -0,0 +1,400 @@
0.9.0-RC6 / February 13, 2016
Most important changes: support for MongoDB 3.x and WiredTiger engine. Robomongo
now embeds MongoDB 3.2 shell. It means that you can now use the latest
shell functionality. Both MONGODB-CR and SCRAM-SHA-1 authentication mechanisms are
supprted. Also, we now allow direct connections to Replica Set members and
support IPv6 protocol. Loading of huge list of collections is now faster.
Fixed incorrect representation of floating-point numbers (fixed since RC3).
This bug was a reason of a big number of issues:
#910, #748, #697, #699, #760, #815, #870, #892,
#894, #905, #945, #974, #978, #990, #831, #842
What's new in RC7 (March 4, 2016 )
http://blog.robomongo.org/robomongo-rc7
What's new in RC6 (February 13, 2016 )
http://blog.robomongo.org/ipv6-protocol
What's new in RC5 (February 8, 2016 )
http://blog.robomongo.org/campaign-is-over-robomongo-is-not/
What's new in RC4 (February 1, 2016 )
http://blog.robomongo.org/robomongo-rc4
What's new in RC3 (January 29, 2016 )
http://blog.robomongo.org/robomongo-0-9-0-rc3-released
What's new in RC2 (January 26, 2016)
http://blog.robomongo.org/robomongo-rc2-for-windows-mac-os-x-and-linux
What's new in RC1 (January 17, 2016)
http://blog.robomongo.org/robomongo-rc1-with-full-support-for-mongodb-3
0.8.5 / March 10, 2015
Release 0.8.5 is now deprecated because of a critical bug, that is
described here: http://blog.robomongo.org/robomongo-0-9-0-rc3-released
We recommend to use Robomongo 0.9.0 or newer.
* [Stephen Steneker]
- OS X build fixes for XCode 5 / libc++ (#524)
- OS X specific keyboard shortcut tips (#505)
- View documents fail if collection name is "group" (#414)
- Problem with slash in collection names (#404)
- Add shortcut to open JS file (#408)
- Fullscreen mode not working on OS X (#519)
- Usability request - add initial curly braces to command bar (#506)
- TTL index should allow expiry of 0 seconds (#500)
- Add line numbers to JSON editing windows on OS X (#449)
- Add user preference to have line numbers displayed by default (#564)
- Space after document causes validation error (#544)
- Expand current server as soon as you connect to it (#405)
- Switching tabs using standard keys on OS X (#87)
- Cannot make the Edit Document Window smaller (#548)
- Consistent numbering for tree/table/text view items (#421)
- Reload Query with keyboard shortcut doesn't work (#551)
- Rename "Reload" to "Re-execute query" (#447)
- Add "Copy Timestamp from ObjectId" to context menu for ObjectId fields (#559)
- Bug: Type of Double changed to Int32 on save document (#622)
- "Duplicate Query In New Tab": add to Window menu with keyboard shortcut (#631)
- No errors logged if settings directory cannot be created or settings file cannot be written to (#636)
- Show execution time for operations that don't return results (#455)
- Disable broken "Copy Collection to Database" misfeature (#398)
* [Vladimir Belozyorov]
- View mode reset to default after no results (#509)
- Comment / uncomment selected code in the shell (#467)
- Passphrase and password should be hidden in authentication tab (#433)
- Cursor initialization - place between curly brackets for default find({}) query (#592)
- Include full date/time for log entries (#596)
- Option to disable selected code autoexecution when opening a new tab (#514)
- Tooltip fixes to match current keyboard shortcuts (#598)
- Expand/collapse multiple selections (#591)
- Changes in toolbars visibility are saved in config file (#457)
- Include connection name under shell tabs (#47)
* [Sergey Gavruk]
- SettingsManager typo (#558)
- Ability to disable autocompletion (#512)
* [Kanstantsin Kamkou]
- Increase display width for limit & offset input fields (#458)
* [volans-]
- CreateUserDialog.cpp: fixed typo in warning message
* [Andres Kievsky]
- Added new app icon in a variety of png and iDraw formats (#693)
* [Michael Steinacher]
- Retina text display support (#724)
0.8.4 / November 27, 2013
Read about updates in this version here:
http://robomongo.org/whats-new-in/robomongo-0.8.4.html
RC1:
* SSH support (#117)
* SSL support (first steps) (#100)
* Create or edit index problem (#341)
* Regexp error (with non-latin symbols) (#351)
* Support for latin characters in edit document console (#347)
* Robomongo fails to execute shell "comments" if the comment contains a non-latin character! (#334)
* Crash when add ISODate field (#350)
* Crash at executing several disconnections in a row (#290)
* Deleting multiple documents prompts for each document (#386)
* Connection context menu appears independently of position of Robomongo instance.
* Crash at pressing "Ctrl+T" without any connection.
RC2:
* SSH now works on Mac OS X Mavericks (#401)
* Fixed crash when parsing date (#356)
Final:
* Selected view mode of result panels now preserved between executions. Implemented by Vladimir Belozyorov (github.com/VBelozyorov) (#402)
0.8.3 / October 1, 2013
Read about updates in this version here:
http://robomongo.org/whats-new-in/robomongo-0.8.3.html
* Enable query logging (#108)
* Inserting multiple documents from UI (#173)
* Removing multiple documents from UI (#174)
* Retain current view mode when running search (#93, #79)
* Left panel collections/functions/users navigation doesn't work when authenticating against the DB (#282)
* A way to disable Alt + number shortcut (#192)
* Support mongodb 2.4.x style users (#139)
* Add "Copy JSON" menu item to context menu (#298)
* JSON list validation (#246)
* Crash creating new Database (#291)
* Incorrect handling of TTL Indexes (#313)
* Add the document _id in the tree view (#142)
* BSON Undefined type doesn't rendered to string correctly (#306)
* Entering incorrect symbols as database name isn't handled properly (#262)
* Ability to select UI theme
* We now show number of fields (inside objects) and number of items (inside arrays) in Tree View.
* Support for Mac OS X 10.6 (#287)
* Support for Mac OS X 10.9 (#254)
0.8.2 / September 13, 2013
Read about updates in this version here:
http://robomongo.org/whats-new-in/robomongo-0.8.2.html
0.8.1 / September 6, 2013
Read about updates in this version here:
http://robomongo.org/whats-new-in/robomongo-0.8.1.html
* Table Mode (in this version, only for the first-level fields in documents) (#72)
* Paging Widget tweaks (#247, #203, #244, #243)
* ~/.robomongorc.js file is loaded automatically when new shell is opened
(c:\Users\Name\.robomongorc.js for Windows)
* "Load .mongorc.js" menu item in "Options" top-level now allow to enable/disable loading
of ~/.mongorc.js file. By default it will not load this file.
* Batch Size now configurable (in this version only manually via ~/.config/robomongo.json)
* JSON parser doesn't correctly parse numbers when locale isn't en_EN (#246, #253)
* "Display Dates In" options doesn't saved/loaded correctly (#261)
* [Linux] Support for CentOS
* [Linux] Linux packages now takes 2x less space (10mb instead of 20mb)
* [Windows] Desktop icon isn't created despite corresponding checkbox was checked at installation. (#260)
* [Windows] Invalid symbols in installer for Windows if display language of system isn't English (#259)
0.8.0 / August 23, 2013
Read about updates in this version here:
http://robomongo.org/whats-new-in/robomongo-0.8.0.html
* Ability to save and load files for currently opened shell (#96)
* MongoDB Index management (#74)
* Expand all children recursively (#106)
* Ability to toggle line numbers (press F11) for any editor in Robomongo (#112)
* View Mode settings is persisted now (thanks, Luke Thompson!) (#114)
* Search capability for any editor in Robomongo - press (Ctrl + F) (#32)
* Timezone support: UTC or Local (#224)
* Auto-complete on "Tab" (#95)
* Fixed incorrect handling of Dates (#111)
* Fixed incorrect handling of collections with leading underscore (_) symbol (#109)
* Fixed incorrect rendering of float numbers (#115)
* Fixed incorrect handling of Int64 numbers (#157)
* Fixed incorrect parsing of DBRef sub-objects (#113)
* New build system, based on CMake. Greatly simplified build and package process.
* Qt updated to 5.1 version.
* QScintilla updated to 2.7.2 version.
0.7.1 / April 13, 2013
* Fixed crash when right-clicking on non-primitive elements in Tree View (#85)
* Alt + Cmd + Arrow for switching tabs on Mac (#82)
* Several minor bugs fixed (including #82)
0.7.0 / April 4, 2013
* Support for UUIDs (read more: http://robomongo.org/articles/uuids.html)
0.6.9 / April 3, 2013
* Password is hidden by default (#65)
* Fixed incorrect rendering of large values for the db.stats() results (#70)
* Collection names with invalid (for JS var name) characters now rendered correctly (#71)
0.6.8 / April 1, 2013
* Support for '~/.mongorc.js'
* Various Mac OS X UI fixes
* Fixed crash when pressing Ctrl + W (#60)
* "Copy Value" context menu item for documents in Tree View
0.6.7 / March 26, 2013
* Fixed creation of new tabs based on the current one. Before this fix initial
database for new tab wasn't identical to the "parent". (#56)
* Support for collections that starts from digits (#54)
* [Sergey Gavruk] Duplicate Collection feature (Collection -> Duplicate Collection
* Collection -> Reindex will not run immediately, as before
* Fixed incorrect disposing of tabs resources (connections etc.) (#42)
* [Stephen Steneker] Fixed KeepAlive invalid commands, when not authorised (#41)
* [Sergey Gavruk] Various Mac OS X UI fixes.
0.6.6 / March 23, 2013
* Fixed possible crash when viewing results in text mode (#34)
* Fixed possible crash when testing connection (Diagnostic window)
* Memory leak in explorer's database tree fixed.
0.6.5 / March 17, 2013
* Fixed "Dropped connection" issue (#28).
* Windows Installer now be used to destribute Robomongo.
0.6.4 / March 10, 2013
* Support for JS functions. Create/Edit/Remove/View.
* Loading indicators (three dots for now) for Server, Collections, Functions and Users.
* Count indicators for Server (number of databases), Collections, Functions and Users.
* No need to type "functionName.toString()". You can output source of function
by simply typing its name (like in the shell).
* Support for RegEx, Code and CodeWScope bson elements. But you still cannot edit
documents which contains Code or CodeWScope bson elements.
* About dialog added.
0.6.3 / March 5, 2013
* Script execution can be stopped (this works only for JS code in SpiderMonkey VM) (#23)
* Toolbar buttons shown only if needed (#21, #20)
* MongoDB Connections window opens when application starts.
* Some changes in menu items locations (#25, #26)
* View Mode buttons moved to Options menu.
* Full Screen and Logs functionality hidden right now (postponed for versions after Robomongo 1.0)
0.6.2 / March 4, 2013
* "Users" folder now shows list of users.
* User can be added (Database -> Add User)
* User can be edited (User -> Edit User)
* User can be removed (User -> Remove Users)
* Users can be refreshed (Users (folder) -> Refresh Users)
* List of users can be viewed in the shell (Users (folder) -> View Users)
0.6.1 / March 2, 2013
* Minor script editor and viewer tweaks
0.6.0 / Feb 28, 2013
* Database can be created from UI (Server -> Create Database)
* Database can be dropped from UI (Database -> Drop Database)
* Collection can be created from UI (Database -> Create Collection)
* Collection can be dropped from UI (Collection -> Drop Collection)
* Collection can be renamed from UI (Collection -> Rename Collection)
* All documents can be removed from UI (Collection -> Remove All Documents)
* Minor tweaks in naming of context menu items.
0.5.7 / Feb 27, 2013
* Support for Custom View Modes. First custom view implemented for "db.printCollectionStats()" query. You
still can view multiple output results, even if one of them presented in custom mode.
* "Show Log" context menu item for servers in Explorer.
0.5.6 / Feb 26, 2013
* Support for one-line MongoDB commands ("show dbs", "show collection", "use somedb" etc.). This commands can
be repearted (this will result in multiple output results) or they can be used together with ordinary JavaScript.
The only rule: this command should be the only text on the line, starting from the very beginning of the line.
* Refresh of databases and collections via "Refresh" context menu item.
* This version of Robomongo is the first version compiled in release mode. It works much more faster and uses lower
amount of memory.
0.5.5 / Feb 22, 2013
* New document can be added in a more user friendly way. There are two ways to do it:
1) Right-click on collection in Explorer and select "Insert Document"
2) Right-click at any place of Tree View and select "Insert Document"
* Better formatting of JSON with correct indention.
* Support for ISODate(...) factory function in JSON parser and builder. Date in JSON mode now always
displayed as ISODate(...), like in the shell. Document Editor accepts dates in two forms:
as "new Date(<millisecs>)" and "ISODate(<iso_8601_date_string>)" (this behaviour identical to MongoDB shell behaviour)
* Document editor implemented. Right-click on document in Tree View and select "Edit".
* Document viwer implemented. Right-click on document in Tree View and select "View".
* You can delete selected document in Tree View. (Right-click and select "Delete")
* Validation of JSON in Document Editor/Viewer with error report, highlighting of errors and
cursor positioning just where error is.
* Fixed problem with "signed" dates (dates before Unix Epoch) (#5)
* Fixed problem with UTF-8 (#17)
* Fixed problem with loading indicator in Explorer (#18)
0.5.2 / Jan 26, 2013
In this version autocompletion in Robomongo becomes mostly usable.
* AutoCompletion box now placed just near text you typed (in correct line and column)
* AutoCompletion now works in the middle of the text (not only at the end of line, as before)
* Ctrl + Space will trigger autocompletion for symbols under cursor.
* If you select function in autocompletion box, their open parenthesis will overwrite existing in the text, if such available.
0.5.1 / Jan 24, 2013
* Several autocompletion tweaks.
0.5.0 / Jan 24, 2013
* AutoCompletion. First version.
* Progress indicator for shells.
* Shell result panels now have equal size, if this is possible.
* Code cleanuped a bit.
0.4.6 / Jan 11, 2013
* Tooltip for collections with count and size.
0.4.5 / Jan 8, 2013
* WARNING: configuration file schema changed. Some properties will be
empty in Connection Settings Dialog. Please fill them again.
* Connection test (diagnostic) implemented.
* Indicators in the shell: current server, database and collection (if available)
This indicators are "real" - they respect your actual query.
* Execution time measurement. Displayed for each individual output result.
* Paging for each output result with respect to filtering, ordering, fields,
limit, skip etc. of actual text query (pilot version).
* Connection cloning support in Connections Dialog.
* Databases and collections now displayed in sorted order.
* Batch size extended to 50 documents.
* New shape of Shells.
* New shape of Connection Settings Dialog
* New shape of Connections Dialog.
0.4.0 / Dec 26, 2012
* No more "type 'it' for more results" when we have more than 20 objects in collection.
* Two global modes added - text and tree modes. Switch between them using F3 and F4.
* Two local modes added - text and tree modes. Switch between them using small
icons on Output panels for each resultset.
* Improved performance of json creation (from list of documents).
* Tooltips for tool buttons added.
* Maximization of output panel implemented (via small icon at the top right of output panel)
Click second time to restore back.
* Fix for not working Ctrl-O key shortcut (that opens Connections menu).
0.3.5 / Dec 25, 2012
* Context menu for server, database and collection.
* Tab management (Ctrl+Tab, Ctrl+Shift+Tab, Ctrl+T, Ctrl+F4)
* Context menu for tab
* Submenu for Connect button with connections.
* Hotkeys for first 9 connections (Alt+1, ..., Alt+9)
* Connections reordering via drag'n'drop in Connections dialog.
* Correct focus placement when opening new connection and switching tabs.
* Bonus: F12 - opens connections menu from any place.
* Memory leaks fix.
+46
View File
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 3.0.0)
project(Robomongo)
# Where to look first for CMake modules, before "${CMAKE_ROOT}/Modules" is checked
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
# Project version
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "9")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION_BUILD "-RC7")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${PROJECT_VERSION_BUILD}")
# Modules
include(RobomongoPrintUtils)
include(RobomongoCMakeDefaults)
include(RobomongoDefaults)
include(RobomongoCommon)
include(RobomongoTrashSymbols)
include(RobomongoTargetArch)
include(RobomongoInstallQt)
include(RobomongoPackage)
# Search for dependencies
find_package(Threading REQUIRED) # Wrapper arround CMake "Threads" module
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(MongoDB REQUIRED)
if (SYSTEM_MACOSX)
find_package(Qt5MacExtras REQUIRED)
endif()
# Projects
add_subdirectory(src/third-party/openssl)
add_subdirectory(src/third-party/libssh2)
add_subdirectory(src/robomongo/ssh)
add_subdirectory(src/third-party/qjson)
add_subdirectory(src/third-party/qscintilla)
add_subdirectory(src/robomongo)
# Show configuration summary
include(RobomongoConfigurationSummary)
+11
View File
@@ -0,0 +1,11 @@
Robomongo, shell-centric cross-platform MongoDB management tool.
Copyright 2013, Paralect.
The Robomongo is released under the terms of the GNU General Public
License, version 3.
The Robomongo Project includes files written by third parties
and used with permission or subject to their respective license
agreements.
+3
View File
@@ -0,0 +1,3 @@
Robomongo is a shell-centric cross-platform open source MongoDB management
tool (i.e. Admin GUI). Robomongo embeds the same JavaScript engine that
powers MongoDB's mongo shell.
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
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
state 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) <year> <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 3 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, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+83 -37
View File
@@ -1,50 +1,96 @@
Robomongo
=========
About Robomongo
===============
[Robomongo](http://www.robomongo.org) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robomongo embeds the actual `mongo` shell in a tabbed interface with access to a shell command line as well as GUI interaction.
Starting from version 0.9, Robomongo is compatibile with MongoDB 3.x (including SCRAM-SHA-1 auth and support for WiredTiger storage engine). Robomongo 0.9 embeds the **MongoDB 3.2** shell.
Robomongo 0.8.x embeds the **MongoDB 2.4.0** shell.
Robomongo is a shell-centric crossplatform MongoDB management tool.
Download
========
You can download compiled version at this page:
You can download tested install packages for OS X, Windows, and Linux from our site: [www.robomongo.org](http://www.robomongo.org).
https://www.dropbox.com/sh/u0s0i8e4m0a8i9f/oxtqKHPUZ8
The latest stable release is currently **Robomongo 0.8.5**.
Only Windows binaries available for now.
Support
=======
Robomongo is an open source project driven by volunteers. We'll try to get to your questions as soon as we can, but please be patient :).
You can:
- [Create a new issue in the Github issue queue](https://github.com/paralect/robomongo/issues)
- [Join developer discussion on Gitter](https://gitter.im/paralect/robomongo) [![Join the chat at https://gitter.im/paralect/robomongo](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/paralect/robomongo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Build
=====
The wiki contains prerequisites and instructions to [Build Robomongo](https://github.com/paralect/robomongo/wiki/Build-Robomongo).
If you want to compile from source yourself, you should be able to do so cleanly from a [release branch](https://github.com/paralect/robomongo/releases).
What's Planned for the Next Release?
====================================
We are currently working toward a [0.9.0 release milestone](https://github.com/paralect/robomongo/milestones/Robomongo%200.9.0)
with some major features targeted including compatibility with MongoDB 3.0
(updated shell, SCRAM-SHA-1 auth, support for WiredTiger storage engine)
and full support for replica sets.
Contribute!
===========
### Vote for Features
Please view our [Magic Backlog](http://app.robomongo.org/backlog) to see features prioritised by donation. The small amount of donations we currently receive are put toward hosting costs.
### Suggest Features
New feature suggestions or UI improvements are always welcome.
This project is powered by open source volunteers, so we have a limited amount of development resource to address all requests. We will certainly make best efforts to progress (particularly for those with strong community upvotes).
### Code Contributions
Code contributions are always welcome! Just try to follow our coding style: [Robomongo Coding Style](https://github.com/paralect/robomongo/wiki/Robomongo-Coding-Style).
If you plan to contribute, please create a Github issue (or comment on the relevant existing issue) so we can help coordinate with upcoming release plans.
For a general workflow, see Github's guide to [Fork a Repo](https://help.github.com/articles/fork-a-repo/).
Pull requests (PRs) should generally be for discrete issues (i.e. one issue per PR please) and be clean to merge against the current master branch. It would also be helpful if you can confirm what testing has been done (specific O/S targets and MongoDB versions if applicable).
A usual naming approach for feature branches is `issue-###`. Include the issue number in your commit message / pull request description to link the PR to the original issue.
For example:
```#248: updated QScintilla to 2.4.8 for retina display support".```
### Design
There are some cosmetic issues we could use help with (designing images or UI). They are marked in the issue queue with a [`Cosmetic`](https://github.com/paralect/robomongo/labels/cosmetic) label. If you see an open issue that you'd like to contribute to, please feel free to volunteer by commenting on it.
### Testing
There are a number of issues we could use help with reproducing. They are marked in the issue queue with a [`Needs Repro`](https://github.com/paralect/robomongo/labels/needs%20repro) label. If you see an open issue that doesn't appear to be reproducible yet, please feel free to test and comment with your findings.
Building
========
License
=======
Windows
-------
Copyright (C) 2013-2015 [Paralect, Inc](http://www.paralect.com)
Prerequisites:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
* Qt should be compiled with VC2010. Tested with Qt 4.8
* Your PATH variable should have Qt bin folder
* Visual Studio 2010 should be installed and VC should be in this location: %ProgramFiles%\Microsoft Visual Studio 10.0\VC. Otherwise you need to modify VISUALC_PATH in build script.
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.
Compiling:
> cd build
> build.bat
Executable will be placed to: target/debug/app/out
Linux
-------
Prerequisites:
* Qt should be installed. Tested with Qt 4.8
* Your PATH variable should have Qt bin folder
Compiling:
$ cd build
$ chmod u+x build.sh
$ ./build.sh
Executable will be placed to: target/debug/app/out
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
+20
View File
@@ -0,0 +1,20 @@
Bash fronted for CMake
======================
If you want to use this scripts, you need to set single environment variable:
export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5/5.5/gcc_64;/path/to/robomongo-shell"
Build Robomongo:
$ bin/configure
$ bin/build
Install Robomongo:
$ bin/install
Pack Robomongo:
$ bin/pack
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
cmake --build . "${@:2}" -- -j8
+15
View File
@@ -0,0 +1,15 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run build
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE%
Executable
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
cd $VARIANT_DIR && rm -rf $BUILD_DIR_NAME
+15
View File
@@ -0,0 +1,15 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Clear build directory
cd "%VARIANT_DIR%"
rmdir /s /q "%BUILD_DIR_NAME%"
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
if [ "$1" == "debug" ]; then
BUILD_TYPE=Debug
else
BUILD_TYPE=Release
# Prepend "release" in front of $@
set -- release "$@"
fi
# Build dir name is a lowercase of BUILD_TYPE
# i.e. debug
BUILD_DIR_NAME="$(echo $BUILD_TYPE | tr '[A-Z]' '[a-z]')"
# i.e. /path/to/robomongo/build
VARIANT_DIR=$PROJECT_DIR/build
# i.e. /path/to/robomongo/build/debug
BUILD_DIR=$VARIANT_DIR/$BUILD_DIR_NAME
# i.e. /path/to/robomongo/build/debug/install
INSTALL_PREFIX=$BUILD_DIR/install
# i.e. /path/to/robomongo/build/debug/package
PACK_PREFIX=$BUILD_DIR/package
PREFIX_PATH=$ROBOMONGO_CMAKE_PREFIX_PATH
mkdir -p $BUILD_DIR
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we specify minimal OS version that we support.
#
# The following environment variable will set "-mmacosx-version-min=10.6" option
# for compiler. From documentation to GCC or Clang:
#
# -mmacosx-version-min=version
#
# The earliest version of MacOS X that this executable will run on is
# version. Typical values of version include 10.1, 10.2, and 10.3.9.
#
# This value can also be set with the MACOSX_DEPLOYMENT_TARGET environment
# variable. If both the command-line option is specified and the
# environment variable is set, the command-line option will take precedence.
#
export MACOSX_DEPLOYMENT_TARGET=10.9
fi
+48
View File
@@ -0,0 +1,48 @@
rem Check that ROBOMONGO_CMAKE_PREFIX_PATH is set
if not defined ROBOMONGO_CMAKE_PREFIX_PATH (
echo Set environment variable ROBOMONGO_CMAKE_PREFIX_PATH in order to use this script
echo.
echo For example, execute the following command:
echo setx ROBOMONGO_CMAKE_PREFIX_PATH "c:\Qt-5\5.5\msvc2013_64;c:\robomongo-shell"
echo.
echo You also need to reopen your Windows Command Prompt.
exit /b 1
)
rem Check for debug build type
if %1. == debug. (
set BUILD_TYPE=Debug
) else (
rem If build type wasn't specified - Release mode assumed
if %1. ==. (
set BUILD_TYPE=Release
) else (
echo Invalid build type "%1". Supported build types: debug or release.
exit /b 1
)
)
rem Build dir name (i.e. Release)
set BUILD_DIR_NAME=%BUILD_TYPE%
rem i.e. /path/to/robomongo/build
set VARIANT_DIR=%PROJECT_DIR%\build
rem i.e. /path/to/robomongo/build/debug
set BUILD_DIR=%VARIANT_DIR%\%BUILD_DIR_NAME%
rem i.e. /path/to/robomongo/build/debug/install
set INSTALL_PREFIX=%BUILD_DIR%\install
rem i.e. /path/to/robomongo/build/debug/package
set PACK_PREFIX=%BUILD_DIR%/package
rem Get value from environment variable
set PREFIX_PATH=%ROBOMONGO_CMAKE_PREFIX_PATH%
rem Create BUILD_DIR if it is not exists already
if not exist "%BUILD_DIR%" (
md "%BUILD_DIR%"
)
Vendored Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
cmake -D "CMAKE_PREFIX_PATH=$PREFIX_PATH" -D "CMAKE_BUILD_TYPE=$BUILD_TYPE" -D "CMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" "${@:2}" $PROJECT_DIR
+15
View File
@@ -0,0 +1,15 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run CMake configuration step
cd "%BUILD_DIR%"
cmake -G "Visual Studio 12 2013 Win64" -D "CMAKE_PREFIX_PATH=%PREFIX_PATH%" -D "CMAKE_BUILD_TYPE=%BUILD_TYPE%" -D "CMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" %PROJECT_DIR%
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
cmake --build . --target install/strip "${@:2}"
+15
View File
@@ -0,0 +1,15 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run install
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE% --target install
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
cd $BUILD_DIR
cmake --build . --target package "${@:2}"
+15
View File
@@ -0,0 +1,15 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem Path to bin and project folder
set BIN_DIR_WITH_BACKSLASH=%~dp0%
set BIN_DIR=%BIN_DIR_WITH_BACKSLASH:~0,-1%
set PROJECT_DIR=%BIN_DIR%\..
rem Run common setup code
call "%BIN_DIR%\common\setup.bat" %*
if %ERRORLEVEL% neq 0 (exit /b 1)
rem Run install
cd "%BUILD_DIR%"
cmake --build . --config %BUILD_TYPE% --target package
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get directory of this file
PROJECT_DIR=$(dirname $BIN_DIR) # Get root directory of project
source $BIN_DIR/common/setup $1
if [ "$(uname -s)" == "Darwin" ]; then
# On Mac OS we should run executable from bundle
"$BUILD_DIR/src/robomongo/Robomongo.app/Contents/MacOS/Robomongo"
else
"$BUILD_DIR/src/robomongo/robomongo"
fi
-132
View File
@@ -1,132 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem Visual C++ directory
set VISUALC_DIR=%ProgramFiles%\Microsoft Visual Studio 10.0\VC
rem store current directory in order to return to it after
set ORIGINAL_DIR=%CD%
rem find project root folder
set PROJECT_ROOT=%CD%\..\
rem mode is a first arg
set MODE=%1
rem if mode wasnt specified - debug mode assumed
if %1. ==. (
set MODE=debug
)
rem if not 'debug' AND 'release' - print error message
if not %MODE% == debug (
if not %MODE% == release (
if not %MODE% == all (
echo.
echo Specified mode ^(%MODE%^) is unsupported.
goto FINALLY
)
)
)
if %MODE% == all (
%0 debug
%0 release
goto FINALLY
)
rem target folder where build will be placed
set TARGET=%PROJECT_ROOT%target\%MODE%
if %MODE% == debug (
set QMAKE_ARGS= -r -spec win32-msvc2010 "CONFIG+=debug" "CONFIG+=declarative_debug"
)
if %MODE% == release (
set QMAKE_ARGS= -r -spec win32-msvc2010 "CONFIG+=release"
)
echo Target folder: %TARGET%
echo Visual C folder: %VISUALC_DIR%
REM -----------------------------------
REM - Preparation
REM -----------------------------------
REM create target folder (if not already exists)
if not exist %TARGET% mkdir %TARGET%
if %ERRORLEVEL% neq 0 goto ERROR
REM go to target folder
cd %TARGET%
if %ERRORLEVEL% neq 0 goto ERROR
echo.
REM -----------------------------------
REM - QMake
REM -----------------------------------
REM run qmake
qmake %PROJECT_ROOT%src\robomongo\robomongo.pro %QMAKE_ARGS%
if %ERRORLEVEL% neq 0 (
echo.
echo Error when running qmake.
goto FINALLY
)
REM -----------------------------------
REM - Visual C nmake
REM -----------------------------------
REM configure Visual C shell environment
IF "!%VSINSTALLDIR%!" == "!!" (
echo Settings Visual C environment variables...
call "%VISUALC_DIR%\bin\vcvars32.bat"
if %ERRORLEVEL% neq 0 goto ERROR
) else (
echo Skipping Visual C environment setup ^(already configured^)
)
REM
nmake
if %ERRORLEVEL% neq 0 (
echo.
echo Error when running nmake.
goto FINALLY
)
goto DONE
REM -----------------------------------
REM - Errors report
REM -----------------------------------
:ERROR
echo.
echo Some error found.
goto FINALLY
REM -----------------------------------
REM - Success report
REM -----------------------------------
:DONE
echo.
echo Done without errors.
echo Executable location: %TARGET%
goto FINALLY
REM -----------------------------------
REM - Block that is always executed
REM -----------------------------------
:FINALLY
REM Return back to original folder
cd %ORIGINAL_DIR%
-84
View File
@@ -1,84 +0,0 @@
# ****************
# Configuration
# ****************
MODE=$1
if [ -z $MODE ]; then
MODE=debug
fi
if [[ $MODE != "release" ]] && [[ $MODE != "debug" ]] && [[ $MODE != "all" ]]; then
echo
echo -e "\e[00;31m Specified mode ($MODE) is unsupported.\e[00m"
echo
exit 1
fi
# add 'executable' bit to clean.sh and rebuild.sh if needed
if [ ! -x `pwd`/"clean.sh" ] ; then
chmod u+x clean.sh
chmod u+x rebuild.sh
fi
# if 'all' specified - build in debug and release mode
if [[ $MODE = "all" ]]; then
$0 debug
$0 release
exit 0
fi
PROJECT_ROOT=`pwd`/.. # Find project root
TARGET=${PROJECT_ROOT}/target/$MODE # Prepare output directory name
OUTPUT=${TARGET}/out # Prepare output directory name
if [[ $MODE = "debug" ]]; then
QMAKE_ARGS="-r -spec linux-g++ CONFIG+=debug CONFIG+=declarative_debug"
fi
if [[ $MODE = "release" ]]; then
QMAKE_ARGS="-r -spec linux-g++ CONFIG+=release"
fi
# ****************
# Preparation
# ****************
# Create target folder (if not already exists)
mkdir -p $TARGET
echo Output folder $TARGET
# Go to /target/debug folder
cd $TARGET
# ****************
# qmake
# ****************
qmake $PROJECT_ROOT/src/robomongo/robomongo.pro $QMAKE_ARGS
if [ $? != 0 ]; then
{
echo
echo -e "\e[00;31m Error when running qmake.\e[00m"
echo
exit 1
} fi
# ****************
# make
# ****************
make -w
if [ $? != 0 ]; then
{
echo
echo -e "\e[00;31m Error when running make.\e[00m"
echo
exit 1
} fi
echo
echo -e '\E[36m Done without errors \e[00m'
echo -e "\E[36m Executable location: ${OUTPUT} \e[00m"
echo
-65
View File
@@ -1,65 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem find project root folder
set PROJECT_ROOT=%CD%\..\
rem mode is a first arg
set MODE=%1
rem if mode wasnt specified - debug mode assumed
if %1. ==. (
set MODE=debug
)
rem if not 'debug' AND 'release' - print error message
if not %MODE% == debug (
if not %MODE% == release (
if not %MODE% == all (
echo.
echo Specified mode ^(%MODE%^) is unsupported.
exit /b 1
)
)
)
if %MODE% == all (
call %0 debug
call %0 release
goto EOF
)
rem target folder where build will be placed
set TARGET=%PROJECT_ROOT%target\%MODE%
if not exist %TARGET% (
echo.
echo Already clean: !TARGET!.
goto EOF
pause
)
rem remove target folder
rmdir /s /q %TARGET%
if %ERRORLEVEL% neq 0 (
echo.
echo Error when removing !TARGET!.
exit /b 1
pause
)
rem check that clean was successfull
if not exist %TARGET% (
echo.
echo Done without errors.
echo This folder removed: !TARGET!
) else (
echo.
echo Error when removing files. Not all files were removed.
)
:EOF
-54
View File
@@ -1,54 +0,0 @@
# ****************
# Configuration
# ****************
MODE=$1
if [ -z $MODE ]; then
MODE=debug
fi
if [[ $MODE != "release" ]] && [[ $MODE != "debug" ]] && [[ $MODE != "all" ]]; then
echo
echo -e "\e[00;31m Specified mode ($MODE) is unsupported.\e[00m"
echo
exit 1
fi
if [[ $MODE = "all" ]]; then
$0 debug
$0 release
exit 0
fi
PROJECT_ROOT=`pwd`/.. # Find project root
TARGET_ROOT=${PROJECT_ROOT}/target
TARGET=${PROJECT_ROOT}/target/$MODE # Prepare output directory name
if [ ! -d "$TARGET" ]; then
echo
echo -e "\E[36m Already clean: ${TARGET} \e[00m"
echo
exit 0
fi
cd $TARGET_ROOT
rm -rf -- $MODE
if [ $? != 0 ]; then
{
echo
echo -e "\e[00;31m Error when removing ${TARGET}.\e[00m"
echo
exit 1
} fi
if [ ! -d "$TARGET" ]; then
echo
echo -e '\E[36m Done without errors. \e[00m'
echo -e "\E[36m This folder removed: ${TARGET} \e[00m"
echo
else
echo
echo -e "\e[00;31m Error when removing files. Not all files were removed. \e[00m"
echo
fi
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
./robomongo
-28
View File
@@ -1,28 +0,0 @@
@echo off
setlocal enableextensions enabledelayedexpansion
rem -----------------------------------
rem - Configuration
rem -----------------------------------
rem mode is a first arg
set MODE=%1
rem if mode wasnt specified - debug mode assumed
if %1. ==. (
set MODE=debug
)
rem if not 'debug' AND 'release' - print error message
if not %MODE% == debug (
if not %MODE% == release (
if not %MODE% == all (
echo.
echo Specified mode ^(%MODE%^) is unsupported.
exit /b 1
)
)
)
call clean.bat %MODE%
call build.bat %MODE%
-20
View File
@@ -1,20 +0,0 @@
# ****************
# Configuration
# ****************
MODE=$1
if [ -z $MODE ]; then
MODE=debug
fi
if [[ $MODE != "release" ]] && [[ $MODE != "debug" ]] && [[ $MODE != "all" ]]; then
echo
echo -e "\e[00;31m Specified mode ($MODE) is unsupported.\e[00m"
echo
exit 1
fi
# clean and build
./clean.sh $MODE
./build.sh $MODE
+142
View File
@@ -0,0 +1,142 @@
#
# Find the MongoDB libraries
#
# This module defines the following variables:
# MongoDB_FOUND
# MongoDB_LIBS
# MongoDB_INCLUDE_DIRS
# MongoDB_DEFINITIONS
#
# Imported target "mongodb" is created
#
# We assume, that at least "mongo" target was build by the following command:
# $ scons mongo
#
#
# Try to find MongoDB directory (uses CMAKE_PREFIX_PATH locations)
find_path(
MongoDB_DIR src/mongo/config.h.in
DOC "Path to MongoDB (github.com/robomongo-shell) root directory"
)
# Find relative path to build directory
if(BUILD_RELEASE OR BUILD_RELWITHDEBINFO OR BUILD_MINSIZEREL)
set(MongoDB_RELATIVE_BUILD_DIR build/opt)
set(MongoDB_OBJECT_LIST_BUILD_TYPE_PART release)
elseif(BUILD_DEBUG)
set(MongoDB_RELATIVE_BUILD_DIR build/debug)
set(MongoDB_OBJECT_LIST_BUILD_TYPE_PART debug)
endif()
# Set absolute path to build directory
set(MongoDB_BUILD_DIR ${MongoDB_DIR}/${MongoDB_RELATIVE_BUILD_DIR})
# Set commong compiler definitons
set(MongoDB_DEFINITIONS
PCRE_STATIC
BOOST_THREAD_VERSION=4
BOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD
BOOST_THREAD_NO_DEPRECATED
BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
BOOST_THREAD_HAS_BUG
MONGO_CONFIG_HAVE_HEADER_UNISTD_H
)
# Set common compiler include directories
set(MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src
${MongoDB_DIR}/src/third_party/boost-1.56.0
${MongoDB_DIR}/src/third_party/mozjs-38/include
${MongoDB_DIR}/src/third_party/mozjs-38/mongo_sources
${MongoDB_DIR}/src/third_party/pcre-8.37
${MongoDB_BUILD_DIR}
)
if(SYSTEM_LINUX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART linux)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/linux/include)
elseif(SYSTEM_WINDOWS)
set(MongoDB_OBJECT_LIST_PLATFORM_PART windows)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/windows/include)
elseif(SYSTEM_MACOSX)
set(MongoDB_OBJECT_LIST_PLATFORM_PART macosx)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/osx/include)
elseif(SYSTEM_FREEBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART freebsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/freebsd/include)
elseif(SYSTEM_OPENBSD)
set(MongoDB_OBJECT_LIST_PLATFORM_PART openbsd)
list(APPEND MongoDB_INCLUDE_DIRS
${MongoDB_DIR}/src/third_party/mozjs-38/platform/x86_64/openbsd/include)
endif()
# Read list of object files
# See "mongodb/README.md" file (relative to the current folder) for more information.
file(READ
${CMAKE_CURRENT_LIST_DIR}/mongodb/${MongoDB_OBJECT_LIST_PLATFORM_PART}-${MongoDB_OBJECT_LIST_BUILD_TYPE_PART}.objects
MongoDB_RELATIVE_LIBS)
string(STRIP "${MongoDB_RELATIVE_LIBS}" MongoDB_RELATIVE_LIBS)
# Convert string to list
string(REPLACE " " ";" MongoDB_RELATIVE_LIBS ${MongoDB_RELATIVE_LIBS})
# Convert to absolute path
foreach(lib ${MongoDB_RELATIVE_LIBS})
list(APPEND MongoDB_LIBS ${MongoDB_DIR}/${lib})
endforeach()
# Get MongoDB repository recent tag
execute_process(
COMMAND git describe --abbrev=0 --tags
WORKING_DIRECTORY ${MongoDB_DIR}
OUTPUT_VARIABLE MongoDB_RECENT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Handle the QUIETLY and REQUIRED arguments and set ALSA_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MongoDB
FOUND_VAR MongoDB_FOUND # When using CMake 3.0 MONGODB_FOUND variable will be created.
# Make it explicit that variable name is MongoDB_FOUND.
REQUIRED_VARS MongoDB_DIR MongoDB_BUILD_DIR
VERSION_VAR MongoDB_RECENT_TAG
FAIL_MESSAGE "Could not find Robomongo Shell (MongoDB fork). Make sure that CMAKE_PREFIX_PATH points to Robomongo Shell project root.\n")
if(MongoDB_FOUND)
set(MongoDB_VERSION ${MongoDB_RECENT_TAG})
# Original MongoDB link command has the following in the end: m rt dl
set(MongoDB_LIBS
${LINK_WHOLE_ARCHIVE_START} # Linux: -Wl,--whole-archive
${LINK_LIBGROUP_START} # Linux: -Wl,--start-group
${MongoDB_LIBS}
${LINK_LIBGROUP_END} # Linux: -Wl,--end-group
${LINK_WHOLE_ARCHIVE_END} # Linux: -Wl,--no-whole-archive
${CMAKE_DL_LIBS} # Linux: dl
)
# Add imported target
add_library(mongodb INTERFACE IMPORTED)
# Specify INTERFACE properties for this target
set_target_properties(mongodb PROPERTIES
INTERFACE_LINK_LIBRARIES "${MongoDB_LIBS}"
INTERFACE_COMPILE_DEFINITIONS "${MongoDB_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${MongoDB_INCLUDE_DIRS}"
)
endif()
# Cleanup
unset(MongoDB_OBJECT_LIST_BUILD_TYPE_PART)
unset(MongoDB_OBJECT_LIST_PLATFORM_PART)
unset(MongoDB_RELATIVE_BUILD_DIR)
unset(MongoDB_RELATIVE_LIBS)
unset(MongoDB_RECENT_TAG)
+21
View File
@@ -0,0 +1,21 @@
# This wrapper is created in order to support CMake 3.0
# Only starting from CMake 3.1 "Threads" module exports
# "Threads::Threads" target.
find_package(Threads REQUIRED)
# Support for CMake 3.0
# Export "Threads::Threads" imported target if it wasn't exported.
# This lines are taken from the "FindThreads.cmake" of CMake 3.1:
# https://github.com/Kitware/CMake/blob/v3.1.0/Modules/FindThreads.cmake
if(THREADS_FOUND AND NOT TARGET Threads::Threads)
add_library(Threads::Threads INTERFACE IMPORTED)
if(THREADS_HAVE_PTHREAD_ARG)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
endif()
if(CMAKE_THREAD_LIBS_INIT)
set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
endif()
endif()
+20
View File
@@ -0,0 +1,20 @@
Quick reference to CMake
========================
if(<constant>)
True if the constant is `1`, `ON`, `YES`, `TRUE`, `Y`, or a non-zero number.
False if the constant is `0`, `OFF`, `NO`, `FALSE`, `N`, `IGNORE`, `NOTFOUND`,
the empty string, or ends in the suffix `-NOTFOUND`. Named boolean constants
are case-insensitive. If the argument is not one of these constants, it is
treated as a variable.
if(<variable>)
True if the variable is defined to a value that is not a false constant. False otherwise.
(Note macro arguments are not variables.)
if(DEFINED <variable>)
True if the given variable is defined. It does not matter if the variable is
true or false just if it has been set. (Note macro arguments are not variables.)
+32
View File
@@ -0,0 +1,32 @@
# Put the include dirs which are in the source or build tree
# before all other include dirs, so the headers in the sources
# are prefered over the already installed ones
# Since cmake 2.4.1
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
# Use colored output
# Since cmake 2.4.0
set(CMAKE_COLOR_MAKEFILE ON)
# MongoDB compiled with this option
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# This variable is used by CMake "FindThreads" module
# From documentation to FindThreads module:
# > Please note that the compiler flag can only be
# > used with the imported target. Use of both the imported
# > target as well as this switch is highly recommended for new code.
set(THREADS_PREFER_PTHREAD_FLAG ON)
# Set the default build type to release with debug info
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo
CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel and None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)"
FORCE)
endif()
# Do not use Qt moc, uic and rcc by default
# Since CMake 2.8.6
set(CMAKE_AUTOMOC OFF)
set(CMAKE_AUTORCC OFF)
set(CMAKE_AUTOUIC OFF)
+3
View File
@@ -0,0 +1,3 @@
set(ROBOMONGO_DISPLAY_NAME "Robomongo")
set(ROBOMONGO_DISPLAY_FULL_NAME "Robomongo ${PROJECT_VERSION}")
+30
View File
@@ -0,0 +1,30 @@
# Show configuration summary and build tip
message("")
message(" _______________[ Robomongo configuration summary ]________________")
message("| ")
message("|-- Dependencies:")
message("| ")
message("| Qt5 Core: ${Qt5Core_VERSION} ${Qt5Core_DIR}")
message("| Qt5 Gui: ${Qt5Gui_VERSION} ${Qt5Gui_DIR}")
message("| Qt5 Widgets: ${Qt5Widgets_VERSION} ${Qt5Widgets_DIR}")
message("| Qt5 PrintSupport: ${Qt5Widgets_VERSION} ${Qt5PrintSupport_DIR}")
message("| MongoDB: ${MongoDB_VERSION} ${MongoDB_BUILD_DIR}")
message("|")
message("|-- Summary:")
message("|")
message("| System: ${CMAKE_SYSTEM_NAME}")
if (SYSTEM_MACOSX)
message("| Target SDK: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
message("| Build type: ${CMAKE_BUILD_TYPE}")
message("| Install path: ${CMAKE_INSTALL_PREFIX}")
message("|")
message("|-- Building and installing:")
message("| ")
message("| Now you can build Robomongo with the following command:")
message("| $ cmake --build .")
message("|")
message("| And install it to ${CMAKE_INSTALL_PREFIX}:")
message("| $ cmake --build . --target install")
message("|__________________________________________________________________")
message("")
+66
View File
@@ -0,0 +1,66 @@
# This files defines:
#
# 1) Platform checks
#
# SYSTEM_MACOSX
# SYSTEM_WINDOWS
# SYSTEM_LINUX
# SYSTEM_FREEBSD
# SYSTEM_OPENBSD
# SYSTEM_NETBSD
#
# 2) Build types checks
#
# BUILD_DEBUG
# BUILD_RELEASE
# BUILD_RELWITHDEBINFO
# BUILD_MINSIZEREL
#
# 3) Link "lib groups" and "whole-archive" options
#
# LINK_LIBGROUP_START
# LINK_LIBGROUP_END
# LINK_WHOLE_ARCHIVE_START
# LINK_WHOLE_ARCHIVE_END
# Platform checks
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(SYSTEM_MACOSX TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(SYSTEM_WINDOWS TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SYSTEM_LINUX TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(SYSTEM_FREEBSD TRUE)
set(SYSTEM_BSD TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
set(SYSTEM_OPENBSD TRUE)
set(SYSTEM_BSD TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set(SYSTEM_NETBSD TRUE)
set(SYSTEM_BSD TRUE)
endif()
# Build types
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
set(BUILD_DEBUG TRUE)
elseif("${CMAKE_BUILD_TYPE}" MATCHES "Release")
set(BUILD_RELEASE TRUE)
elseif("${CMAKE_BUILD_TYPE}" MATCHES "RelWithDebInfo")
set(BUILD_RELWITHDEBINFO TRUE)
elseif("${CMAKE_BUILD_TYPE}" MATCHES "MinSizeRel")
set(BUILD_MINSIZEREL TRUE)
endif()
# Link "groups" and "whole-archive" options
if(SYSTEM_LINUX OR SYSTEM_FREEBSD OR SYSTEM_OPENBSD)
set(LINK_LIBGROUP_START -Wl,--start-group)
set(LINK_LIBGROUP_END -Wl,--end-group)
set(LINK_WHOLE_ARCHIVE_START -Wl,--whole-archive)
set(LINK_WHOLE_ARCHIVE_END -Wl,--no-whole-archive)
elseif(SYSTEM_MACOSX)
set(LINK_LIBGROUP_START "")
set(LINK_LIBGROUP_END "")
set(LINK_WHOLE_ARCHIVE_START -Wl,-all_load)
set(LINK_WHOLE_ARCHIVE_END -Wl,-noall_load)
endif()
+108
View File
@@ -0,0 +1,108 @@
# Note for maintainers
# --------------------
#
# Do not use absolute paths in DESTINATION arguments for install() command.
# Because the same install code will be executed again by CPack. And CPack will
# change internally CMAKE_INSTALL_PREFIX to point to some temporary folder
# for package content.
#
#
# Temporary change
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install"
CACHE STRING "Install path prefix, prepended onto install directories"
FORCE)
if(SYSTEM_LINUX)
set(bin_dir bin)
set(lib_dir lib)
set(resources_dir share)
set(license_dir .)
set(qt_plugins_dir ${lib_dir})
set(qt_conf_dir ${bin_dir})
set(qt_conf_plugins "../lib")
elseif(SYSTEM_MACOSX)
set(bundle_name Robomongo.app)
set(contents_path ${bundle_name}/Contents)
set(bin_dir ${contents_path}/MacOS)
set(lib_dir ${contents_path}/Frameworks)
set(resources_dir ${contents_path}/Resources)
set(license_dir ${resources_dir})
set(qt_plugins_dir ${contents_path}/PlugIns/Qt)
set(qt_conf_dir ${resources_dir})
set(qt_conf_plugins "PlugIns/Qt")
elseif(SYSTEM_WINDOWS)
set(bin_dir .)
set(lib_dir .)
set(resources_dir .)
set(license_dir .)
set(qt_plugins_dir ${lib_dir})
set(qt_conf_dir ${bin_dir})
set(qt_conf_plugins .)
endif()
# Generate qt.conf file
configure_file(
"${CMAKE_SOURCE_DIR}/install/qt.conf.in"
"${CMAKE_BINARY_DIR}/qt.conf")
# Install qt.conf file
install(
FILES "${CMAKE_BINARY_DIR}/qt.conf"
DESTINATION "${qt_conf_dir}")
# Install binary
install(
TARGETS robomongo
RUNTIME DESTINATION ${bin_dir}
BUNDLE DESTINATION .)
# Install license, copyright and changelogs files
install(
FILES
${CMAKE_SOURCE_DIR}/LICENSE
${CMAKE_SOURCE_DIR}/COPYRIGHT
${CMAKE_SOURCE_DIR}/CHANGELOG
${CMAKE_SOURCE_DIR}/DESCRIPTION
DESTINATION ${license_dir})
# Install common dependencies
install_qt_lib(Core Gui Widgets PrintSupport)
install_qt_plugins(QGifPlugin QICOPlugin)
install_icu_libs()
if(SYSTEM_LINUX)
install_qt_lib(XcbQpa DBus)
install_qt_plugins(
QGtk2ThemePlugin
QXcbIntegrationPlugin)
elseif(SYSTEM_MACOSX)
install_qt_lib(MacExtras DBus)
install_qt_plugins(
QCocoaIntegrationPlugin
QMinimalIntegrationPlugin
QOffscreenIntegrationPlugin)
# Install icon
install(
FILES "${CMAKE_SOURCE_DIR}/install/macosx/Robomongo.icns"
DESTINATION "${resources_dir}")
elseif(SYSTEM_WINDOWS)
install_qt_plugins(
QWindowsIntegrationPlugin
QMinimalIntegrationPlugin
QOffscreenIntegrationPlugin)
# Install runtime libraries:
# msvcp120.dll
# msvcr120.dll
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(InstallRequiredSystemLibraries)
endif()
+105
View File
@@ -0,0 +1,105 @@
function(install_qt_lib)
foreach(module ${ARGV})
set(target_name Qt5::${module})
set(module_name Qt5${module})
# Get full path to some known Qt library (i.e. /path/to/lib/libQt5Widgets.so.5.5.1)
get_target_property(target_path Qt5::Core LOCATION)
# Get folder path of library (i.e. /path/to/lib)
get_filename_component(qt_lib_dir ${target_path} DIRECTORY)
if (SYSTEM_LINUX)
# Not very good solution, but we simply take all files with *Qt5<module>* in names (including symlinks)
file(GLOB module_libs ${qt_lib_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${module_name}*)
# Install to "lib" folder
install(FILES ${module_libs}
DESTINATION ${lib_dir})
endif()
if(SYSTEM_MACOSX)
set(module_name Qt${module})
# On Mac OS we are still located in .framework folder,
# and we need to go one level up
get_filename_component(qt_lib_dir ${qt_lib_dir} DIRECTORY)
install(
DIRECTORY ${qt_lib_dir}/${module_name}.framework
DESTINATION ${lib_dir}
PATTERN "*_debug" EXCLUDE # Exclude debug libraries
PATTERN "Headers" EXCLUDE) # Exclude Headers folders
endif()
if (SYSTEM_WINDOWS)
# Install single DLL to lib directory
install(FILES ${qt_lib_dir}/${module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${lib_dir})
endif()
endforeach()
endfunction()
function(install_icu_libs)
# We are trying to get 'lib' folder of Qt installation.
# For this we take some known target (Qt5::Core in this case)
# and taking path to this library.
# Get full path to known library (i.e. /path/to/lib/libQt5Core.so.5.5.1)
get_target_property(target_path Qt5::Core LOCATION)
# Get absolute path to 'lib' folder (which is a parent folder of 'known' library)
get_filename_component(qt_lib_dir ${target_path} DIRECTORY)
# Not very good solution, but we simply take all files with *icu* in names (including symlinks)
file(GLOB icu_libs ${qt_lib_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}icu*)
# Install to "lib" folder
install(FILES ${icu_libs}
DESTINATION ${lib_dir})
endfunction()
# Installs Qt5 plugins. Uses value of global variable "qt_plugins_dir" as
# absolute path to where install plugins.
#
# You can find list of plugin names by examing this variable: Qt5<Module>_PLUGINS
# For example, Qt5Gui_PLUGINS.
#
# Debug plugins, running application in this way:
# QT_DEBUG_PLUGINS=1 ./yourapp
#
# Some examples of plugin names:
# QGifPlugin, QGtk2ThemePlugin, QIbusPlatformInputContextPlugin
#
# Sample:
# install_qt_plugins(QGifPlugin QGtk2ThemePlugin QIbusPlatformInputContextPlugin)
#
function(install_qt_plugins)
foreach(name ${ARGV})
set(target_name Qt5::${name})
# We are trying to get 'plugins' folder of Qt installation.
# Get full path to plugin library (i.e. /path/to/plugins/imageformats/libqgif.so)
get_target_property(target_path ${target_name} LOCATION)
# Get absolute path to parent folder (i.e. /path/to/plugins/imageformats for Qt5::QGifPlugin)
get_filename_component(plugin_dir ${target_path} DIRECTORY)
# Get plugin parent directory (i.e. "imageformats" for Qt5::QGifPlugin)
get_filename_component(plugin_dir_name ${plugin_dir} NAME)
# Get plugin file name (i.e. "libqgif.so" for Qt5::QGifPlugin)
get_filename_component(plugin_file_name ${target_path} NAME)
# Get absolute path to plugins folder (i.e. /path/to/plugins)
get_filename_component(plugins_dir ${plugin_dir} DIRECTORY)
# Install to "lib" folder
install(
FILES ${target_path}
DESTINATION ${qt_plugins_dir}/${plugin_dir_name})
endforeach()
endfunction()
+120
View File
@@ -0,0 +1,120 @@
# Notes for maintainers.
#
# 1. Make sure that we use only lowercase letters in file name of outputed
# package for all platforms and package types.
#
# Get last commit hash
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE git_hash
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Timestamp (not used for now)
string(TIMESTAMP timestamp "%Y-%m-%d")
# Package name (as it should appear in UI)
set(CPACK_PACKAGE_NAME Robomongo)
# Version of the package
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
# Where to put generated package
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/package)
# Disables the component-based install process for installers
# that support it (NSIS, for instance)
set(CPACK_MONOLITHIC_INSTALL ON)
# Strip debug information on platforms that support it
set(CPACK_STRIP_FILES ON)
# Additional information
set(CPACK_PACKAGE_VENDOR Paralect)
set(CPACK_PACKAGE_CONTACT robomongo@paralect.com)
set(CPACK_PACKAGE_DESCRIPTION "Shell-centric cross-platform MongoDB management tool.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Robomongo is a shell-centric cross-platform MongoDB management tool.")
# Use lowercase for system name and package file name
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
string(TOLOWER ${CPACK_PACKAGE_NAME} package_file_name)
string(TOLOWER ${CPACK_PACKAGE_VERSION} package_file_version)
# We use function from TargetArch.cmake module
# Returns string with target architecture value
# Output for common architectures is: i386 or x86_64
target_architecture(target_arch)
# Package file name
set(CPACK_PACKAGE_FILE_NAME ${package_file_name}-${package_file_version}-${system_name}-${target_arch}-${git_hash})
if(SYSTEM_LINUX)
set(CPACK_GENERATOR TGZ)
elseif(SYSTEM_MACOSX)
set(CPACK_GENERATOR DragNDrop)
set(CPACK_DMG_DS_STORE ${CMAKE_SOURCE_DIR}/install/macosx/DMG_DS_Store)
elseif(SYSTEM_WINDOWS)
set(files_dir "${CMAKE_SOURCE_DIR}/install/windows")
set(exe_name "Robomongo.exe")
set(CPACK_GENERATOR NSIS ZIP)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/DESCRIPTION")
# License file will be shown in the installation wizard
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
# Default installation directory (not full path), just the path after
# default "c:\Program Files"
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${ROBOMONGO_DISPLAY_FULL_NAME}")
# A path to the executable inside installed package that contains icon
# This icon is used in Windows "Add or remove programs" control panel
set(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\${exe_name}")
# Create shortcuts on desktop and start-up menu
set(CPACK_NSIS_CREATE_ICONS_EXTRA "
CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk' '$INSTDIR\\\\${exe_name}'
CreateShortCut '$DESKTOP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk' '$INSTDIR\\\\${exe_name}'
")
# Cleanup during uninstallation. This cleanup is required because shortcuts
# will not be deleted automatically.
# Without line '!insertmacro...' shortcut in start menu will not be removed
# (i.e. it doesn't work when we referece '$STARTMENU_FOLDER' that is used
# when creating shortcuts). This solution was found somewhere in internet.
set(CPACK_NSIS_DELETE_ICONS_EXTRA "
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete '$DESKTOP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk'
Delete '$SMPROGRAMS\\\\$MUI_TEMP\\\\${ROBOMONGO_DISPLAY_FULL_NAME}.lnk'
")
# The title displayed at the top of the installer
set(CPACK_NSIS_PACKAGE_NAME "${ROBOMONGO_DISPLAY_FULL_NAME}")
# Installer images (for sidebar and topbar)
set(CPACK_PACKAGE_ICON "${files_dir}\\\\nsis-topbar.bmp")
set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "!define MUI_WELCOMEFINISHPAGE_BITMAP \\\"${files_dir}\\\\nsis-sidebar.bmp\\\"")
# URL to a web site providing more information about application
# This url was noticed at least in "Add or remove programs" control
# panel.
set(CPACK_NSIS_URL_INFO_ABOUT "www.robomongo.org")
# Specify an executable to add an option to run on the finish
# page of the NSIS installer. Without "..\\\\" it dowsn't work for NSIS 2.5
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "..\\\\${exe_name}")
# Trying to set for installer and uninstaller, but this is
# doesn't work and default icons are still used...
set(CPACK_NSIS_MUI_ICON "${files_dir}\\\\robomongo.ico")
set(CPACK_NSIS_MUI_UNIICON "${files_dir}\\\\robomongo.ico")
endif()
include(CPack)
+123
View File
@@ -0,0 +1,123 @@
###
# Prints CMake variables.
#
# Print all variables in the current scope:
#
# print_vars()
# print_vars("") # the same result, as previous line
#
# Print all variables with names, matching regex, case insensitive:
#
# print_vars("SOMEVAR")
# print_vars("someVar") # the same result, as previous line
# print_vars("^CMAKE") # print all variables, that starts from "CMAKE"
# print_vars("VAR$") # ends by "VAR"
# print_vars("^VAR$") # exact match
#
function(print_vars)
if(ARGV0)
set(regex ${ARGV0})
endif()
get_cmake_property(names VARIABLES)
foreach(name ${names})
# Make lowercase variants for case-insensitive comparing
string(TOLOWER "${name}" lc_name)
string(TOLOWER "${regex}" lc_regex)
if(lc_name MATCHES "${lc_regex}")
message("${name}=${${name}}")
endif()
endforeach()
endfunction()
###
# Print content of variable.
#
# print_var(PROJECT_NAME)
# print_var("PROJECT_NAME") # the same result as previous line
#
function(print_var name)
# Show nice output for not defined or empty variables
if(NOT DEFINED ${name})
set(value " is not defined.")
elseif("${${name}}" STREQUAL "")
set(value " is defined but empty.")
else()
set(value "=${${name}}")
endif()
message("${name}${value}")
endfunction()
###
# Prints included directories
#
function(print_include_dirs)
get_property(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message("${dir}")
endforeach()
endfunction()
###
# Prints link directories
#
function(print_link_dirs)
get_property(dirs DIRECTORY PROPERTY LINK_DIRECTORIES)
foreach(dir ${dirs})
message("${dir}")
endforeach()
endfunction()
###
# Prints compile definitions
#
function(print_compile_definitions)
get_property(defs DIRECTORY PROPERTY COMPILE_DEFINITIONS)
foreach(def ${defs})
message("${def}")
endforeach()
endfunction()
###
# Prints target include directories
#
function(print_target_include_dirs target)
get_property(dirs TARGET ${target} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message("${dir}")
endforeach()
endfunction()
###
# Prints target compile definitions
#
function(print_target_compile_definitions target)
get_property(defs TARGET ${target} PROPERTY INTERFACE_COMPILE_DEFINITIONS)
foreach(def ${defs})
message("${def}")
endforeach()
endfunction()
###
# Prints target link libraries
#
function(print_target_link_libraries target)
get_property(defs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES)
foreach(def ${defs})
message("${def}")
endforeach()
endfunction()
###
# Prints Qt5 module plugins
#
function(print_qt_module_plugins module)
foreach(plugin ${Qt5${module}_PLUGINS})
get_target_property(loc ${plugin} LOCATION)
message("Plugin ${plugin} is at location ${loc}")
endforeach()
endfunction()
+154
View File
@@ -0,0 +1,154 @@
# Copyright (c) 2012 Petroules Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# Based on the Qt 5 processor detection code, so should be very accurate
# https://qt.gitorious.org/qt/qtbase/blobs/master/src/corelib/global/qprocessordetection.h
# Currently handles arm (v5, v6, v7), x86 (32/64), ia64, and ppc (32/64)
# Regarding POWER/PowerPC, just as is noted in the Qt source,
# "There are many more known variants/revisions that we do not handle/detect."
set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#if defined(__ARM_ARCH_7__) \\
|| defined(__ARM_ARCH_7A__) \\
|| defined(__ARM_ARCH_7R__) \\
|| defined(__ARM_ARCH_7M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
#error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__) \\
|| defined(__ARM_ARCH_6J__) \\
|| defined(__ARM_ARCH_6T2__) \\
|| defined(__ARM_ARCH_6Z__) \\
|| defined(__ARM_ARCH_6K__) \\
|| defined(__ARM_ARCH_6ZK__) \\
|| defined(__ARM_ARCH_6M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
#error cmake_ARCH armv5
#else
#error cmake_ARCH arm
#endif
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error cmake_ARCH ppc64
#else
#error cmake_ARCH ppc
#endif
#endif
#error cmake_ARCH unknown
")
# Set ppc_support to TRUE before including this file or ppc and ppc64
# will be treated as invalid architectures since they are no longer supported by Apple
function(target_architecture output_var)
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
# First let's normalize the order of the values
# Note that it's not possible to compile PowerPC applications if you are using
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
# disable it by default
# See this page for more information:
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
set(osx_arch_ppc TRUE)
elseif("${osx_arch}" STREQUAL "i386")
set(osx_arch_i386 TRUE)
elseif("${osx_arch}" STREQUAL "x86_64")
set(osx_arch_x86_64 TRUE)
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
set(osx_arch_ppc64 TRUE)
else()
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
endif()
endforeach()
# Now add all the architectures in our normalized order
if(osx_arch_ppc)
list(APPEND ARCH ppc)
endif()
if(osx_arch_i386)
list(APPEND ARCH i386)
endif()
if(osx_arch_x86_64)
list(APPEND ARCH x86_64)
endif()
if(osx_arch_ppc64)
list(APPEND ARCH ppc64)
endif()
else()
file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")
enable_language(C)
# Detect the architecture in a rather creative way...
# This compiles a small C program which is a series of ifdefs that selects a
# particular #error preprocessor directive whose message string contains the
# target architecture. The program will always fail to compile (both because
# file is not a valid C program, and obviously because of the presence of the
# #error preprocessor directives... but by exploiting the preprocessor in this
# way, we can detect the correct target architecture even when cross-compiling,
# since the program itself never needs to be run (only the compiler/preprocessor)
try_run(
run_result_unused
compile_result_unused
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/arch.c"
COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
# Parse the architecture name from the compiler output
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
# Get rid of the value marker leaving just the architecture name
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
# If we are compiling with an unknown architecture this variable should
# already be set to "unknown" but in the case that it's empty (i.e. due
# to a typo in the code), then set it to unknown
if (NOT ARCH)
set(ARCH unknown)
endif()
endif()
set(${output_var} "${ARCH}" PARENT_SCOPE)
endfunction()
+26
View File
@@ -0,0 +1,26 @@
if(SYSTEM_LINUX OR SYSTEM_MACOSX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
elseif(SYSTEM_WINDOWS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_NO_LIB")
# Do not show some warnings. We turned off the same warnings as MongoDB do
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4355 /wd4800 /wd4267 /wd4244 /wd4290 /wd4068 /wd4351")
# The /MP option can reduce the total time to compile the source files. This option
# causes the compiler to create one or more copies of itself, each in a separate process.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib bcrypt.lib Iphlpapi.lib dbghelp.lib ws2_32.lib winmm.lib version.lib")
endif()
set(PROJECT_NAME "Robomongo")
set(PROJECT_NAME_TITLE ${PROJECT_NAME})
set(PROJECT_DOMAIN "www.robomongo.org")
set(PROJECT_COMPANYNAME "Paralect")
set(PROJECT_COPYRIGHT "Copyright (C) 2013-2015 ${PROJECT_COMPANYNAME} All Rights Reserved.")
set(PROJECT_COMPANYNAME_DOMAIN "www.paralect.com")
set(PROJECT_GITHUB_FORK "www.github.com/paralect/robomongo")
set(PROJECT_GITHUB_ISSUES "www.github.com/paralect/robomongo/issues")
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWERCASE)
+55
View File
@@ -0,0 +1,55 @@
What is this?
-------------
Files in this folder are read by FindMongoDB.cmake script.
We link with MongoDB shell using objects instead of static libs, because:
> We require the use of the 'object' mode for release builds because it is the only linking
> model that works across all of our platforms. We would like to ensure that all of our
> released artifacts are built with the same known-good-everywhere model.
This is a quote from root SConstruct file in MongoDB repository.
It is possible to build MongoDB shell in the following way:
$ scons mongo --link-model=static
Than we will have produced static libs that we can link with. But in release mode MongoDB
SConstruct file do not support static link mode by default. This command will *not* work:
$ scons mongo --release --link-model=static
We decided to use object link mode even for debug builds, in order to use single mode across
all platforms and configurations.
How did you receive content for this files?
-------------------------------------------
First we build MongoDB shell with the following command:
$ scons mongo -j8 --release
Than we remove compiled `mongo` and run the same command again to see only final link command:
$ rm build/opt/mongo/mongo
$ scons mongo -j8 --release > release-link-command.txt
And finally we manually copy/paste list of objects to `<platform>-release.objects` file. Make sure
that they are single-line files.
Almost the same steps we are doing for debug builds:
$ scons mongo -j8 --dbg
$ rm build/debug/mongo/mongo
$ scons mongo -j8 --dbg > debug-link-command.txt
And list of objects is copied to `<platform>-debug.objects` file.
We found, that on Linux (Ubuntu 14.10), list of debug objects differ from list of release objects only
by two files. File `debugallocation.o` is linked in debug mode, but not in release.
File `debugallocation.o` is linked in release mode, but not in debug. Both are located
in `third_party/gperftools-2.2/src` folder. In any way, we keep separate lists of object files
for both configurations. Still we need to test that objects are the same even across different
versions of Linux.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+50
View File
@@ -0,0 +1,50 @@
Building Robomongo Shell
========================
Robomongo uses [modified version](https://github.com/paralect/robomongo-shell/tree/roboshell-v3.2) of MongoDB that we call Robomongo Shell. Before you can build Robomongo, you have to build Robomongo Shell. The following instructions are applicable only for Mac OS X and Linux. For Windows instructions please check [Building Robomongo on Windows](BuildingRobomongoOnWindows.md).
Build for Mac OS X or Linux
---------------------------
1. Clone Robomongo Shell and checkout to `roboshell-v3.2` branch:
```sh
$ git clone https://github.com/paralect/robomongo-shell.git
$ cd robomongo-shell
$ git checkout roboshell-v3.2
```
2. Build Robomongo Shell:
```sh
$ bin/build
```
Done! Now you can continue with [Step 2](BuildingRobomongo.md#step-2) and build Robomongo
with embedded MongoDB 3.2 shell (that you've just built).
<br/>
#### Advanced helper commands
The following commands are needed only if you are planning to develop or deeper understand
Robomongo or Robomongo Shell build processes.
Clean build files for release mode (folder `build/opt` will be removed):
$ bin/clean
Here is a command that is executed by `bin/build` script:
$ scons mongo -j8 --release --osx-version-min=10.9
Argument `--osx-version-min` is required only for Mac OS.
Build MongoDB shell in debug mode:
$ scons mongo -j8 --dbg
Clear builds:
$ scons -c mongo # clears release build
$ scons -c --dbg mongo # clears debug build
+52
View File
@@ -0,0 +1,52 @@
Building Robomongo
==================
#### Step 1.
Download and build Robomongo Shell (our fork of MongoDB).
Refer to [Building Robomongo Shell](BuildingMongoDB.md) document.
#### Step 2.
Download Robomongo:
$ git clone https://github.com/paralect/robomongo
$ cd robomongo
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to a set of
directories:
1. Location of Qt 5 SDK
2. Location of Robomongo Shell (built in "Step 1")
Separate directories by semicolon `;` (not colon):
$ export ROBOMONGO_CMAKE_PREFIX_PATH="/path/to/qt-5.5/5.5/clang_64;/path/to/robomongo-shell"
Run configuration step:
$ bin/configure
And finally, build Robomongo:
$ bin/build
<br>
## Helper commands
Execute just built Robomongo:
$ bin/run
Clean build files (in order to start build from scratch):
$ bin/clean
Install Robomongo to `build/release/install` folder:
$ bin/install
Create package for your OS in `build/release/package` folder:
$ bin/pack
+132
View File
@@ -0,0 +1,132 @@
Building Robomongo for Windows
==============================
Prerequisites
-------------
#### 0. Git
Download Git installer from http://git-scm.com (we are using Git-2.7.0-64-bit).
When you'll see "Adjusting your PATH environment" wizard page, select
"Use Git from the Windows Command Prompt" option. This will allow to
execute Git from both Windows Command Prompt and Bash. This is required,
because both MongoDB and Robomongo uses `git` command during build process
which must be perfomed from Windows Command Prompt (not Bash).
On "Configuring the line ending conversion" wizard page, select "Checkout
Windows-style, commit Unix-style line ending" option. This is a common mode
for cross-platform projects and required by both MongoDB and Robomongo.
All other Git installer options are not important (use defaults).
If you are using SSH clone url, start SSH agent and add your private key
with this commands in Git Bash:
$ eval `ssh-agent` # starts ssh agent
$ ssh-add ~/.ssh/mykey # add your key (which can be in any folder)
#### 1. Visual Studio 2013 (i.e. MSVC12) Update 4 or newer
We use Visual Studio 2013 Update 5, and recommend to use this version to save
time for Qt compilation. Currently prebuilt binaries for Qt are available
from official Qt site. But you can use any newer version and compile Qt library
yourself.
If you already have VS2013, you can download Update 5 here:
https://www.microsoft.com/en-us/download/details.aspx?id=48129
Update 4 or newer version is required to compile MongoDB.
#### 2. ActivePython 2.7
Download ActivePython from http://www.activestate.com/activepython/downloads
Download MSI x64 version. Use default settings in installation wizard.
This installer will add path to `python.exe` to your `PATH` variable.
#### 3. Scons 2.3.4
Download Scons from http://scons.org/tag/releases.html
Use ZIP archive, not MSI (we use scons-2.3.4.zip)
Open Command Prompt, navigate to Scons directory and run:
$ setup.py install
This command will make `scons` command accessible from Command Prompt
#### 4. CMake
Download CMake from https://cmake.org/download (we use cmake-3.3.2-win32-x86.exe)
Use installer package, it will allow you to configure your PATH variable and `cmake`
command will be available from Command Prompt. For this set "Add CMake to the system
PATH for current user" in the installer wizard page.
#### 5. Qt 5.5
Download Qt from http://www.qt.io/download-open-source/ (we use Qt Online installer)
When installing Qt, only one component is required by Robomongo:
Qt 5.5
[x] msvc2013 64-bit.
This components contains prebuilt 64-bit binaries for Visual Studio 2013.
You may uncheck all other components to download as little as possible.
## Build Robomongo Shell (fork of MongoDB)
Refer to MongoDB documentation for additional information:
https://docs.mongodb.org/manual/contributors/tutorial/build-mongodb-from-source/#windows-specific-instructions
Open VS2013 x64 Native Tools Command Prompt and navigate to `robomongo-shell` folder.
Build shell:
> bin\build
Note that backslash is used (`\`), and not forward slash (`/`).
Clean build files:
> bin\clean
## Build Robomongo
Set special environment variable `ROBOMONGO_CMAKE_PREFIX_PATH` to point to set of
directories:
1. Location of Qt SDK
2. Location of Robomongo Shell
Separate directories by semicolon `;` (not colon). You can do this in Command Prompt:
> setx ROBOMONGO_CMAKE_PREFIX_PATH "d:\Qt-5\5.5\msvc2013_64;d:\Projects\robomongo-shell"
Reopen your Command Prompt to make this variable available.
Run configuration step:
> bin\configure
And finally, build Robomongo:
> bin\build
#### Helper commands
Clean build files (in order to start build from scratch):
> bin\clean
Install Robomongo to `build\Release\install` folder:
> bin\install
+49
View File
@@ -0,0 +1,49 @@
Runtime Dependencies
====================
This information is for maintainers. If you want to just use Robomongo - download
prebuild packages for your platform.
Runtime dependencies that are not privided by platforms but required by Robomongo are:
1. Qt libraries
2. Qt plugins
Diagnostic of dependencies
--------------------------
##### Linux
View dependencies of executable or shared library:
$ ldd robomongo
View RPATH or RUNPATH records of executable or shared library:
$ objdump -x bin/robomongo | grep "RPATH\|RUNPATH"
For Robomongo binary it should be `$ORIGIN/../lib`
##### Mac OS X
Show dependencies of executable or shared library:
$ otool -L robomongo
View LC_RPATH records of executable or shared library:
$ otool -l robomongo | grep -C2 RPATH
(option `-C2` asks grep to output 2 context lines before and after the match)
For Robomongo binary it should be `$executable_path/../Frameworks`
Diagnostic of Qt plugins
------------------------
Run Robomongo in the following way to see how plugins are resolved:
$ QT_DEBUG_PLUGINS=1 ./robomongo
-31
View File
@@ -1,31 +0,0 @@
// Boost string_algo library string_algo.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2004.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_ALGO_HPP
#define BOOST_STRING_ALGO_HPP
/*! \file
Cumulative include for string_algo library
*/
#include <boost/algorithm/string/std_containers_traits.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/find.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/find_iterator.hpp>
#endif // BOOST_STRING_ALGO_HPP
@@ -1,176 +0,0 @@
// Boost string_algo library case_conv.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CASE_CONV_HPP
#define BOOST_STRING_CASE_CONV_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <locale>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/value_type.hpp>
#include <boost/algorithm/string/detail/case_conv.hpp>
/*! \file
Defines sequence case-conversion algorithms.
Algorithms convert each element in the input sequence to the
desired case using provided locales.
*/
namespace boost {
namespace algorithm {
// to_lower -----------------------------------------------//
//! Convert to lower case
/*!
Each element of the input sequence is converted to lower
case. The result is a copy of the input converted to lower case.
It is returned as a sequence or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input range
\param Loc A locale used for conversion
\return
An output iterator pointing just after the last inserted character or
a copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT>
inline OutputIteratorT
to_lower_copy(
OutputIteratorT Output,
const RangeT& Input,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::detail::transform_range_copy(
Output,
::boost::as_literal(Input),
::boost::algorithm::detail::to_lowerF<
typename range_value<RangeT>::type >(Loc));
}
//! Convert to lower case
/*!
\overload
*/
template<typename SequenceT>
inline SequenceT to_lower_copy(
const SequenceT& Input,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::detail::transform_range_copy<SequenceT>(
Input,
::boost::algorithm::detail::to_lowerF<
typename range_value<SequenceT>::type >(Loc));
}
//! Convert to lower case
/*!
Each element of the input sequence is converted to lower
case. The input sequence is modified in-place.
\param Input A range
\param Loc a locale used for conversion
*/
template<typename WritableRangeT>
inline void to_lower(
WritableRangeT& Input,
const std::locale& Loc=std::locale())
{
::boost::algorithm::detail::transform_range(
::boost::as_literal(Input),
::boost::algorithm::detail::to_lowerF<
typename range_value<WritableRangeT>::type >(Loc));
}
// to_upper -----------------------------------------------//
//! Convert to upper case
/*!
Each element of the input sequence is converted to upper
case. The result is a copy of the input converted to upper case.
It is returned as a sequence or copied to the output iterator
\param Output An output iterator to which the result will be copied
\param Input An input range
\param Loc A locale used for conversion
\return
An output iterator pointing just after the last inserted character or
a copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT>
inline OutputIteratorT
to_upper_copy(
OutputIteratorT Output,
const RangeT& Input,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::detail::transform_range_copy(
Output,
::boost::as_literal(Input),
::boost::algorithm::detail::to_upperF<
typename range_value<RangeT>::type >(Loc));
}
//! Convert to upper case
/*!
\overload
*/
template<typename SequenceT>
inline SequenceT to_upper_copy(
const SequenceT& Input,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::detail::transform_range_copy<SequenceT>(
Input,
::boost::algorithm::detail::to_upperF<
typename range_value<SequenceT>::type >(Loc));
}
//! Convert to upper case
/*!
Each element of the input sequence is converted to upper
case. The input sequence is modified in-place.
\param Input An input range
\param Loc a locale used for conversion
*/
template<typename WritableRangeT>
inline void to_upper(
WritableRangeT& Input,
const std::locale& Loc=std::locale())
{
::boost::algorithm::detail::transform_range(
::boost::as_literal(Input),
::boost::algorithm::detail::to_upperF<
typename range_value<WritableRangeT>::type >(Loc));
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::to_lower;
using algorithm::to_lower_copy;
using algorithm::to_upper;
using algorithm::to_upper_copy;
} // namespace boost
#endif // BOOST_STRING_CASE_CONV_HPP
@@ -1,312 +0,0 @@
// Boost string_algo library classification.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CLASSIFICATION_HPP
#define BOOST_STRING_CLASSIFICATION_HPP
#include <algorithm>
#include <locale>
#include <boost/range/value_type.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/detail/classification.hpp>
#include <boost/algorithm/string/predicate_facade.hpp>
/*! \file
Classification predicates are included in the library to give
some more convenience when using algorithms like \c trim() and \c all().
They wrap functionality of STL classification functions ( e.g. \c std::isspace() )
into generic functors.
*/
namespace boost {
namespace algorithm {
// classification functor generator -------------------------------------//
//! is_classified predicate
/*!
Construct the \c is_classified predicate. This predicate holds if the input is
of specified \c std::ctype category.
\param Type A \c std::ctype category
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_classified(std::ctype_base::mask Type, const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(Type, Loc);
}
//! is_space predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::space category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_space(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::space, Loc);
}
//! is_alnum predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::alnum category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_alnum(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::alnum, Loc);
}
//! is_alpha predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::alpha category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_alpha(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::alpha, Loc);
}
//! is_cntrl predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::cntrl category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_cntrl(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::cntrl, Loc);
}
//! is_digit predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::digit category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_digit(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::digit, Loc);
}
//! is_graph predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::graph category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_graph(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::graph, Loc);
}
//! is_lower predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::lower category.
\param Loc A locale used for classification
\return An instance of \c is_classified predicate
*/
inline detail::is_classifiedF
is_lower(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::lower, Loc);
}
//! is_print predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::print category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_print(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::print, Loc);
}
//! is_punct predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::punct category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_punct(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::punct, Loc);
}
//! is_upper predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::upper category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_upper(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::upper, Loc);
}
//! is_xdigit predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::xdigit category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
*/
inline detail::is_classifiedF
is_xdigit(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::xdigit, Loc);
}
//! is_any_of predicate
/*!
Construct the \c is_any_of predicate. The predicate holds if the input
is included in the specified set of characters.
\param Set A set of characters to be recognized
\return An instance of the \c is_any_of predicate
*/
template<typename RangeT>
inline detail::is_any_ofF<
BOOST_STRING_TYPENAME range_value<RangeT>::type>
is_any_of( const RangeT& Set )
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_set(boost::as_literal(Set));
return detail::is_any_ofF<BOOST_STRING_TYPENAME range_value<RangeT>::type>(lit_set);
}
//! is_from_range predicate
/*!
Construct the \c is_from_range predicate. The predicate holds if the input
is included in the specified range. (i.e. From <= Ch <= To )
\param From The start of the range
\param To The end of the range
\return An instance of the \c is_from_range predicate
*/
template<typename CharT>
inline detail::is_from_rangeF<CharT> is_from_range(CharT From, CharT To)
{
return detail::is_from_rangeF<CharT>(From,To);
}
// predicate combinators ---------------------------------------------------//
//! predicate 'and' composition predicate
/*!
Construct the \c class_and predicate. This predicate can be used
to logically combine two classification predicates. \c class_and holds,
if both predicates return true.
\param Pred1 The first predicate
\param Pred2 The second predicate
\return An instance of the \c class_and predicate
*/
template<typename Pred1T, typename Pred2T>
inline detail::pred_andF<Pred1T, Pred2T>
operator&&(
const predicate_facade<Pred1T>& Pred1,
const predicate_facade<Pred2T>& Pred2 )
{
// Doing the static_cast with the pointer instead of the reference
// is a workaround for some compilers which have problems with
// static_cast's of template references, i.e. CW8. /grafik/
return detail::pred_andF<Pred1T,Pred2T>(
*static_cast<const Pred1T*>(&Pred1),
*static_cast<const Pred2T*>(&Pred2) );
}
//! predicate 'or' composition predicate
/*!
Construct the \c class_or predicate. This predicate can be used
to logically combine two classification predicates. \c class_or holds,
if one of the predicates return true.
\param Pred1 The first predicate
\param Pred2 The second predicate
\return An instance of the \c class_or predicate
*/
template<typename Pred1T, typename Pred2T>
inline detail::pred_orF<Pred1T, Pred2T>
operator||(
const predicate_facade<Pred1T>& Pred1,
const predicate_facade<Pred2T>& Pred2 )
{
// Doing the static_cast with the pointer instead of the reference
// is a workaround for some compilers which have problems with
// static_cast's of template references, i.e. CW8. /grafik/
return detail::pred_orF<Pred1T,Pred2T>(
*static_cast<const Pred1T*>(&Pred1),
*static_cast<const Pred2T*>(&Pred2));
}
//! predicate negation operator
/*!
Construct the \c class_not predicate. This predicate represents a negation.
\c class_or holds if of the predicates return false.
\param Pred The predicate to be negated
\return An instance of the \c class_not predicate
*/
template<typename PredT>
inline detail::pred_notF<PredT>
operator!( const predicate_facade<PredT>& Pred )
{
// Doing the static_cast with the pointer instead of the reference
// is a workaround for some compilers which have problems with
// static_cast's of template references, i.e. CW8. /grafik/
return detail::pred_notF<PredT>(*static_cast<const PredT*>(&Pred));
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::is_classified;
using algorithm::is_space;
using algorithm::is_alnum;
using algorithm::is_alpha;
using algorithm::is_cntrl;
using algorithm::is_digit;
using algorithm::is_graph;
using algorithm::is_lower;
using algorithm::is_upper;
using algorithm::is_print;
using algorithm::is_punct;
using algorithm::is_xdigit;
using algorithm::is_any_of;
using algorithm::is_from_range;
} // namespace boost
#endif // BOOST_STRING_PREDICATE_HPP
@@ -1,199 +0,0 @@
// Boost string_algo library compare.hpp header file -------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_COMPARE_HPP
#define BOOST_STRING_COMPARE_HPP
#include <boost/algorithm/string/config.hpp>
#include <locale>
/*! \file
Defines element comparison predicates. Many algorithms in this library can
take an additional argument with a predicate used to compare elements.
This makes it possible, for instance, to have case insensitive versions
of the algorithms.
*/
namespace boost {
namespace algorithm {
// is_equal functor -----------------------------------------------//
//! is_equal functor
/*!
Standard STL equal_to only handle comparison between arguments
of the same type. This is a less restrictive version which wraps operator ==.
*/
struct is_equal
{
//! Function operator
/*!
Compare two operands for equality
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
return Arg1==Arg2;
}
};
//! case insensitive version of is_equal
/*!
Case insensitive comparison predicate. Comparison is done using
specified locales.
*/
struct is_iequal
{
//! Constructor
/*!
\param Loc locales used for comparison
*/
is_iequal( const std::locale& Loc=std::locale() ) :
m_Loc( Loc ) {}
//! Function operator
/*!
Compare two operands. Case is ignored.
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)==std::toupper(Arg2);
#else
return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);
#endif
}
private:
std::locale m_Loc;
};
// is_less functor -----------------------------------------------//
//! is_less functor
/*!
Convenient version of standard std::less. Operation is templated, therefore it is
not required to specify the exact types upon the construction
*/
struct is_less
{
//! Functor operation
/*!
Compare two operands using > operator
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
return Arg1<Arg2;
}
};
//! case insensitive version of is_less
/*!
Case insensitive comparison predicate. Comparison is done using
specified locales.
*/
struct is_iless
{
//! Constructor
/*!
\param Loc locales used for comparison
*/
is_iless( const std::locale& Loc=std::locale() ) :
m_Loc( Loc ) {}
//! Function operator
/*!
Compare two operands. Case is ignored.
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)<std::toupper(Arg2);
#else
return std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc);
#endif
}
private:
std::locale m_Loc;
};
// is_not_greater functor -----------------------------------------------//
//! is_not_greater functor
/*!
Convenient version of standard std::not_greater_to. Operation is templated, therefore it is
not required to specify the exact types upon the construction
*/
struct is_not_greater
{
//! Functor operation
/*!
Compare two operands using > operator
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
return Arg1<=Arg2;
}
};
//! case insensitive version of is_not_greater
/*!
Case insensitive comparison predicate. Comparison is done using
specified locales.
*/
struct is_not_igreater
{
//! Constructor
/*!
\param Loc locales used for comparison
*/
is_not_igreater( const std::locale& Loc=std::locale() ) :
m_Loc( Loc ) {}
//! Function operator
/*!
Compare two operands. Case is ignored.
*/
template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const
{
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)<=std::toupper(Arg2);
#else
return std::toupper<T1>(Arg1,m_Loc)<=std::toupper<T2>(Arg2,m_Loc);
#endif
}
private:
std::locale m_Loc;
};
} // namespace algorithm
// pull names to the boost namespace
using algorithm::is_equal;
using algorithm::is_iequal;
using algorithm::is_less;
using algorithm::is_iless;
using algorithm::is_not_greater;
using algorithm::is_not_igreater;
} // namespace boost
#endif // BOOST_STRING_COMPARE_HPP
@@ -1,83 +0,0 @@
// Boost string_algo library concept.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CONCEPT_HPP
#define BOOST_STRING_CONCEPT_HPP
#include <boost/concept_check.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
/*! \file
Defines concepts used in string_algo library
*/
namespace boost {
namespace algorithm {
//! Finder concept
/*!
Defines the Finder concept. Finder is a functor which selects
an arbitrary part of a string. Search is performed on
the range specified by starting and ending iterators.
Result of the find operation must be convertible to iterator_range.
*/
template<typename FinderT, typename IteratorT>
struct FinderConcept
{
private:
typedef iterator_range<IteratorT> range;
public:
void constraints()
{
// Operation
r=(*pF)(i,i);
}
private:
range r;
IteratorT i;
FinderT* pF;
}; // Finder_concept
//! Formatter concept
/*!
Defines the Formatter concept. Formatter is a functor, which
takes a result from a finder operation and transforms it
in a specific way.
Result must be a container supported by container_traits,
or a reference to it.
*/
template<typename FormatterT, typename FinderT, typename IteratorT>
struct FormatterConcept
{
public:
void constraints()
{
// Operation
::boost::begin((*pFo)( (*pF)(i,i) ));
::boost::end((*pFo)( (*pF)(i,i) ));
}
private:
IteratorT i;
FinderT* pF;
FormatterT *pFo;
}; // FormatterConcept;
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_CONCEPT_HPP
@@ -1,28 +0,0 @@
// Boost string_algo library config.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CONFIG_HPP
#define BOOST_STRING_CONFIG_HPP
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#ifdef BOOST_STRING_DEDUCED_TYPENAME
# error "macro already defined!"
#endif
#define BOOST_STRING_TYPENAME BOOST_DEDUCED_TYPENAME
// Metrowerks workaround
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
#pragma parse_func_templ off
#endif
#endif // BOOST_STRING_CONFIG_HPP
@@ -1,36 +0,0 @@
// Boost string_algo library constants.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CONSTANTS_HPP
#define BOOST_STRING_CONSTANTS_HPP
namespace boost {
namespace algorithm {
//! Token compression mode
/*!
Specifies token compression mode for the token_finder.
*/
enum token_compress_mode_type
{
token_compress_on, //!< Compress adjacent tokens
token_compress_off //!< Do not compress adjacent tokens
};
} // namespace algorithm
// pull the names to the boost namespace
using algorithm::token_compress_on;
using algorithm::token_compress_off;
} // namespace boost
#endif // BOOST_STRING_CONSTANTS_HPP
@@ -1,123 +0,0 @@
// Boost string_algo library string_funct.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CASE_CONV_DETAIL_HPP
#define BOOST_STRING_CASE_CONV_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <locale>
#include <functional>
#include <boost/type_traits/make_unsigned.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// case conversion functors -----------------------------------------------//
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:4512) //assignment operator could not be generated
#endif
// a tolower functor
template<typename CharT>
struct to_lowerF : public std::unary_function<CharT, CharT>
{
// Constructor
to_lowerF( const std::locale& Loc ) : m_Loc( &Loc ) {}
// Operation
CharT operator ()( CharT Ch ) const
{
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::tolower( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch ));
#else
return std::tolower<CharT>( Ch, *m_Loc );
#endif
}
private:
const std::locale* m_Loc;
};
// a toupper functor
template<typename CharT>
struct to_upperF : public std::unary_function<CharT, CharT>
{
// Constructor
to_upperF( const std::locale& Loc ) : m_Loc( &Loc ) {}
// Operation
CharT operator ()( CharT Ch ) const
{
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch ));
#else
return std::toupper<CharT>( Ch, *m_Loc );
#endif
}
private:
const std::locale* m_Loc;
};
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
// algorithm implementation -------------------------------------------------------------------------
// Transform a range
template<typename OutputIteratorT, typename RangeT, typename FunctorT>
OutputIteratorT transform_range_copy(
OutputIteratorT Output,
const RangeT& Input,
FunctorT Functor)
{
return std::transform(
::boost::begin(Input),
::boost::end(Input),
Output,
Functor);
}
// Transform a range (in-place)
template<typename RangeT, typename FunctorT>
void transform_range(
const RangeT& Input,
FunctorT Functor)
{
std::transform(
::boost::begin(Input),
::boost::end(Input),
::boost::begin(Input),
Functor);
}
template<typename SequenceT, typename RangeT, typename FunctorT>
inline SequenceT transform_range_copy(
const RangeT& Input,
FunctorT Functor)
{
return SequenceT(
::boost::make_transform_iterator(
::boost::begin(Input),
Functor),
::boost::make_transform_iterator(
::boost::end(Input),
Functor));
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_CASE_CONV_DETAIL_HPP
@@ -1,353 +0,0 @@
// Boost string_algo library classification.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_CLASSIFICATION_DETAIL_HPP
#define BOOST_STRING_CLASSIFICATION_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <functional>
#include <locale>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/algorithm/string/predicate_facade.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// classification functors -----------------------------------------------//
// is_classified functor
struct is_classifiedF :
public predicate_facade<is_classifiedF>
{
// Boost.ResultOf support
typedef bool result_type;
// Constructor from a locale
is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) :
m_Type(Type), m_Locale(Loc) {}
// Operation
template<typename CharT>
bool operator()( CharT Ch ) const
{
return std::use_facet< std::ctype<CharT> >(m_Locale).is( m_Type, Ch );
}
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x582) && !defined(_USE_OLD_RW_STL)
template<>
bool operator()( char const Ch ) const
{
return std::use_facet< std::ctype<char> >(m_Locale).is( m_Type, Ch );
}
#endif
private:
std::ctype_base::mask m_Type;
std::locale m_Locale;
};
// is_any_of functor
/*
returns true if the value is from the specified set
*/
template<typename CharT>
struct is_any_ofF :
public predicate_facade<is_any_ofF<CharT> >
{
private:
// set cannot operate on const value-type
typedef typename ::boost::remove_const<CharT>::type set_value_type;
public:
// Boost.ResultOf support
typedef bool result_type;
// Constructor
template<typename RangeT>
is_any_ofF( const RangeT& Range ) : m_Size(0)
{
// Prepare storage
m_Storage.m_dynSet=0;
std::size_t Size=::boost::distance(Range);
m_Size=Size;
set_value_type* Storage=0;
if(use_fixed_storage(m_Size))
{
// Use fixed storage
Storage=&m_Storage.m_fixSet[0];
}
else
{
// Use dynamic storage
m_Storage.m_dynSet=new set_value_type[m_Size];
Storage=m_Storage.m_dynSet;
}
// Use fixed storage
::std::copy(::boost::begin(Range), ::boost::end(Range), Storage);
::std::sort(Storage, Storage+m_Size);
}
// Copy constructor
is_any_ofF(const is_any_ofF& Other) : m_Size(Other.m_Size)
{
// Prepare storage
m_Storage.m_dynSet=0;
const set_value_type* SrcStorage=0;
set_value_type* DestStorage=0;
if(use_fixed_storage(m_Size))
{
// Use fixed storage
DestStorage=&m_Storage.m_fixSet[0];
SrcStorage=&Other.m_Storage.m_fixSet[0];
}
else
{
// Use dynamic storage
m_Storage.m_dynSet=new set_value_type[m_Size];
DestStorage=m_Storage.m_dynSet;
SrcStorage=Other.m_Storage.m_dynSet;
}
// Use fixed storage
::std::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size);
}
// Destructor
~is_any_ofF()
{
if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0)
{
delete [] m_Storage.m_dynSet;
}
}
// Assignment
is_any_ofF& operator=(const is_any_ofF& Other)
{
// Handle self assignment
if(this==&Other) return *this;
// Prepare storage
const set_value_type* SrcStorage;
set_value_type* DestStorage;
if(use_fixed_storage(Other.m_Size))
{
// Use fixed storage
DestStorage=&m_Storage.m_fixSet[0];
SrcStorage=&Other.m_Storage.m_fixSet[0];
// Delete old storage if was present
if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0)
{
delete [] m_Storage.m_dynSet;
}
// Set new size
m_Size=Other.m_Size;
}
else
{
// Other uses dynamic storage
SrcStorage=Other.m_Storage.m_dynSet;
// Check what kind of storage are we using right now
if(use_fixed_storage(m_Size))
{
// Using fixed storage, allocate new
set_value_type* pTemp=new set_value_type[Other.m_Size];
DestStorage=pTemp;
m_Storage.m_dynSet=pTemp;
m_Size=Other.m_Size;
}
else
{
// Using dynamic storage, check if can reuse
if(m_Storage.m_dynSet!=0 && m_Size>=Other.m_Size && m_Size<Other.m_Size*2)
{
// Reuse the current storage
DestStorage=m_Storage.m_dynSet;
m_Size=Other.m_Size;
}
else
{
// Allocate the new one
set_value_type* pTemp=new set_value_type[Other.m_Size];
DestStorage=pTemp;
// Delete old storage if necessary
if(m_Storage.m_dynSet!=0)
{
delete [] m_Storage.m_dynSet;
}
// Store the new storage
m_Storage.m_dynSet=pTemp;
// Set new size
m_Size=Other.m_Size;
}
}
}
// Copy the data
::std::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size);
return *this;
}
// Operation
template<typename Char2T>
bool operator()( Char2T Ch ) const
{
const set_value_type* Storage=
(use_fixed_storage(m_Size))
? &m_Storage.m_fixSet[0]
: m_Storage.m_dynSet;
return ::std::binary_search(Storage, Storage+m_Size, Ch);
}
private:
// check if the size is eligible for fixed storage
static bool use_fixed_storage(std::size_t size)
{
return size<=sizeof(set_value_type*)*2;
}
private:
// storage
// The actual used storage is selected on the type
union
{
set_value_type* m_dynSet;
set_value_type m_fixSet[sizeof(set_value_type*)*2];
}
m_Storage;
// storage size
::std::size_t m_Size;
};
// is_from_range functor
/*
returns true if the value is from the specified range.
(i.e. x>=From && x>=To)
*/
template<typename CharT>
struct is_from_rangeF :
public predicate_facade< is_from_rangeF<CharT> >
{
// Boost.ResultOf support
typedef bool result_type;
// Constructor
is_from_rangeF( CharT From, CharT To ) : m_From(From), m_To(To) {}
// Operation
template<typename Char2T>
bool operator()( Char2T Ch ) const
{
return ( m_From <= Ch ) && ( Ch <= m_To );
}
private:
CharT m_From;
CharT m_To;
};
// class_and composition predicate
template<typename Pred1T, typename Pred2T>
struct pred_andF :
public predicate_facade< pred_andF<Pred1T,Pred2T> >
{
public:
// Boost.ResultOf support
typedef bool result_type;
// Constructor
pred_andF( Pred1T Pred1, Pred2T Pred2 ) :
m_Pred1(Pred1), m_Pred2(Pred2) {}
// Operation
template<typename CharT>
bool operator()( CharT Ch ) const
{
return m_Pred1(Ch) && m_Pred2(Ch);
}
private:
Pred1T m_Pred1;
Pred2T m_Pred2;
};
// class_or composition predicate
template<typename Pred1T, typename Pred2T>
struct pred_orF :
public predicate_facade< pred_orF<Pred1T,Pred2T> >
{
public:
// Boost.ResultOf support
typedef bool result_type;
// Constructor
pred_orF( Pred1T Pred1, Pred2T Pred2 ) :
m_Pred1(Pred1), m_Pred2(Pred2) {}
// Operation
template<typename CharT>
bool operator()( CharT Ch ) const
{
return m_Pred1(Ch) || m_Pred2(Ch);
}
private:
Pred1T m_Pred1;
Pred2T m_Pred2;
};
// class_not composition predicate
template< typename PredT >
struct pred_notF :
public predicate_facade< pred_notF<PredT> >
{
public:
// Boost.ResultOf support
typedef bool result_type;
// Constructor
pred_notF( PredT Pred ) : m_Pred(Pred) {}
// Operation
template<typename CharT>
bool operator()( CharT Ch ) const
{
return !m_Pred(Ch);
}
private:
PredT m_Pred;
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_CLASSIFICATION_DETAIL_HPP
@@ -1,204 +0,0 @@
// Boost string_algo library find_format.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_FORMAT_DETAIL_HPP
#define BOOST_STRING_FIND_FORMAT_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/iterator.hpp>
#include <boost/algorithm/string/detail/find_format_store.hpp>
#include <boost/algorithm/string/detail/replace_storage.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// find_format_copy (iterator variant) implementation -------------------------------//
template<
typename OutputIteratorT,
typename InputT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline OutputIteratorT find_format_copy_impl2(
OutputIteratorT Output,
const InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult,
const FormatResultT& FormatResult )
{
typedef find_format_store<
BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
if ( !M )
{
// Match not found - return original sequence
Output = std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
return Output;
}
// Copy the beginning of the sequence
Output = std::copy( ::boost::begin(Input), ::boost::begin(M), Output );
// Format find result
// Copy formated result
Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
// Copy the rest of the sequence
Output = std::copy( M.end(), ::boost::end(Input), Output );
return Output;
}
template<
typename OutputIteratorT,
typename InputT,
typename FormatterT,
typename FindResultT >
inline OutputIteratorT find_format_copy_impl(
OutputIteratorT Output,
const InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult )
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_copy_impl2(
Output,
Input,
Formatter,
FindResult,
Formatter(FindResult) );
} else {
return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
}
}
// find_format_copy implementation --------------------------------------------------//
template<
typename InputT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline InputT find_format_copy_impl2(
const InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult,
const FormatResultT& FormatResult)
{
typedef find_format_store<
BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
if ( !M )
{
// Match not found - return original sequence
return InputT( Input );
}
InputT Output;
// Copy the beginning of the sequence
insert( Output, ::boost::end(Output), ::boost::begin(Input), M.begin() );
// Copy formated result
insert( Output, ::boost::end(Output), M.format_result() );
// Copy the rest of the sequence
insert( Output, ::boost::end(Output), M.end(), ::boost::end(Input) );
return Output;
}
template<
typename InputT,
typename FormatterT,
typename FindResultT >
inline InputT find_format_copy_impl(
const InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult)
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_copy_impl2(
Input,
Formatter,
FindResult,
Formatter(FindResult) );
} else {
return Input;
}
}
// replace implementation ----------------------------------------------------//
template<
typename InputT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline void find_format_impl2(
InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult,
const FormatResultT& FormatResult)
{
typedef find_format_store<
BOOST_STRING_TYPENAME
range_iterator<InputT>::type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
if ( !M )
{
// Search not found - return original sequence
return;
}
// Replace match
::boost::algorithm::detail::replace( Input, M.begin(), M.end(), M.format_result() );
}
template<
typename InputT,
typename FormatterT,
typename FindResultT >
inline void find_format_impl(
InputT& Input,
FormatterT Formatter,
const FindResultT& FindResult)
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
::boost::algorithm::detail::find_format_impl2(
Input,
Formatter,
FindResult,
Formatter(FindResult) );
}
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FIND_FORMAT_DETAIL_HPP
@@ -1,273 +0,0 @@
// Boost string_algo library find_format_all.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
#define BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/value_type.hpp>
#include <boost/algorithm/string/detail/find_format_store.hpp>
#include <boost/algorithm/string/detail/replace_storage.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// find_format_all_copy (iterator variant) implementation ---------------------------//
template<
typename OutputIteratorT,
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline OutputIteratorT find_format_all_copy_impl2(
OutputIteratorT Output,
const InputT& Input,
FinderT Finder,
FormatterT Formatter,
const FindResultT& FindResult,
const FormatResultT& FormatResult )
{
typedef BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type input_iterator_type;
typedef find_format_store<
input_iterator_type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
// Initialize last match
input_iterator_type LastMatch=::boost::begin(Input);
// Iterate through all matches
while( M )
{
// Copy the beginning of the sequence
Output = std::copy( LastMatch, M.begin(), Output );
// Copy formated result
Output = std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output );
// Proceed to the next match
LastMatch=M.end();
M=Finder( LastMatch, ::boost::end(Input) );
}
// Copy the rest of the sequence
Output = std::copy( LastMatch, ::boost::end(Input), Output );
return Output;
}
template<
typename OutputIteratorT,
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT >
inline OutputIteratorT find_format_all_copy_impl(
OutputIteratorT Output,
const InputT& Input,
FinderT Finder,
FormatterT Formatter,
const FindResultT& FindResult )
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_all_copy_impl2(
Output,
Input,
Finder,
Formatter,
FindResult,
Formatter(FindResult) );
} else {
return std::copy( ::boost::begin(Input), ::boost::end(Input), Output );
}
}
// find_format_all_copy implementation ----------------------------------------------//
template<
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline InputT find_format_all_copy_impl2(
const InputT& Input,
FinderT Finder,
FormatterT Formatter,
const FindResultT& FindResult,
const FormatResultT& FormatResult)
{
typedef BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type input_iterator_type;
typedef find_format_store<
input_iterator_type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
// Initialize last match
input_iterator_type LastMatch=::boost::begin(Input);
// Output temporary
InputT Output;
// Iterate through all matches
while( M )
{
// Copy the beginning of the sequence
insert( Output, ::boost::end(Output), LastMatch, M.begin() );
// Copy formated result
insert( Output, ::boost::end(Output), M.format_result() );
// Proceed to the next match
LastMatch=M.end();
M=Finder( LastMatch, ::boost::end(Input) );
}
// Copy the rest of the sequence
::boost::algorithm::detail::insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) );
return Output;
}
template<
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT >
inline InputT find_format_all_copy_impl(
const InputT& Input,
FinderT Finder,
FormatterT Formatter,
const FindResultT& FindResult)
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
return ::boost::algorithm::detail::find_format_all_copy_impl2(
Input,
Finder,
Formatter,
FindResult,
Formatter(FindResult) );
} else {
return Input;
}
}
// find_format_all implementation ------------------------------------------------//
template<
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT,
typename FormatResultT >
inline void find_format_all_impl2(
InputT& Input,
FinderT Finder,
FormatterT Formatter,
FindResultT FindResult,
FormatResultT FormatResult)
{
typedef BOOST_STRING_TYPENAME
range_iterator<InputT>::type input_iterator_type;
typedef find_format_store<
input_iterator_type,
FormatterT,
FormatResultT > store_type;
// Create store for the find result
store_type M( FindResult, FormatResult, Formatter );
// Instantiate replacement storage
std::deque<
BOOST_STRING_TYPENAME range_value<InputT>::type> Storage;
// Initialize replacement iterators
input_iterator_type InsertIt=::boost::begin(Input);
input_iterator_type SearchIt=::boost::begin(Input);
while( M )
{
// process the segment
InsertIt=process_segment(
Storage,
Input,
InsertIt,
SearchIt,
M.begin() );
// Adjust search iterator
SearchIt=M.end();
// Copy formated replace to the storage
::boost::algorithm::detail::copy_to_storage( Storage, M.format_result() );
// Find range for a next match
M=Finder( SearchIt, ::boost::end(Input) );
}
// process the last segment
InsertIt=::boost::algorithm::detail::process_segment(
Storage,
Input,
InsertIt,
SearchIt,
::boost::end(Input) );
if ( Storage.empty() )
{
// Truncate input
::boost::algorithm::detail::erase( Input, InsertIt, ::boost::end(Input) );
}
else
{
// Copy remaining data to the end of input
::boost::algorithm::detail::insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() );
}
}
template<
typename InputT,
typename FinderT,
typename FormatterT,
typename FindResultT >
inline void find_format_all_impl(
InputT& Input,
FinderT Finder,
FormatterT Formatter,
FindResultT FindResult)
{
if( ::boost::algorithm::detail::check_find_result(Input, FindResult) ) {
::boost::algorithm::detail::find_format_all_impl2(
Input,
Finder,
Formatter,
FindResult,
Formatter(FindResult) );
}
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
@@ -1,89 +0,0 @@
// Boost string_algo library find_format_store.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
#define BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// temporary format and find result storage --------------------------------//
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:4512) //assignment operator could not be generated
#endif
template<
typename ForwardIteratorT,
typename FormatterT,
typename FormatResultT >
class find_format_store :
public iterator_range<ForwardIteratorT>
{
public:
// typedefs
typedef iterator_range<ForwardIteratorT> base_type;
typedef FormatterT formatter_type;
typedef FormatResultT format_result_type;
public:
// Construction
find_format_store(
const base_type& FindResult,
const format_result_type& FormatResult,
const formatter_type& Formatter ) :
base_type(FindResult),
m_FormatResult(FormatResult),
m_Formatter(Formatter) {}
// Assignment
template< typename FindResultT >
find_format_store& operator=( FindResultT FindResult )
{
iterator_range<ForwardIteratorT>::operator=(FindResult);
if( !this->empty() ) {
m_FormatResult=m_Formatter(FindResult);
}
return *this;
}
// Retrieve format result
const format_result_type& format_result()
{
return m_FormatResult;
}
private:
format_result_type m_FormatResult;
const formatter_type& m_Formatter;
};
template<typename InputT, typename FindResultT>
bool check_find_result(InputT&, FindResultT& FindResult)
{
typedef BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type input_iterator_type;
iterator_range<input_iterator_type> ResultRange(FindResult);
return !ResultRange.empty();
}
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
@@ -1,87 +0,0 @@
// Boost string_algo library find_iterator.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
#define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/function.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// find_iterator base -----------------------------------------------//
// Find iterator base
template<typename IteratorT>
class find_iterator_base
{
protected:
// typedefs
typedef IteratorT input_iterator_type;
typedef iterator_range<IteratorT> match_type;
typedef function2<
match_type,
input_iterator_type,
input_iterator_type> finder_type;
protected:
// Protected construction/destruction
// Default constructor
find_iterator_base() {};
// Copy construction
find_iterator_base( const find_iterator_base& Other ) :
m_Finder(Other.m_Finder) {}
// Constructor
template<typename FinderT>
find_iterator_base( FinderT Finder, int ) :
m_Finder(Finder) {}
// Destructor
~find_iterator_base() {}
// Find operation
match_type do_find(
input_iterator_type Begin,
input_iterator_type End ) const
{
if (!m_Finder.empty())
{
return m_Finder(Begin,End);
}
else
{
return match_type(End,End);
}
}
// Check
bool is_null() const
{
return m_Finder.empty();
}
private:
// Finder
finder_type m_Finder;
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FIND_ITERATOR_DETAIL_HPP
@@ -1,646 +0,0 @@
// Boost string_algo library finder.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FINDER_DETAIL_HPP
#define BOOST_STRING_FINDER_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/constants.hpp>
#include <boost/detail/iterator.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/empty.hpp>
#include <boost/range/as_literal.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// find first functor -----------------------------------------------//
// find a subsequence in the sequence ( functor )
/*
Returns a pair <begin,end> marking the subsequence in the sequence.
If the find fails, functor returns <End,End>
*/
template<typename SearchIteratorT,typename PredicateT>
struct first_finderF
{
typedef SearchIteratorT search_iterator_type;
// Construction
template< typename SearchT >
first_finderF( const SearchT& Search, PredicateT Comp ) :
m_Search(::boost::begin(Search), ::boost::end(Search)), m_Comp(Comp) {}
first_finderF(
search_iterator_type SearchBegin,
search_iterator_type SearchEnd,
PredicateT Comp ) :
m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
typedef iterator_range<ForwardIteratorT> result_type;
typedef ForwardIteratorT input_iterator_type;
// Outer loop
for(input_iterator_type OuterIt=Begin;
OuterIt!=End;
++OuterIt)
{
// Sanity check
if( boost::empty(m_Search) )
return result_type( End, End );
input_iterator_type InnerIt=OuterIt;
search_iterator_type SubstrIt=m_Search.begin();
for(;
InnerIt!=End && SubstrIt!=m_Search.end();
++InnerIt,++SubstrIt)
{
if( !( m_Comp(*InnerIt,*SubstrIt) ) )
break;
}
// Substring matching succeeded
if ( SubstrIt==m_Search.end() )
return result_type( OuterIt, InnerIt );
}
return result_type( End, End );
}
private:
iterator_range<search_iterator_type> m_Search;
PredicateT m_Comp;
};
// find last functor -----------------------------------------------//
// find the last match a subseqeunce in the sequence ( functor )
/*
Returns a pair <begin,end> marking the subsequence in the sequence.
If the find fails, returns <End,End>
*/
template<typename SearchIteratorT, typename PredicateT>
struct last_finderF
{
typedef SearchIteratorT search_iterator_type;
typedef first_finderF<
search_iterator_type,
PredicateT> first_finder_type;
// Construction
template< typename SearchT >
last_finderF( const SearchT& Search, PredicateT Comp ) :
m_Search(::boost::begin(Search), ::boost::end(Search)), m_Comp(Comp) {}
last_finderF(
search_iterator_type SearchBegin,
search_iterator_type SearchEnd,
PredicateT Comp ) :
m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
typedef iterator_range<ForwardIteratorT> result_type;
if( boost::empty(m_Search) )
return result_type( End, End );
typedef BOOST_STRING_TYPENAME boost::detail::
iterator_traits<ForwardIteratorT>::iterator_category category;
return findit( Begin, End, category() );
}
private:
// forward iterator
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
findit(
ForwardIteratorT Begin,
ForwardIteratorT End,
std::forward_iterator_tag ) const
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
first_finder_type first_finder(
m_Search.begin(), m_Search.end(), m_Comp );
result_type M=first_finder( Begin, End );
result_type Last=M;
while( M )
{
Last=M;
M=first_finder( ::boost::end(M), End );
}
return Last;
}
// bidirectional iterator
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
findit(
ForwardIteratorT Begin,
ForwardIteratorT End,
std::bidirectional_iterator_tag ) const
{
typedef iterator_range<ForwardIteratorT> result_type;
typedef ForwardIteratorT input_iterator_type;
// Outer loop
for(input_iterator_type OuterIt=End;
OuterIt!=Begin; )
{
input_iterator_type OuterIt2=--OuterIt;
input_iterator_type InnerIt=OuterIt2;
search_iterator_type SubstrIt=m_Search.begin();
for(;
InnerIt!=End && SubstrIt!=m_Search.end();
++InnerIt,++SubstrIt)
{
if( !( m_Comp(*InnerIt,*SubstrIt) ) )
break;
}
// Substring matching succeeded
if( SubstrIt==m_Search.end() )
return result_type( OuterIt2, InnerIt );
}
return result_type( End, End );
}
private:
iterator_range<search_iterator_type> m_Search;
PredicateT m_Comp;
};
// find n-th functor -----------------------------------------------//
// find the n-th match of a subsequence in the sequence ( functor )
/*
Returns a pair <begin,end> marking the subsequence in the sequence.
If the find fails, returns <End,End>
*/
template<typename SearchIteratorT, typename PredicateT>
struct nth_finderF
{
typedef SearchIteratorT search_iterator_type;
typedef first_finderF<
search_iterator_type,
PredicateT> first_finder_type;
typedef last_finderF<
search_iterator_type,
PredicateT> last_finder_type;
// Construction
template< typename SearchT >
nth_finderF(
const SearchT& Search,
int Nth,
PredicateT Comp) :
m_Search(::boost::begin(Search), ::boost::end(Search)),
m_Nth(Nth),
m_Comp(Comp) {}
nth_finderF(
search_iterator_type SearchBegin,
search_iterator_type SearchEnd,
int Nth,
PredicateT Comp) :
m_Search(SearchBegin, SearchEnd),
m_Nth(Nth),
m_Comp(Comp) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
if(m_Nth>=0)
{
return find_forward(Begin, End, m_Nth);
}
else
{
return find_backward(Begin, End, -m_Nth);
}
}
private:
// Implementation helpers
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_forward(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N) const
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
// Sanity check
if( boost::empty(m_Search) )
return result_type( End, End );
// Instantiate find functor
first_finder_type first_finder(
m_Search.begin(), m_Search.end(), m_Comp );
result_type M( Begin, Begin );
for( unsigned int n=0; n<=N; ++n )
{
// find next match
M=first_finder( ::boost::end(M), End );
if ( !M )
{
// Subsequence not found, return
return M;
}
}
return M;
}
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_backward(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N) const
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
// Sanity check
if( boost::empty(m_Search) )
return result_type( End, End );
// Instantiate find functor
last_finder_type last_finder(
m_Search.begin(), m_Search.end(), m_Comp );
result_type M( End, End );
for( unsigned int n=1; n<=N; ++n )
{
// find next match
M=last_finder( Begin, ::boost::begin(M) );
if ( !M )
{
// Subsequence not found, return
return M;
}
}
return M;
}
private:
iterator_range<search_iterator_type> m_Search;
int m_Nth;
PredicateT m_Comp;
};
// find head/tail implementation helpers ---------------------------//
template<typename ForwardIteratorT>
iterator_range<ForwardIteratorT>
find_head_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N,
std::forward_iterator_tag )
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
input_iterator_type It=Begin;
for(
unsigned int Index=0;
Index<N && It!=End; ++Index,++It ) {};
return result_type( Begin, It );
}
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_head_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N,
std::random_access_iterator_tag )
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
return result_type( Begin, End );
return result_type(Begin,Begin+N);
}
// Find head implementation
template<typename ForwardIteratorT>
iterator_range<ForwardIteratorT>
find_head_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N )
{
typedef BOOST_STRING_TYPENAME boost::detail::
iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::find_head_impl( Begin, End, N, category() );
}
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_tail_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N,
std::forward_iterator_tag )
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
unsigned int Index=0;
input_iterator_type It=Begin;
input_iterator_type It2=Begin;
// Advance It2 by N increments
for( Index=0; Index<N && It2!=End; ++Index,++It2 ) {};
// Advance It, It2 to the end
for(; It2!=End; ++It,++It2 ) {};
return result_type( It, It2 );
}
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_tail_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N,
std::bidirectional_iterator_tag )
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
input_iterator_type It=End;
for(
unsigned int Index=0;
Index<N && It!=Begin; ++Index,--It ) {};
return result_type( It, End );
}
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_tail_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N,
std::random_access_iterator_tag )
{
typedef ForwardIteratorT input_iterator_type;
typedef iterator_range<ForwardIteratorT> result_type;
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
return result_type( Begin, End );
return result_type( End-N, End );
}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_tail_impl(
ForwardIteratorT Begin,
ForwardIteratorT End,
unsigned int N )
{
typedef BOOST_STRING_TYPENAME boost::detail::
iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::find_tail_impl( Begin, End, N, category() );
}
// find head functor -----------------------------------------------//
// find a head in the sequence ( functor )
/*
This functor find a head of the specified range. For
a specified N, the head is a subsequence of N starting
elements of the range.
*/
struct head_finderF
{
// Construction
head_finderF( int N ) : m_N(N) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
if(m_N>=0)
{
return ::boost::algorithm::detail::find_head_impl( Begin, End, m_N );
}
else
{
iterator_range<ForwardIteratorT> Res=
::boost::algorithm::detail::find_tail_impl( Begin, End, -m_N );
return ::boost::make_iterator_range(Begin, Res.begin());
}
}
private:
int m_N;
};
// find tail functor -----------------------------------------------//
// find a tail in the sequence ( functor )
/*
This functor find a tail of the specified range. For
a specified N, the head is a subsequence of N starting
elements of the range.
*/
struct tail_finderF
{
// Construction
tail_finderF( int N ) : m_N(N) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
if(m_N>=0)
{
return ::boost::algorithm::detail::find_tail_impl( Begin, End, m_N );
}
else
{
iterator_range<ForwardIteratorT> Res=
::boost::algorithm::detail::find_head_impl( Begin, End, -m_N );
return ::boost::make_iterator_range(Res.end(), End);
}
}
private:
int m_N;
};
// find token functor -----------------------------------------------//
// find a token in a sequence ( functor )
/*
This find functor finds a token specified be a predicate
in a sequence. It is equivalent of std::find algorithm,
with an exception that it return range instead of a single
iterator.
If bCompress is set to true, adjacent matching tokens are
concatenated into one match.
*/
template< typename PredicateT >
struct token_finderF
{
// Construction
token_finderF(
PredicateT Pred,
token_compress_mode_type eCompress=token_compress_off ) :
m_Pred(Pred), m_eCompress(eCompress) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
typedef iterator_range<ForwardIteratorT> result_type;
ForwardIteratorT It=std::find_if( Begin, End, m_Pred );
if( It==End )
{
return result_type( End, End );
}
else
{
ForwardIteratorT It2=It;
if( m_eCompress==token_compress_on )
{
// Find first non-matching character
while( It2!=End && m_Pred(*It2) ) ++It2;
}
else
{
// Advance by one position
++It2;
}
return result_type( It, It2 );
}
}
private:
PredicateT m_Pred;
token_compress_mode_type m_eCompress;
};
// find range functor -----------------------------------------------//
// find a range in the sequence ( functor )
/*
This functor actually does not perform any find operation.
It always returns given iterator range as a result.
*/
template<typename ForwardIterator1T>
struct range_finderF
{
typedef ForwardIterator1T input_iterator_type;
typedef iterator_range<input_iterator_type> result_type;
// Construction
range_finderF(
input_iterator_type Begin,
input_iterator_type End ) : m_Range(Begin, End) {}
range_finderF(const iterator_range<input_iterator_type>& Range) :
m_Range(Range) {}
// Operation
template< typename ForwardIterator2T >
iterator_range<ForwardIterator2T>
operator()(
ForwardIterator2T,
ForwardIterator2T ) const
{
#if BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
return iterator_range<const ForwardIterator2T>(this->m_Range);
#elif BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
return iterator_range<ForwardIterator2T>(m_Range.begin(), m_Range.end());
#else
return m_Range;
#endif
}
private:
iterator_range<input_iterator_type> m_Range;
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FINDER_DETAIL_HPP
@@ -1,119 +0,0 @@
// Boost string_algo library formatter.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#ifndef BOOST_STRING_FORMATTER_DETAIL_HPP
#define BOOST_STRING_FORMATTER_DETAIL_HPP
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/algorithm/string/detail/util.hpp>
// generic replace functors -----------------------------------------------//
namespace boost {
namespace algorithm {
namespace detail {
// const format functor ----------------------------------------------------//
// constant format functor
template<typename RangeT>
struct const_formatF
{
private:
typedef BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type format_iterator;
typedef iterator_range<format_iterator> result_type;
public:
// Construction
const_formatF(const RangeT& Format) :
m_Format(::boost::begin(Format), ::boost::end(Format)) {}
// Operation
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template<typename Range2T>
result_type& operator()(const Range2T&)
{
return m_Format;
}
#endif
template<typename Range2T>
const result_type& operator()(const Range2T&) const
{
return m_Format;
}
private:
result_type m_Format;
};
// identity format functor ----------------------------------------------------//
// identity format functor
template<typename RangeT>
struct identity_formatF
{
// Operation
template< typename Range2T >
const RangeT& operator()(const Range2T& Replace) const
{
return RangeT(::boost::begin(Replace), ::boost::end(Replace));
}
};
// empty format functor ( used by erase ) ------------------------------------//
// empty format functor
template< typename CharT >
struct empty_formatF
{
template< typename ReplaceT >
empty_container<CharT> operator()(const ReplaceT&) const
{
return empty_container<CharT>();
}
};
// dissect format functor ----------------------------------------------------//
// dissect format functor
template<typename FinderT>
struct dissect_formatF
{
public:
// Construction
dissect_formatF(FinderT Finder) :
m_Finder(Finder) {}
// Operation
template<typename RangeT>
inline iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
operator()(const RangeT& Replace) const
{
return m_Finder(::boost::begin(Replace), ::boost::end(Replace));
}
private:
FinderT m_Finder;
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_FORMATTER_DETAIL_HPP
@@ -1,77 +0,0 @@
// Boost string_algo library predicate.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_PREDICATE_DETAIL_HPP
#define BOOST_STRING_PREDICATE_DETAIL_HPP
#include <iterator>
#include <boost/algorithm/string/find.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// ends_with predicate implementation ----------------------------------//
template<
typename ForwardIterator1T,
typename ForwardIterator2T,
typename PredicateT>
inline bool ends_with_iter_select(
ForwardIterator1T Begin,
ForwardIterator1T End,
ForwardIterator2T SubBegin,
ForwardIterator2T SubEnd,
PredicateT Comp,
std::bidirectional_iterator_tag)
{
ForwardIterator1T it=End;
ForwardIterator2T pit=SubEnd;
for(;it!=Begin && pit!=SubBegin;)
{
if( !(Comp(*(--it),*(--pit))) )
return false;
}
return pit==SubBegin;
}
template<
typename ForwardIterator1T,
typename ForwardIterator2T,
typename PredicateT>
inline bool ends_with_iter_select(
ForwardIterator1T Begin,
ForwardIterator1T End,
ForwardIterator2T SubBegin,
ForwardIterator2T SubEnd,
PredicateT Comp,
std::forward_iterator_tag)
{
if ( SubBegin==SubEnd )
{
// empty subsequence check
return true;
}
iterator_range<ForwardIterator1T> Result
=last_finder(
::boost::make_iterator_range(SubBegin, SubEnd),
Comp)(Begin, End);
return !Result.empty() && Result.end()==End;
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_PREDICATE_DETAIL_HPP
@@ -1,159 +0,0 @@
// Boost string_algo library replace_storage.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
#define BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/sequence_traits.hpp>
#include <boost/algorithm/string/detail/sequence.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// storage handling routines -----------------------------------------------//
template< typename StorageT, typename OutputIteratorT >
inline OutputIteratorT move_from_storage(
StorageT& Storage,
OutputIteratorT DestBegin,
OutputIteratorT DestEnd )
{
OutputIteratorT OutputIt=DestBegin;
while( !Storage.empty() && OutputIt!=DestEnd )
{
*OutputIt=Storage.front();
Storage.pop_front();
++OutputIt;
}
return OutputIt;
}
template< typename StorageT, typename WhatT >
inline void copy_to_storage(
StorageT& Storage,
const WhatT& What )
{
Storage.insert( Storage.end(), ::boost::begin(What), ::boost::end(What) );
}
// process segment routine -----------------------------------------------//
template< bool HasStableIterators >
struct process_segment_helper
{
// Optimized version of process_segment for generic sequence
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
ForwardIteratorT operator()(
StorageT& Storage,
InputT& /*Input*/,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
// Copy data from the storage until the beginning of the segment
ForwardIteratorT It=::boost::algorithm::detail::move_from_storage( Storage, InsertIt, SegmentBegin );
// 3 cases are possible :
// a) Storage is empty, It==SegmentBegin
// b) Storage is empty, It!=SegmentBegin
// c) Storage is not empty
if( Storage.empty() )
{
if( It==SegmentBegin )
{
// Case a) everything is grand, just return end of segment
return SegmentEnd;
}
else
{
// Case b) move the segment backwards
return std::copy( SegmentBegin, SegmentEnd, It );
}
}
else
{
// Case c) -> shift the segment to the left and keep the overlap in the storage
while( It!=SegmentEnd )
{
// Store value into storage
Storage.push_back( *It );
// Get the top from the storage and put it here
*It=Storage.front();
Storage.pop_front();
// Advance
++It;
}
return It;
}
}
};
template<>
struct process_segment_helper< true >
{
// Optimized version of process_segment for list-like sequence
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
ForwardIteratorT operator()(
StorageT& Storage,
InputT& Input,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
// Call replace to do the job
::boost::algorithm::detail::replace( Input, InsertIt, SegmentBegin, Storage );
// Empty the storage
Storage.clear();
// Iterators were not changed, simply return the end of segment
return SegmentEnd;
}
};
// Process one segment in the replace_all algorithm
template<
typename StorageT,
typename InputT,
typename ForwardIteratorT >
inline ForwardIteratorT process_segment(
StorageT& Storage,
InputT& Input,
ForwardIteratorT InsertIt,
ForwardIteratorT SegmentBegin,
ForwardIteratorT SegmentEnd )
{
return
process_segment_helper<
has_stable_iterators<InputT>::value>()(
Storage, Input, InsertIt, SegmentBegin, SegmentEnd );
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
@@ -1,200 +0,0 @@
// Boost string_algo library sequence.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_DETAIL_SEQUENCE_HPP
#define BOOST_STRING_DETAIL_SEQUENCE_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/logical.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/algorithm/string/sequence_traits.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// insert helpers -------------------------------------------------//
template< typename InputT, typename ForwardIteratorT >
inline void insert(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator At,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
Input.insert( At, Begin, End );
}
template< typename InputT, typename InsertT >
inline void insert(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator At,
const InsertT& Insert )
{
::boost::algorithm::detail::insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) );
}
// erase helper ---------------------------------------------------//
// Erase a range in the sequence
/*
Returns the iterator pointing just after the erase subrange
*/
template< typename InputT >
inline typename InputT::iterator erase(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To )
{
return Input.erase( From, To );
}
// replace helper implementation ----------------------------------//
// Optimized version of replace for generic sequence containers
// Assumption: insert and erase are expensive
template< bool HasConstTimeOperations >
struct replace_const_time_helper
{
template< typename InputT, typename ForwardIteratorT >
void operator()(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
// Copy data to the container ( as much as possible )
ForwardIteratorT InsertIt=Begin;
BOOST_STRING_TYPENAME InputT::iterator InputIt=From;
for(; InsertIt!=End && InputIt!=To; InsertIt++, InputIt++ )
{
*InputIt=*InsertIt;
}
if ( InsertIt!=End )
{
// Replace sequence is longer, insert it
Input.insert( InputIt, InsertIt, End );
}
else
{
if ( InputIt!=To )
{
// Replace sequence is shorter, erase the rest
Input.erase( InputIt, To );
}
}
}
};
template<>
struct replace_const_time_helper< true >
{
// Const-time erase and insert methods -> use them
template< typename InputT, typename ForwardIteratorT >
void operator()(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
BOOST_STRING_TYPENAME InputT::iterator At=Input.erase( From, To );
if ( Begin!=End )
{
if(!Input.empty())
{
Input.insert( At, Begin, End );
}
else
{
Input.insert( Input.begin(), Begin, End );
}
}
}
};
// No native replace method
template< bool HasNative >
struct replace_native_helper
{
template< typename InputT, typename ForwardIteratorT >
void operator()(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
replace_const_time_helper<
boost::mpl::and_<
has_const_time_insert<InputT>,
has_const_time_erase<InputT> >::value >()(
Input, From, To, Begin, End );
}
};
// Container has native replace method
template<>
struct replace_native_helper< true >
{
template< typename InputT, typename ForwardIteratorT >
void operator()(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
Input.replace( From, To, Begin, End );
}
};
// replace helper -------------------------------------------------//
template< typename InputT, typename ForwardIteratorT >
inline void replace(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
ForwardIteratorT Begin,
ForwardIteratorT End )
{
replace_native_helper< has_native_replace<InputT>::value >()(
Input, From, To, Begin, End );
}
template< typename InputT, typename InsertT >
inline void replace(
InputT& Input,
BOOST_STRING_TYPENAME InputT::iterator From,
BOOST_STRING_TYPENAME InputT::iterator To,
const InsertT& Insert )
{
if(From!=To)
{
::boost::algorithm::detail::replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) );
}
else
{
::boost::algorithm::detail::insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) );
}
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_DETAIL_SEQUENCE_HPP
@@ -1,95 +0,0 @@
// Boost string_algo library trim.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_TRIM_DETAIL_HPP
#define BOOST_STRING_TRIM_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/detail/iterator.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// trim iterator helper -----------------------------------------------//
template< typename ForwardIteratorT, typename PredicateT >
inline ForwardIteratorT trim_end_iter_select(
ForwardIteratorT InBegin,
ForwardIteratorT InEnd,
PredicateT IsSpace,
std::forward_iterator_tag )
{
ForwardIteratorT TrimIt=InBegin;
for( ForwardIteratorT It=InBegin; It!=InEnd; ++It )
{
if ( !IsSpace(*It) )
{
TrimIt=It;
++TrimIt;
}
}
return TrimIt;
}
template< typename ForwardIteratorT, typename PredicateT >
inline ForwardIteratorT trim_end_iter_select(
ForwardIteratorT InBegin,
ForwardIteratorT InEnd,
PredicateT IsSpace,
std::bidirectional_iterator_tag )
{
for( ForwardIteratorT It=InEnd; It!=InBegin; )
{
if ( !IsSpace(*(--It)) )
return ++It;
}
return InBegin;
}
// Search for first non matching character from the beginning of the sequence
template< typename ForwardIteratorT, typename PredicateT >
inline ForwardIteratorT trim_begin(
ForwardIteratorT InBegin,
ForwardIteratorT InEnd,
PredicateT IsSpace )
{
ForwardIteratorT It=InBegin;
for(; It!=InEnd; ++It )
{
if (!IsSpace(*It))
return It;
}
return It;
}
// Search for first non matching character from the end of the sequence
template< typename ForwardIteratorT, typename PredicateT >
inline ForwardIteratorT trim_end(
ForwardIteratorT InBegin,
ForwardIteratorT InEnd,
PredicateT IsSpace )
{
typedef BOOST_STRING_TYPENAME boost::detail::
iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::trim_end_iter_select( InBegin, InEnd, IsSpace, category() );
}
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_TRIM_DETAIL_HPP
@@ -1,106 +0,0 @@
// Boost string_algo library util.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_UTIL_DETAIL_HPP
#define BOOST_STRING_UTIL_DETAIL_HPP
#include <boost/algorithm/string/config.hpp>
#include <functional>
#include <boost/range/iterator_range.hpp>
namespace boost {
namespace algorithm {
namespace detail {
// empty container -----------------------------------------------//
// empty_container
/*
This class represents always empty container,
containing elements of type CharT.
It is supposed to be used in a const version only
*/
template< typename CharT >
struct empty_container
{
typedef empty_container<CharT> type;
typedef CharT value_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef const value_type& reference;
typedef const value_type& const_reference;
typedef const value_type* iterator;
typedef const value_type* const_iterator;
// Operations
const_iterator begin() const
{
return reinterpret_cast<const_iterator>(0);
}
const_iterator end() const
{
return reinterpret_cast<const_iterator>(0);
}
bool empty() const
{
return false;
}
size_type size() const
{
return 0;
}
};
// bounded copy algorithm -----------------------------------------------//
// Bounded version of the std::copy algorithm
template<typename InputIteratorT, typename OutputIteratorT>
inline OutputIteratorT bounded_copy(
InputIteratorT First,
InputIteratorT Last,
OutputIteratorT DestFirst,
OutputIteratorT DestLast )
{
InputIteratorT InputIt=First;
OutputIteratorT OutputIt=DestFirst;
for(; InputIt!=Last && OutputIt!=DestLast; InputIt++, OutputIt++ )
{
*OutputIt=*InputIt;
}
return OutputIt;
}
// iterator range utilities -----------------------------------------//
// copy range functor
template<
typename SeqT,
typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator >
struct copy_iterator_rangeF :
public std::unary_function< iterator_range<IteratorT>, SeqT >
{
SeqT operator()( const iterator_range<IteratorT>& Range ) const
{
return copy_range<SeqT>(Range);
}
};
} // namespace detail
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_UTIL_DETAIL_HPP
@@ -1,844 +0,0 @@
// Boost string_algo library erase.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_ERASE_HPP
#define BOOST_STRING_ERASE_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/algorithm/string/find_format.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/formatter.hpp>
/*! \file
Defines various erase algorithms. Each algorithm removes
part(s) of the input according to a searching criteria.
*/
namespace boost {
namespace algorithm {
// erase_range -------------------------------------------------------//
//! Erase range algorithm
/*!
Remove the given range from the input. The result is a modified copy of
the input. It is returned as a sequence or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input sequence
\param SearchRange A range in the input to be removed
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT>
inline OutputIteratorT erase_range_copy(
OutputIteratorT Output,
const RangeT& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type>& SearchRange )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase range algorithm
/*!
\overload
*/
template<typename SequenceT>
inline SequenceT erase_range_copy(
const SequenceT& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_const_iterator<SequenceT>::type>& SearchRange )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase range algorithm
/*!
Remove the given range from the input.
The input sequence is modified in-place.
\param Input An input sequence
\param SearchRange A range in the input to be removed
*/
template<typename SequenceT>
inline void erase_range(
SequenceT& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_iterator<SequenceT>::type>& SearchRange )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::empty_formatter(Input) );
}
// erase_first --------------------------------------------------------//
//! Erase first algorithm
/*!
Remove the first occurrence of the substring from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT erase_first_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase first algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT erase_first_copy(
const SequenceT& Input,
const RangeT& Search )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase first algorithm
/*!
Remove the first occurrence of the substring from the input.
The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for.
*/
template<typename SequenceT, typename RangeT>
inline void erase_first(
SequenceT& Input,
const RangeT& Search )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
// erase_first ( case insensitive ) ------------------------------------//
//! Erase first algorithm ( case insensitive )
/*!
Remove the first occurrence of the substring from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT ierase_first_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase first algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT ierase_first_copy(
const SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase first algorithm ( case insensitive )
/*!
Remove the first occurrence of the substring from the input.
The input sequence is modified in-place. Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename RangeT>
inline void ierase_first(
SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
// erase_last --------------------------------------------------------//
//! Erase last algorithm
/*!
Remove the last occurrence of the substring from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for.
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT erase_last_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase last algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT erase_last_copy(
const SequenceT& Input,
const RangeT& Search )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase last algorithm
/*!
Remove the last occurrence of the substring from the input.
The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for
*/
template<typename SequenceT, typename RangeT>
inline void erase_last(
SequenceT& Input,
const RangeT& Search )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
// erase_last ( case insensitive ) ------------------------------------//
//! Erase last algorithm ( case insensitive )
/*!
Remove the last occurrence of the substring from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT ierase_last_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase last algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT ierase_last_copy(
const SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase last algorithm ( case insensitive )
/*!
Remove the last occurrence of the substring from the input.
The input sequence is modified in-place. Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename RangeT>
inline void ierase_last(
SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
// erase_nth --------------------------------------------------------------------//
//! Erase nth algorithm
/*!
Remove the Nth occurrence of the substring in the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT erase_nth_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
int Nth )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase nth algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT erase_nth_copy(
const SequenceT& Input,
const RangeT& Search,
int Nth )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase nth algorithm
/*!
Remove the Nth occurrence of the substring in the input.
The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for.
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
*/
template<typename SequenceT, typename RangeT>
inline void erase_nth(
SequenceT& Input,
const RangeT& Search,
int Nth )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::empty_formatter(Input) );
}
// erase_nth ( case insensitive ) ---------------------------------------------//
//! Erase nth algorithm ( case insensitive )
/*!
Remove the Nth occurrence of the substring in the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for.
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT ierase_nth_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
int Nth,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase nth algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT ierase_nth_copy(
const SequenceT& Input,
const RangeT& Search,
int Nth,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
empty_formatter(Input) );
}
//! Erase nth algorithm
/*!
Remove the Nth occurrence of the substring in the input.
The input sequence is modified in-place. Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for.
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename RangeT>
inline void ierase_nth(
SequenceT& Input,
const RangeT& Search,
int Nth,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
// erase_all --------------------------------------------------------//
//! Erase all algorithm
/*!
Remove all the occurrences of the string from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input sequence
\param Search A substring to be searched for.
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT erase_all_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search )
{
return ::boost::algorithm::find_format_all_copy(
Output,
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase all algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT erase_all_copy(
const SequenceT& Input,
const RangeT& Search )
{
return ::boost::algorithm::find_format_all_copy(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase all algorithm
/*!
Remove all the occurrences of the string from the input.
The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for.
*/
template<typename SequenceT, typename RangeT>
inline void erase_all(
SequenceT& Input,
const RangeT& Search )
{
::boost::algorithm::find_format_all(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::empty_formatter(Input) );
}
// erase_all ( case insensitive ) ------------------------------------//
//! Erase all algorithm ( case insensitive )
/*!
Remove all the occurrences of the string from the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT ierase_all_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_all_copy(
Output,
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase all algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT ierase_all_copy(
const SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_all_copy(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
//! Erase all algorithm ( case insensitive )
/*!
Remove all the occurrences of the string from the input.
The input sequence is modified in-place. Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for.
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename RangeT>
inline void ierase_all(
SequenceT& Input,
const RangeT& Search,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format_all(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::empty_formatter(Input) );
}
// erase_head --------------------------------------------------------------------//
//! Erase head algorithm
/*!
Remove the head from the input. The head is a prefix of a sequence of given size.
If the sequence is shorter then required, the whole string is
considered to be the head. The result is a modified copy of the input.
It is returned as a sequence or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param N Length of the head.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename RangeT>
inline OutputIteratorT erase_head_copy(
OutputIteratorT Output,
const RangeT& Input,
int N )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
//! Erase head algorithm
/*!
\overload
*/
template<typename SequenceT>
inline SequenceT erase_head_copy(
const SequenceT& Input,
int N )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
//! Erase head algorithm
/*!
Remove the head from the input. The head is a prefix of a sequence of given size.
If the sequence is shorter then required, the whole string is
considered to be the head. The input sequence is modified in-place.
\param Input An input string
\param N Length of the head
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
*/
template<typename SequenceT>
inline void erase_head(
SequenceT& Input,
int N )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
// erase_tail --------------------------------------------------------------------//
//! Erase tail algorithm
/*!
Remove the tail from the input. The tail is a suffix of a sequence of given size.
If the sequence is shorter then required, the whole string is
considered to be the tail.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param N Length of the tail.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename RangeT>
inline OutputIteratorT erase_tail_copy(
OutputIteratorT Output,
const RangeT& Input,
int N )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
//! Erase tail algorithm
/*!
\overload
*/
template<typename SequenceT>
inline SequenceT erase_tail_copy(
const SequenceT& Input,
int N )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
//! Erase tail algorithm
/*!
Remove the tail from the input. The tail is a suffix of a sequence of given size.
If the sequence is shorter then required, the whole string is
considered to be the tail. The input sequence is modified in-place.
\param Input An input string
\param N Length of the tail
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
*/
template<typename SequenceT>
inline void erase_tail(
SequenceT& Input,
int N )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::empty_formatter( Input ) );
}
} // namespace algorithm
// pull names into the boost namespace
using algorithm::erase_range_copy;
using algorithm::erase_range;
using algorithm::erase_first_copy;
using algorithm::erase_first;
using algorithm::ierase_first_copy;
using algorithm::ierase_first;
using algorithm::erase_last_copy;
using algorithm::erase_last;
using algorithm::ierase_last_copy;
using algorithm::ierase_last;
using algorithm::erase_nth_copy;
using algorithm::erase_nth;
using algorithm::ierase_nth_copy;
using algorithm::ierase_nth;
using algorithm::erase_all_copy;
using algorithm::erase_all;
using algorithm::ierase_all_copy;
using algorithm::ierase_all;
using algorithm::erase_head_copy;
using algorithm::erase_head;
using algorithm::erase_tail_copy;
using algorithm::erase_tail;
} // namespace boost
#endif // BOOST_ERASE_HPP
@@ -1,334 +0,0 @@
// Boost string_algo library find.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_HPP
#define BOOST_STRING_FIND_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/compare.hpp>
#include <boost/algorithm/string/constants.hpp>
/*! \file
Defines a set of find algorithms. The algorithms are searching
for a substring of the input. The result is given as an \c iterator_range
delimiting the substring.
*/
namespace boost {
namespace algorithm {
// Generic find -----------------------------------------------//
//! Generic find algorithm
/*!
Search the input using the given finder.
\param Input A string which will be searched.
\param Finder Finder object used for searching.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c RangeT::iterator or
\c RangeT::const_iterator, depending on the constness of
the input parameter.
*/
template<typename RangeT, typename FinderT>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
find(
RangeT& Input,
const FinderT& Finder)
{
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
return Finder(::boost::begin(lit_input),::boost::end(lit_input));
}
// find_first -----------------------------------------------//
//! Find first algorithm
/*!
Search for the first occurrence of the substring in the input.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c RangeT::iterator or
\c RangeT::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
find_first(
Range1T& Input,
const Range2T& Search)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::first_finder(Search));
}
//! Find first algorithm ( case insensitive )
/*!
Search for the first occurence of the substring in the input.
Searching is case insensitive.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\param Loc A locale used for case insensitive comparison
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
ifind_first(
Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::find(Input, ::boost::algorithm::first_finder(Search,is_iequal(Loc)));
}
// find_last -----------------------------------------------//
//! Find last algorithm
/*!
Search for the last occurrence of the substring in the input.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
find_last(
Range1T& Input,
const Range2T& Search)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::last_finder(Search));
}
//! Find last algorithm ( case insensitive )
/*!
Search for the last match a string in the input.
Searching is case insensitive.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\param Loc A locale used for case insensitive comparison
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
ifind_last(
Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::find(Input, ::boost::algorithm::last_finder(Search, is_iequal(Loc)));
}
// find_nth ----------------------------------------------------------------------//
//! Find n-th algorithm
/*!
Search for the n-th (zero-indexed) occurrence of the substring in the
input.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\param Nth An index (zero-indexed) of the match to be found.
For negative N, the matches are counted from the end of string.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
find_nth(
Range1T& Input,
const Range2T& Search,
int Nth)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::nth_finder(Search,Nth));
}
//! Find n-th algorithm ( case insensitive ).
/*!
Search for the n-th (zero-indexed) occurrence of the substring in the
input. Searching is case insensitive.
\param Input A string which will be searched.
\param Search A substring to be searched for.
\param Nth An index (zero-indexed) of the match to be found.
For negative N, the matches are counted from the end of string.
\param Loc A locale used for case insensitive comparison
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<Range1T>::type>
ifind_nth(
Range1T& Input,
const Range2T& Search,
int Nth,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::find(Input, ::boost::algorithm::nth_finder(Search,Nth,is_iequal(Loc)));
}
// find_head ----------------------------------------------------------------------//
//! Find head algorithm
/*!
Get the head of the input. Head is a prefix of the string of the
given size. If the input is shorter then required, whole input if considered
to be the head.
\param Input An input string
\param N Length of the head
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c Range1T::iterator or
\c Range1T::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename RangeT>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
find_head(
RangeT& Input,
int N)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::head_finder(N));
}
// find_tail ----------------------------------------------------------------------//
//! Find tail algorithm
/*!
Get the tail of the input. Tail is a suffix of the string of the
given size. If the input is shorter then required, whole input if considered
to be the tail.
\param Input An input string
\param N Length of the tail.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c RangeT::iterator or
\c RangeT::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename RangeT>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
find_tail(
RangeT& Input,
int N)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::tail_finder(N));
}
// find_token --------------------------------------------------------------------//
//! Find token algorithm
/*!
Look for a given token in the string. Token is a character that matches the
given predicate.
If the "token compress mode" is enabled, adjacent tokens are considered to be one match.
\param Input A input string.
\param Pred An unary predicate to identify a token
\param eCompress Enable/Disable compressing of adjacent tokens
\return
An \c iterator_range delimiting the match.
Returned iterator is either \c RangeT::iterator or
\c RangeT::const_iterator, depending on the constness of
the input parameter.
\note This function provides the strong exception-safety guarantee
*/
template<typename RangeT, typename PredicateT>
inline iterator_range<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
find_token(
RangeT& Input,
PredicateT Pred,
token_compress_mode_type eCompress=token_compress_off)
{
return ::boost::algorithm::find(Input, ::boost::algorithm::token_finder(Pred, eCompress));
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::find;
using algorithm::find_first;
using algorithm::ifind_first;
using algorithm::find_last;
using algorithm::ifind_last;
using algorithm::find_nth;
using algorithm::ifind_nth;
using algorithm::find_head;
using algorithm::find_tail;
using algorithm::find_token;
} // namespace boost
#endif // BOOST_STRING_FIND_HPP
@@ -1,287 +0,0 @@
// Boost string_algo library find_format.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_FORMAT_HPP
#define BOOST_STRING_FIND_FORMAT_HPP
#include <deque>
#include <boost/detail/iterator.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/concept.hpp>
#include <boost/algorithm/string/detail/find_format.hpp>
#include <boost/algorithm/string/detail/find_format_all.hpp>
/*! \file
Defines generic replace algorithms. Each algorithm replaces
part(s) of the input. The part to be replaced is looked up using a Finder object.
Result of finding is then used by a Formatter object to generate the replacement.
*/
namespace boost {
namespace algorithm {
// generic replace -----------------------------------------------------------------//
//! Generic replace algorithm
/*!
Use the Finder to search for a substring. Use the Formatter to format
this substring and replace it in the input.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input sequence
\param Finder A Finder object used to search for a match to be replaced
\param Formatter A Formatter object used to format a match
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename RangeT,
typename FinderT,
typename FormatterT>
inline OutputIteratorT find_format_copy(
OutputIteratorT Output,
const RangeT& Input,
FinderT Finder,
FormatterT Formatter )
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
return detail::find_format_copy_impl(
Output,
lit_input,
Formatter,
Finder( ::boost::begin(lit_input), ::boost::end(lit_input) ) );
}
//! Generic replace algorithm
/*!
\overload
*/
template<
typename SequenceT,
typename FinderT,
typename FormatterT>
inline SequenceT find_format_copy(
const SequenceT& Input,
FinderT Finder,
FormatterT Formatter )
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
return detail::find_format_copy_impl(
Input,
Formatter,
Finder(::boost::begin(Input), ::boost::end(Input)));
}
//! Generic replace algorithm
/*!
Use the Finder to search for a substring. Use the Formatter to format
this substring and replace it in the input. The input is modified in-place.
\param Input An input sequence
\param Finder A Finder object used to search for a match to be replaced
\param Formatter A Formatter object used to format a match
*/
template<
typename SequenceT,
typename FinderT,
typename FormatterT>
inline void find_format(
SequenceT& Input,
FinderT Finder,
FormatterT Formatter)
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
detail::find_format_impl(
Input,
Formatter,
Finder(::boost::begin(Input), ::boost::end(Input)));
}
// find_format_all generic ----------------------------------------------------------------//
//! Generic replace all algorithm
/*!
Use the Finder to search for a substring. Use the Formatter to format
this substring and replace it in the input. Repeat this for all matching
substrings.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input sequence
\param Finder A Finder object used to search for a match to be replaced
\param Formatter A Formatter object used to format a match
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename RangeT,
typename FinderT,
typename FormatterT>
inline OutputIteratorT find_format_all_copy(
OutputIteratorT Output,
const RangeT& Input,
FinderT Finder,
FormatterT Formatter)
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
return detail::find_format_all_copy_impl(
Output,
lit_input,
Finder,
Formatter,
Finder(::boost::begin(lit_input), ::boost::end(lit_input)));
}
//! Generic replace all algorithm
/*!
\overload
*/
template<
typename SequenceT,
typename FinderT,
typename FormatterT >
inline SequenceT find_format_all_copy(
const SequenceT& Input,
FinderT Finder,
FormatterT Formatter )
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
return detail::find_format_all_copy_impl(
Input,
Finder,
Formatter,
Finder( ::boost::begin(Input), ::boost::end(Input) ) );
}
//! Generic replace all algorithm
/*!
Use the Finder to search for a substring. Use the Formatter to format
this substring and replace it in the input. Repeat this for all matching
substrings.The input is modified in-place.
\param Input An input sequence
\param Finder A Finder object used to search for a match to be replaced
\param Formatter A Formatter object used to format a match
*/
template<
typename SequenceT,
typename FinderT,
typename FormatterT >
inline void find_format_all(
SequenceT& Input,
FinderT Finder,
FormatterT Formatter )
{
// Concept check
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
BOOST_CONCEPT_ASSERT((
FormatterConcept<
FormatterT,
FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
));
detail::find_format_all_impl(
Input,
Finder,
Formatter,
Finder(::boost::begin(Input), ::boost::end(Input)));
}
} // namespace algorithm
// pull the names to the boost namespace
using algorithm::find_format_copy;
using algorithm::find_format;
using algorithm::find_format_all_copy;
using algorithm::find_format_all;
} // namespace boost
#endif // BOOST_STRING_FIND_FORMAT_HPP
@@ -1,383 +0,0 @@
// Boost string_algo library find_iterator.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2004.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FIND_ITERATOR_HPP
#define BOOST_STRING_FIND_ITERATOR_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/detail/find_iterator.hpp>
/*! \file
Defines find iterator classes. Find iterator repeatedly applies a Finder
to the specified input string to search for matches. Dereferencing
the iterator yields the current match or a range between the last and the current
match depending on the iterator used.
*/
namespace boost {
namespace algorithm {
// find_iterator -----------------------------------------------//
//! find_iterator
/*!
Find iterator encapsulates a Finder and allows
for incremental searching in a string.
Each increment moves the iterator to the next match.
Find iterator is a readable forward traversal iterator.
Dereferencing the iterator yields an iterator_range delimiting
the current match.
*/
template<typename IteratorT>
class find_iterator :
public iterator_facade<
find_iterator<IteratorT>,
const iterator_range<IteratorT>,
forward_traversal_tag >,
private detail::find_iterator_base<IteratorT>
{
private:
// facade support
friend class ::boost::iterator_core_access;
private:
// typedefs
typedef detail::find_iterator_base<IteratorT> base_type;
typedef BOOST_STRING_TYPENAME
base_type::input_iterator_type input_iterator_type;
typedef BOOST_STRING_TYPENAME
base_type::match_type match_type;
public:
//! Default constructor
/*!
Construct null iterator. All null iterators are equal.
\post eof()==true
*/
find_iterator() {}
//! Copy constructor
/*!
Construct a copy of the find_iterator
*/
find_iterator( const find_iterator& Other ) :
base_type(Other),
m_Match(Other.m_Match),
m_End(Other.m_End) {}
//! Constructor
/*!
Construct new find_iterator for a given finder
and a range.
*/
template<typename FinderT>
find_iterator(
IteratorT Begin,
IteratorT End,
FinderT Finder ) :
detail::find_iterator_base<IteratorT>(Finder,0),
m_Match(Begin,Begin),
m_End(End)
{
increment();
}
//! Constructor
/*!
Construct new find_iterator for a given finder
and a range.
*/
template<typename FinderT, typename RangeT>
find_iterator(
RangeT& Col,
FinderT Finder ) :
detail::find_iterator_base<IteratorT>(Finder,0)
{
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(::boost::as_literal(Col));
m_Match=::boost::make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col));
m_End=::boost::end(lit_col);
increment();
}
private:
// iterator operations
// dereference
const match_type& dereference() const
{
return m_Match;
}
// increment
void increment()
{
m_Match=this->do_find(m_Match.end(),m_End);
}
// comparison
bool equal( const find_iterator& Other ) const
{
bool bEof=eof();
bool bOtherEof=Other.eof();
return bEof || bOtherEof ? bEof==bOtherEof :
(
m_Match==Other.m_Match &&
m_End==Other.m_End
);
}
public:
// operations
//! Eof check
/*!
Check the eof condition. Eof condition means that
there is nothing more to be searched i.e. find_iterator
is after the last match.
*/
bool eof() const
{
return
this->is_null() ||
(
m_Match.begin() == m_End &&
m_Match.end() == m_End
);
}
private:
// Attributes
match_type m_Match;
input_iterator_type m_End;
};
//! find iterator construction helper
/*!
* Construct a find iterator to iterate through the specified string
*/
template<typename RangeT, typename FinderT>
inline find_iterator<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
make_find_iterator(
RangeT& Collection,
FinderT Finder)
{
return find_iterator<BOOST_STRING_TYPENAME range_iterator<RangeT>::type>(
Collection, Finder);
}
// split iterator -----------------------------------------------//
//! split_iterator
/*!
Split iterator encapsulates a Finder and allows
for incremental searching in a string.
Unlike the find iterator, split iterator iterates
through gaps between matches.
Find iterator is a readable forward traversal iterator.
Dereferencing the iterator yields an iterator_range delimiting
the current match.
*/
template<typename IteratorT>
class split_iterator :
public iterator_facade<
split_iterator<IteratorT>,
const iterator_range<IteratorT>,
forward_traversal_tag >,
private detail::find_iterator_base<IteratorT>
{
private:
// facade support
friend class ::boost::iterator_core_access;
private:
// typedefs
typedef detail::find_iterator_base<IteratorT> base_type;
typedef BOOST_STRING_TYPENAME
base_type::input_iterator_type input_iterator_type;
typedef BOOST_STRING_TYPENAME
base_type::match_type match_type;
public:
//! Default constructor
/*!
Construct null iterator. All null iterators are equal.
\post eof()==true
*/
split_iterator() {}
//! Copy constructor
/*!
Construct a copy of the split_iterator
*/
split_iterator( const split_iterator& Other ) :
base_type(Other),
m_Match(Other.m_Match),
m_Next(Other.m_Next),
m_End(Other.m_End),
m_bEof(Other.m_bEof)
{}
//! Constructor
/*!
Construct new split_iterator for a given finder
and a range.
*/
template<typename FinderT>
split_iterator(
IteratorT Begin,
IteratorT End,
FinderT Finder ) :
detail::find_iterator_base<IteratorT>(Finder,0),
m_Match(Begin,Begin),
m_Next(Begin),
m_End(End),
m_bEof(false)
{
// force the correct behavior for empty sequences and yield at least one token
if(Begin!=End)
{
increment();
}
}
//! Constructor
/*!
Construct new split_iterator for a given finder
and a collection.
*/
template<typename FinderT, typename RangeT>
split_iterator(
RangeT& Col,
FinderT Finder ) :
detail::find_iterator_base<IteratorT>(Finder,0),
m_bEof(false)
{
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_col(::boost::as_literal(Col));
m_Match=make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col));
m_Next=::boost::begin(lit_col);
m_End=::boost::end(lit_col);
// force the correct behavior for empty sequences and yield at least one token
if(m_Next!=m_End)
{
increment();
}
}
private:
// iterator operations
// dereference
const match_type& dereference() const
{
return m_Match;
}
// increment
void increment()
{
match_type FindMatch=this->do_find( m_Next, m_End );
if(FindMatch.begin()==m_End && FindMatch.end()==m_End)
{
if(m_Match.end()==m_End)
{
// Mark iterator as eof
m_bEof=true;
}
}
m_Match=match_type( m_Next, FindMatch.begin() );
m_Next=FindMatch.end();
}
// comparison
bool equal( const split_iterator& Other ) const
{
bool bEof=eof();
bool bOtherEof=Other.eof();
return bEof || bOtherEof ? bEof==bOtherEof :
(
m_Match==Other.m_Match &&
m_Next==Other.m_Next &&
m_End==Other.m_End
);
}
public:
// operations
//! Eof check
/*!
Check the eof condition. Eof condition means that
there is nothing more to be searched i.e. find_iterator
is after the last match.
*/
bool eof() const
{
return this->is_null() || m_bEof;
}
private:
// Attributes
match_type m_Match;
input_iterator_type m_Next;
input_iterator_type m_End;
bool m_bEof;
};
//! split iterator construction helper
/*!
* Construct a split iterator to iterate through the specified collection
*/
template<typename RangeT, typename FinderT>
inline split_iterator<
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
make_split_iterator(
RangeT& Collection,
FinderT Finder)
{
return split_iterator<BOOST_STRING_TYPENAME range_iterator<RangeT>::type>(
Collection, Finder);
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::find_iterator;
using algorithm::make_find_iterator;
using algorithm::split_iterator;
using algorithm::make_split_iterator;
} // namespace boost
#endif // BOOST_STRING_FIND_ITERATOR_HPP
@@ -1,270 +0,0 @@
// Boost string_algo library finder.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FINDER_HPP
#define BOOST_STRING_FINDER_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/algorithm/string/constants.hpp>
#include <boost/algorithm/string/detail/finder.hpp>
#include <boost/algorithm/string/compare.hpp>
/*! \file
Defines Finder generators. Finder object is a functor which is able to
find a substring matching a specific criteria in the input.
Finders are used as a pluggable components for replace, find
and split facilities. This header contains generator functions
for finders provided in this library.
*/
namespace boost {
namespace algorithm {
// Finder generators ------------------------------------------//
//! "First" finder
/*!
Construct the \c first_finder. The finder searches for the first
occurrence of the string in a given input.
The result is given as an \c iterator_range delimiting the match.
\param Search A substring to be searched for.
\param Comp An element comparison predicate
\return An instance of the \c first_finder object
*/
template<typename RangeT>
inline detail::first_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
is_equal>
first_finder( const RangeT& Search )
{
return
detail::first_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
is_equal>( ::boost::as_literal(Search), is_equal() ) ;
}
//! "First" finder
/*!
\overload
*/
template<typename RangeT,typename PredicateT>
inline detail::first_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
PredicateT>
first_finder(
const RangeT& Search, PredicateT Comp )
{
return
detail::first_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
PredicateT>( ::boost::as_literal(Search), Comp );
}
//! "Last" finder
/*!
Construct the \c last_finder. The finder searches for the last
occurrence of the string in a given input.
The result is given as an \c iterator_range delimiting the match.
\param Search A substring to be searched for.
\param Comp An element comparison predicate
\return An instance of the \c last_finder object
*/
template<typename RangeT>
inline detail::last_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
is_equal>
last_finder( const RangeT& Search )
{
return
detail::last_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
is_equal>( ::boost::as_literal(Search), is_equal() );
}
//! "Last" finder
/*!
\overload
*/
template<typename RangeT, typename PredicateT>
inline detail::last_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
PredicateT>
last_finder( const RangeT& Search, PredicateT Comp )
{
return
detail::last_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
PredicateT>( ::boost::as_literal(Search), Comp ) ;
}
//! "Nth" finder
/*!
Construct the \c nth_finder. The finder searches for the n-th (zero-indexed)
occurrence of the string in a given input.
The result is given as an \c iterator_range delimiting the match.
\param Search A substring to be searched for.
\param Nth An index of the match to be find
\param Comp An element comparison predicate
\return An instance of the \c nth_finder object
*/
template<typename RangeT>
inline detail::nth_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
is_equal>
nth_finder(
const RangeT& Search,
int Nth)
{
return
detail::nth_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
is_equal>( ::boost::as_literal(Search), Nth, is_equal() ) ;
}
//! "Nth" finder
/*!
\overload
*/
template<typename RangeT, typename PredicateT>
inline detail::nth_finderF<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
PredicateT>
nth_finder(
const RangeT& Search,
int Nth,
PredicateT Comp )
{
return
detail::nth_finderF<
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type,
PredicateT>( ::boost::as_literal(Search), Nth, Comp );
}
//! "Head" finder
/*!
Construct the \c head_finder. The finder returns a head of a given
input. The head is a prefix of a string up to n elements in
size. If an input has less then n elements, whole input is
considered a head.
The result is given as an \c iterator_range delimiting the match.
\param N The size of the head
\return An instance of the \c head_finder object
*/
inline detail::head_finderF
head_finder( int N )
{
return detail::head_finderF(N);
}
//! "Tail" finder
/*!
Construct the \c tail_finder. The finder returns a tail of a given
input. The tail is a suffix of a string up to n elements in
size. If an input has less then n elements, whole input is
considered a head.
The result is given as an \c iterator_range delimiting the match.
\param N The size of the head
\return An instance of the \c tail_finder object
*/
inline detail::tail_finderF
tail_finder( int N )
{
return detail::tail_finderF(N);
}
//! "Token" finder
/*!
Construct the \c token_finder. The finder searches for a token
specified by a predicate. It is similar to std::find_if
algorithm, with an exception that it return a range of
instead of a single iterator.
If "compress token mode" is enabled, adjacent matching tokens are
concatenated into one match. Thus the finder can be used to
search for continuous segments of characters satisfying the
given predicate.
The result is given as an \c iterator_range delimiting the match.
\param Pred An element selection predicate
\param eCompress Compress flag
\return An instance of the \c token_finder object
*/
template< typename PredicateT >
inline detail::token_finderF<PredicateT>
token_finder(
PredicateT Pred,
token_compress_mode_type eCompress=token_compress_off )
{
return detail::token_finderF<PredicateT>( Pred, eCompress );
}
//! "Range" finder
/*!
Construct the \c range_finder. The finder does not perform
any operation. It simply returns the given range for
any input.
\param Begin Beginning of the range
\param End End of the range
\param Range The range.
\return An instance of the \c range_finger object
*/
template< typename ForwardIteratorT >
inline detail::range_finderF<ForwardIteratorT>
range_finder(
ForwardIteratorT Begin,
ForwardIteratorT End )
{
return detail::range_finderF<ForwardIteratorT>( Begin, End );
}
//! "Range" finder
/*!
\overload
*/
template< typename ForwardIteratorT >
inline detail::range_finderF<ForwardIteratorT>
range_finder( iterator_range<ForwardIteratorT> Range )
{
return detail::range_finderF<ForwardIteratorT>( Range );
}
} // namespace algorithm
// pull the names to the boost namespace
using algorithm::first_finder;
using algorithm::last_finder;
using algorithm::nth_finder;
using algorithm::head_finder;
using algorithm::tail_finder;
using algorithm::token_finder;
using algorithm::range_finder;
} // namespace boost
#endif // BOOST_STRING_FINDER_HPP
@@ -1,120 +0,0 @@
// Boost string_algo library formatter.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_FORMATTER_HPP
#define BOOST_STRING_FORMATTER_HPP
#include <boost/detail/iterator.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/detail/formatter.hpp>
/*! \file
Defines Formatter generators. Formatter is a functor which formats
a string according to given parameters. A Formatter works
in conjunction with a Finder. A Finder can provide additional information
for a specific Formatter. An example of such a cooperation is regex_finder
and regex_formatter.
Formatters are used as pluggable components for replace facilities.
This header contains generator functions for the Formatters provided in this library.
*/
namespace boost {
namespace algorithm {
// generic formatters ---------------------------------------------------------------//
//! Constant formatter
/*!
Constructs a \c const_formatter. Const formatter always returns
the same value, regardless of the parameter.
\param Format A predefined value used as a result for formating
\return An instance of the \c const_formatter object.
*/
template<typename RangeT>
inline detail::const_formatF<
iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >
const_formatter(const RangeT& Format)
{
return detail::const_formatF<
iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(::boost::as_literal(Format));
}
//! Identity formatter
/*!
Constructs an \c identity_formatter. Identity formatter always returns
the parameter.
\return An instance of the \c identity_formatter object.
*/
template<typename RangeT>
inline detail::identity_formatF<
iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >
identity_formatter()
{
return detail::identity_formatF<
iterator_range<
BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
}
//! Empty formatter
/*!
Constructs an \c empty_formatter. Empty formatter always returns an empty
sequence.
\param Input container used to select a correct value_type for the
resulting empty_container<>.
\return An instance of the \c empty_formatter object.
*/
template<typename RangeT>
inline detail::empty_formatF<
BOOST_STRING_TYPENAME range_value<RangeT>::type>
empty_formatter(const RangeT&)
{
return detail::empty_formatF<
BOOST_STRING_TYPENAME range_value<RangeT>::type>();
}
//! Empty formatter
/*!
Constructs a \c dissect_formatter. Dissect formatter uses a specified finder
to extract a portion of the formatted sequence. The first finder's match is returned
as a result
\param Finder a finder used to select a portion of the formated sequence
\return An instance of the \c dissect_formatter object.
*/
template<typename FinderT>
inline detail::dissect_formatF< FinderT >
dissect_formatter(const FinderT& Finder)
{
return detail::dissect_formatF<FinderT>(Finder);
}
} // namespace algorithm
// pull the names to the boost namespace
using algorithm::const_formatter;
using algorithm::identity_formatter;
using algorithm::empty_formatter;
using algorithm::dissect_formatter;
} // namespace boost
#endif // BOOST_FORMATTER_HPP
@@ -1,193 +0,0 @@
// Boost string_algo library iter_find.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_ITER_FIND_HPP
#define BOOST_STRING_ITER_FIND_HPP
#include <boost/algorithm/string/config.hpp>
#include <algorithm>
#include <iterator>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/algorithm/string/concept.hpp>
#include <boost/algorithm/string/find_iterator.hpp>
#include <boost/algorithm/string/detail/util.hpp>
/*! \file
Defines generic split algorithms. Split algorithms can be
used to divide a sequence into several part according
to a given criteria. Result is given as a 'container
of containers' where elements are copies or references
to extracted parts.
There are two algorithms provided. One iterates over matching
substrings, the other one over the gaps between these matches.
*/
namespace boost {
namespace algorithm {
// iterate find ---------------------------------------------------//
//! Iter find algorithm
/*!
This algorithm executes a given finder in iteration on the input,
until the end of input is reached, or no match is found.
Iteration is done using built-in find_iterator, so the real
searching is performed only when needed.
In each iteration new match is found and added to the result.
\param Result A 'container container' to contain the result of search.
Both outer and inner container must have constructor taking a pair
of iterators as an argument.
Typical type of the result is
\c std::vector<boost::iterator_range<iterator>>
(each element of such a vector will container a range delimiting
a match).
\param Input A container which will be searched.
\param Finder A Finder object used for searching
\return A reference the result
\note Prior content of the result will be overwritten.
*/
template<
typename SequenceSequenceT,
typename RangeT,
typename FinderT >
inline SequenceSequenceT&
iter_find(
SequenceSequenceT& Result,
RangeT& Input,
FinderT Finder )
{
BOOST_CONCEPT_ASSERT((
FinderConcept<
FinderT,
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
typedef BOOST_STRING_TYPENAME
range_iterator<RangeT>::type input_iterator_type;
typedef find_iterator<input_iterator_type> find_iterator_type;
typedef detail::copy_iterator_rangeF<
BOOST_STRING_TYPENAME
range_value<SequenceSequenceT>::type,
input_iterator_type> copy_range_type;
input_iterator_type InputEnd=::boost::end(lit_input);
typedef transform_iterator<copy_range_type, find_iterator_type>
transform_iter_type;
transform_iter_type itBegin=
::boost::make_transform_iterator(
find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
copy_range_type());
transform_iter_type itEnd=
::boost::make_transform_iterator(
find_iterator_type(),
copy_range_type());
SequenceSequenceT Tmp(itBegin, itEnd);
Result.swap(Tmp);
return Result;
}
// iterate split ---------------------------------------------------//
//! Split find algorithm
/*!
This algorithm executes a given finder in iteration on the input,
until the end of input is reached, or no match is found.
Iteration is done using built-in find_iterator, so the real
searching is performed only when needed.
Each match is used as a separator of segments. These segments are then
returned in the result.
\param Result A 'container container' to container the result of search.
Both outer and inner container must have constructor taking a pair
of iterators as an argument.
Typical type of the result is
\c std::vector<boost::iterator_range<iterator>>
(each element of such a vector will container a range delimiting
a match).
\param Input A container which will be searched.
\param Finder A finder object used for searching
\return A reference the result
\note Prior content of the result will be overwritten.
*/
template<
typename SequenceSequenceT,
typename RangeT,
typename FinderT >
inline SequenceSequenceT&
iter_split(
SequenceSequenceT& Result,
RangeT& Input,
FinderT Finder )
{
BOOST_CONCEPT_ASSERT((
FinderConcept<FinderT,
BOOST_STRING_TYPENAME range_iterator<RangeT>::type>
));
iterator_range<BOOST_STRING_TYPENAME range_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
typedef BOOST_STRING_TYPENAME
range_iterator<RangeT>::type input_iterator_type;
typedef split_iterator<input_iterator_type> find_iterator_type;
typedef detail::copy_iterator_rangeF<
BOOST_STRING_TYPENAME
range_value<SequenceSequenceT>::type,
input_iterator_type> copy_range_type;
input_iterator_type InputEnd=::boost::end(lit_input);
typedef transform_iterator<copy_range_type, find_iterator_type>
transform_iter_type;
transform_iter_type itBegin=
::boost::make_transform_iterator(
find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ),
copy_range_type() );
transform_iter_type itEnd=
::boost::make_transform_iterator(
find_iterator_type(),
copy_range_type() );
SequenceSequenceT Tmp(itBegin, itEnd);
Result.swap(Tmp);
return Result;
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::iter_find;
using algorithm::iter_split;
} // namespace boost
#endif // BOOST_STRING_ITER_FIND_HPP
@@ -1,145 +0,0 @@
// Boost string_algo library join.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_JOIN_HPP
#define BOOST_STRING_JOIN_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/detail/sequence.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/as_literal.hpp>
/*! \file
Defines join algorithm.
Join algorithm is a counterpart to split algorithms.
It joins strings from a 'list' by adding user defined separator.
Additionally there is a version that allows simple filtering
by providing a predicate.
*/
namespace boost {
namespace algorithm {
// join --------------------------------------------------------------//
//! Join algorithm
/*!
This algorithm joins all strings in a 'list' into one long string.
Segments are concatenated by given separator.
\param Input A container that holds the input strings. It must be a container-of-containers.
\param Separator A string that will separate the joined segments.
\return Concatenated string.
\note This function provides the strong exception-safety guarantee
*/
template< typename SequenceSequenceT, typename Range1T>
inline typename range_value<SequenceSequenceT>::type
join(
const SequenceSequenceT& Input,
const Range1T& Separator)
{
// Define working types
typedef typename range_value<SequenceSequenceT>::type ResultT;
typedef typename range_const_iterator<SequenceSequenceT>::type InputIteratorT;
// Parse input
InputIteratorT itBegin=::boost::begin(Input);
InputIteratorT itEnd=::boost::end(Input);
// Construct container to hold the result
ResultT Result;
// Append first element
if(itBegin!=itEnd)
{
detail::insert(Result, ::boost::end(Result), *itBegin);
++itBegin;
}
for(;itBegin!=itEnd; ++itBegin)
{
// Add separator
detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
// Add element
detail::insert(Result, ::boost::end(Result), *itBegin);
}
return Result;
}
// join_if ----------------------------------------------------------//
//! Conditional join algorithm
/*!
This algorithm joins all strings in a 'list' into one long string.
Segments are concatenated by given separator. Only segments that
satisfy the predicate will be added to the result.
\param Input A container that holds the input strings. It must be a container-of-containers.
\param Separator A string that will separate the joined segments.
\param Pred A segment selection predicate
\return Concatenated string.
\note This function provides the strong exception-safety guarantee
*/
template< typename SequenceSequenceT, typename Range1T, typename PredicateT>
inline typename range_value<SequenceSequenceT>::type
join_if(
const SequenceSequenceT& Input,
const Range1T& Separator,
PredicateT Pred)
{
// Define working types
typedef typename range_value<SequenceSequenceT>::type ResultT;
typedef typename range_const_iterator<SequenceSequenceT>::type InputIteratorT;
// Parse input
InputIteratorT itBegin=::boost::begin(Input);
InputIteratorT itEnd=::boost::end(Input);
// Construct container to hold the result
ResultT Result;
// Roll to the first element that will be added
while(itBegin!=itEnd && !Pred(*itBegin)) ++itBegin;
// Add this element
if(itBegin!=itEnd)
{
detail::insert(Result, ::boost::end(Result), *itBegin);
++itBegin;
}
for(;itBegin!=itEnd; ++itBegin)
{
if(Pred(*itBegin))
{
// Add separator
detail::insert(Result, ::boost::end(Result), ::boost::as_literal(Separator));
// Add element
detail::insert(Result, ::boost::end(Result), *itBegin);
}
}
return Result;
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::join;
using algorithm::join_if;
} // namespace boost
#endif // BOOST_STRING_JOIN_HPP
@@ -1,475 +0,0 @@
// Boost string_algo library predicate.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_PREDICATE_HPP
#define BOOST_STRING_PREDICATE_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/algorithm/string/compare.hpp>
#include <boost/algorithm/string/find.hpp>
#include <boost/algorithm/string/detail/predicate.hpp>
/*! \file boost/algorithm/string/predicate.hpp
Defines string-related predicates.
The predicates determine whether a substring is contained in the input string
under various conditions: a string starts with the substring, ends with the
substring, simply contains the substring or if both strings are equal.
Additionaly the algorithm \c all() checks all elements of a container to satisfy a
condition.
All predicates provide the strong exception guarantee.
*/
namespace boost {
namespace algorithm {
// starts_with predicate -----------------------------------------------//
//! 'Starts with' predicate
/*!
This predicate holds when the test string is a prefix of the Input.
In other words, if the input starts with the test.
When the optional predicate is specified, it is used for character-wise
comparison.
\param Input An input sequence
\param Test A test sequence
\param Comp An element comparison predicate
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T, typename PredicateT>
inline bool starts_with(
const Range1T& Input,
const Range2T& Test,
PredicateT Comp)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
typedef BOOST_STRING_TYPENAME
range_const_iterator<Range1T>::type Iterator1T;
typedef BOOST_STRING_TYPENAME
range_const_iterator<Range2T>::type Iterator2T;
Iterator1T InputEnd=::boost::end(lit_input);
Iterator2T TestEnd=::boost::end(lit_test);
Iterator1T it=::boost::begin(lit_input);
Iterator2T pit=::boost::begin(lit_test);
for(;
it!=InputEnd && pit!=TestEnd;
++it,++pit)
{
if( !(Comp(*it,*pit)) )
return false;
}
return pit==TestEnd;
}
//! 'Starts with' predicate
/*!
\overload
*/
template<typename Range1T, typename Range2T>
inline bool starts_with(
const Range1T& Input,
const Range2T& Test)
{
return ::boost::algorithm::starts_with(Input, Test, is_equal());
}
//! 'Starts with' predicate ( case insensitive )
/*!
This predicate holds when the test string is a prefix of the Input.
In other words, if the input starts with the test.
Elements are compared case insensitively.
\param Input An input sequence
\param Test A test sequence
\param Loc A locale used for case insensitive comparison
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline bool istarts_with(
const Range1T& Input,
const Range2T& Test,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::starts_with(Input, Test, is_iequal(Loc));
}
// ends_with predicate -----------------------------------------------//
//! 'Ends with' predicate
/*!
This predicate holds when the test string is a suffix of the Input.
In other words, if the input ends with the test.
When the optional predicate is specified, it is used for character-wise
comparison.
\param Input An input sequence
\param Test A test sequence
\param Comp An element comparison predicate
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T, typename PredicateT>
inline bool ends_with(
const Range1T& Input,
const Range2T& Test,
PredicateT Comp)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
typedef BOOST_STRING_TYPENAME
range_const_iterator<Range1T>::type Iterator1T;
typedef BOOST_STRING_TYPENAME boost::detail::
iterator_traits<Iterator1T>::iterator_category category;
return detail::
ends_with_iter_select(
::boost::begin(lit_input),
::boost::end(lit_input),
::boost::begin(lit_test),
::boost::end(lit_test),
Comp,
category());
}
//! 'Ends with' predicate
/*!
\overload
*/
template<typename Range1T, typename Range2T>
inline bool ends_with(
const Range1T& Input,
const Range2T& Test)
{
return ::boost::algorithm::ends_with(Input, Test, is_equal());
}
//! 'Ends with' predicate ( case insensitive )
/*!
This predicate holds when the test container is a suffix of the Input.
In other words, if the input ends with the test.
Elements are compared case insensitively.
\param Input An input sequence
\param Test A test sequence
\param Loc A locale used for case insensitive comparison
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline bool iends_with(
const Range1T& Input,
const Range2T& Test,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::ends_with(Input, Test, is_iequal(Loc));
}
// contains predicate -----------------------------------------------//
//! 'Contains' predicate
/*!
This predicate holds when the test container is contained in the Input.
When the optional predicate is specified, it is used for character-wise
comparison.
\param Input An input sequence
\param Test A test sequence
\param Comp An element comparison predicate
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T, typename PredicateT>
inline bool contains(
const Range1T& Input,
const Range2T& Test,
PredicateT Comp)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
if (::boost::empty(lit_test))
{
// Empty range is contained always
return true;
}
// Use the temporary variable to make VACPP happy
bool bResult=(::boost::algorithm::first_finder(lit_test,Comp)(::boost::begin(lit_input), ::boost::end(lit_input)));
return bResult;
}
//! 'Contains' predicate
/*!
\overload
*/
template<typename Range1T, typename Range2T>
inline bool contains(
const Range1T& Input,
const Range2T& Test)
{
return ::boost::algorithm::contains(Input, Test, is_equal());
}
//! 'Contains' predicate ( case insensitive )
/*!
This predicate holds when the test container is contained in the Input.
Elements are compared case insensitively.
\param Input An input sequence
\param Test A test sequence
\param Loc A locale used for case insensitive comparison
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline bool icontains(
const Range1T& Input,
const Range2T& Test,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::contains(Input, Test, is_iequal(Loc));
}
// equals predicate -----------------------------------------------//
//! 'Equals' predicate
/*!
This predicate holds when the test container is equal to the
input container i.e. all elements in both containers are same.
When the optional predicate is specified, it is used for character-wise
comparison.
\param Input An input sequence
\param Test A test sequence
\param Comp An element comparison predicate
\return The result of the test
\note This is a two-way version of \c std::equal algorithm
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T, typename PredicateT>
inline bool equals(
const Range1T& Input,
const Range2T& Test,
PredicateT Comp)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
typedef BOOST_STRING_TYPENAME
range_const_iterator<Range1T>::type Iterator1T;
typedef BOOST_STRING_TYPENAME
range_const_iterator<Range2T>::type Iterator2T;
Iterator1T InputEnd=::boost::end(lit_input);
Iterator2T TestEnd=::boost::end(lit_test);
Iterator1T it=::boost::begin(lit_input);
Iterator2T pit=::boost::begin(lit_test);
for(;
it!=InputEnd && pit!=TestEnd;
++it,++pit)
{
if( !(Comp(*it,*pit)) )
return false;
}
return (pit==TestEnd) && (it==InputEnd);
}
//! 'Equals' predicate
/*!
\overload
*/
template<typename Range1T, typename Range2T>
inline bool equals(
const Range1T& Input,
const Range2T& Test)
{
return ::boost::algorithm::equals(Input, Test, is_equal());
}
//! 'Equals' predicate ( case insensitive )
/*!
This predicate holds when the test container is equal to the
input container i.e. all elements in both containers are same.
Elements are compared case insensitively.
\param Input An input sequence
\param Test A test sequence
\param Loc A locale used for case insensitive comparison
\return The result of the test
\note This is a two-way version of \c std::equal algorithm
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline bool iequals(
const Range1T& Input,
const Range2T& Test,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::equals(Input, Test, is_iequal(Loc));
}
// lexicographical_compare predicate -----------------------------//
//! Lexicographical compare predicate
/*!
This predicate is an overload of std::lexicographical_compare
for range arguments
It check whether the first argument is lexicographically less
then the second one.
If the optional predicate is specified, it is used for character-wise
comparison
\param Arg1 First argument
\param Arg2 Second argument
\param Pred Comparison predicate
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T, typename PredicateT>
inline bool lexicographical_compare(
const Range1T& Arg1,
const Range2T& Arg2,
PredicateT Pred)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_arg1(::boost::as_literal(Arg1));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_arg2(::boost::as_literal(Arg2));
return std::lexicographical_compare(
::boost::begin(lit_arg1),
::boost::end(lit_arg1),
::boost::begin(lit_arg2),
::boost::end(lit_arg2),
Pred);
}
//! Lexicographical compare predicate
/*!
\overload
*/
template<typename Range1T, typename Range2T>
inline bool lexicographical_compare(
const Range1T& Arg1,
const Range2T& Arg2)
{
return ::boost::algorithm::lexicographical_compare(Arg1, Arg2, is_less());
}
//! Lexicographical compare predicate (case-insensitive)
/*!
This predicate is an overload of std::lexicographical_compare
for range arguments.
It check whether the first argument is lexicographically less
then the second one.
Elements are compared case insensitively
\param Arg1 First argument
\param Arg2 Second argument
\param Loc A locale used for case insensitive comparison
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename Range1T, typename Range2T>
inline bool ilexicographical_compare(
const Range1T& Arg1,
const Range2T& Arg2,
const std::locale& Loc=std::locale())
{
return ::boost::algorithm::lexicographical_compare(Arg1, Arg2, is_iless(Loc));
}
// all predicate -----------------------------------------------//
//! 'All' predicate
/*!
This predicate holds it all its elements satisfy a given
condition, represented by the predicate.
\param Input An input sequence
\param Pred A predicate
\return The result of the test
\note This function provides the strong exception-safety guarantee
*/
template<typename RangeT, typename PredicateT>
inline bool all(
const RangeT& Input,
PredicateT Pred)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::boost::as_literal(Input));
typedef BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type Iterator1T;
Iterator1T InputEnd=::boost::end(lit_input);
for( Iterator1T It=::boost::begin(lit_input); It!=InputEnd; ++It)
{
if (!Pred(*It))
return false;
}
return true;
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::starts_with;
using algorithm::istarts_with;
using algorithm::ends_with;
using algorithm::iends_with;
using algorithm::contains;
using algorithm::icontains;
using algorithm::equals;
using algorithm::iequals;
using algorithm::all;
using algorithm::lexicographical_compare;
using algorithm::ilexicographical_compare;
} // namespace boost
#endif // BOOST_STRING_PREDICATE_HPP
@@ -1,42 +0,0 @@
// Boost string_algo library predicate_facade.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_PREDICATE_FACADE_HPP
#define BOOST_STRING_PREDICATE_FACADE_HPP
#include <boost/algorithm/string/config.hpp>
/*
\file boost/algorith/string/predicate_facade.hpp
This file containes predicate_facade definition. This template class is used
to identify classification predicates, so they can be combined using
composition operators.
*/
namespace boost {
namespace algorithm {
// predicate facade ------------------------------------------------------//
//! Predicate facade
/*!
This class allows to recognize classification
predicates, so that they can be combined using
composition operators.
Every classification predicate must be derived from this class.
*/
template<typename Derived>
struct predicate_facade {};
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_CLASSIFICATION_DETAIL_HPP
@@ -1,928 +0,0 @@
// Boost string_algo library replace.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_REPLACE_HPP
#define BOOST_STRING_REPLACE_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/algorithm/string/find_format.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/formatter.hpp>
#include <boost/algorithm/string/compare.hpp>
/*! \file
Defines various replace algorithms. Each algorithm replaces
part(s) of the input according to set of searching and replace criteria.
*/
namespace boost {
namespace algorithm {
// replace_range --------------------------------------------------------------------//
//! Replace range algorithm
/*!
Replace the given range in the input string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param SearchRange A range in the input to be substituted
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT replace_range_copy(
OutputIteratorT Output,
const Range1T& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_const_iterator<Range1T>::type>& SearchRange,
const Range2T& Format)
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::const_formatter(Format));
}
//! Replace range algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT replace_range_copy(
const SequenceT& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_const_iterator<SequenceT>::type>& SearchRange,
const RangeT& Format)
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::const_formatter(Format));
}
//! Replace range algorithm
/*!
Replace the given range in the input string.
The input sequence is modified in-place.
\param Input An input string
\param SearchRange A range in the input to be substituted
\param Format A substitute string
*/
template<typename SequenceT, typename RangeT>
inline void replace_range(
SequenceT& Input,
const iterator_range<
BOOST_STRING_TYPENAME
range_iterator<SequenceT>::type>& SearchRange,
const RangeT& Format)
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::range_finder(SearchRange),
::boost::algorithm::const_formatter(Format));
}
// replace_first --------------------------------------------------------------------//
//! Replace first algorithm
/*!
Replace the first match of the search substring in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT replace_first_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format)
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace first algorithm
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT replace_first_copy(
const SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace first algorithm
/*!
replace the first match of the search substring in the input
with the format string. The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void replace_first(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
// replace_first ( case insensitive ) ---------------------------------------------//
//! Replace first algorithm ( case insensitive )
/*!
Replace the first match of the search substring in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT ireplace_first_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace first algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename Range2T, typename Range1T>
inline SequenceT ireplace_first_copy(
const SequenceT& Input,
const Range2T& Search,
const Range1T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace first algorithm ( case insensitive )
/*!
Replace the first match of the search substring in the input
with the format string. Input sequence is modified in-place.
Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void ireplace_first(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
// replace_last --------------------------------------------------------------------//
//! Replace last algorithm
/*!
Replace the last match of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT replace_last_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace last algorithm
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT replace_last_copy(
const SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace last algorithm
/*!
Replace the last match of the search string in the input
with the format string. Input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void replace_last(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::last_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
// replace_last ( case insensitive ) -----------------------------------------------//
//! Replace last algorithm ( case insensitive )
/*!
Replace the last match of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT ireplace_last_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace last algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT ireplace_last_copy(
const SequenceT& Input,
const Range1T& Search,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace last algorithm ( case insensitive )
/*!
Replace the last match of the search string in the input
with the format string.The input sequence is modified in-place.
Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
\return A reference to the modified input
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void ireplace_last(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::last_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
// replace_nth --------------------------------------------------------------------//
//! Replace nth algorithm
/*!
Replace an Nth (zero-indexed) match of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT replace_nth_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
int Nth,
const Range3T& Format )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::const_formatter(Format) );
}
//! Replace nth algorithm
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT replace_nth_copy(
const SequenceT& Input,
const Range1T& Search,
int Nth,
const Range2T& Format )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::const_formatter(Format) );
}
//! Replace nth algorithm
/*!
Replace an Nth (zero-indexed) match of the search string in the input
with the format string. Input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Format A substitute string
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void replace_nth(
SequenceT& Input,
const Range1T& Search,
int Nth,
const Range2T& Format )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::nth_finder(Search, Nth),
::boost::algorithm::const_formatter(Format) );
}
// replace_nth ( case insensitive ) -----------------------------------------------//
//! Replace nth algorithm ( case insensitive )
/*!
Replace an Nth (zero-indexed) match of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT ireplace_nth_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
int Nth,
const Range3T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc) ),
::boost::algorithm::const_formatter(Format) );
}
//! Replace nth algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT ireplace_nth_copy(
const SequenceT& Input,
const Range1T& Search,
int Nth,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace nth algorithm ( case insensitive )
/*!
Replace an Nth (zero-indexed) match of the search string in the input
with the format string. Input sequence is modified in-place.
Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Nth An index of the match to be replaced. The index is 0-based.
For negative N, matches are counted from the end of string.
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void ireplace_nth(
SequenceT& Input,
const Range1T& Search,
int Nth,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
// replace_all --------------------------------------------------------------------//
//! Replace all algorithm
/*!
Replace all occurrences of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT replace_all_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format )
{
return ::boost::algorithm::find_format_all_copy(
Output,
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace all algorithm
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT replace_all_copy(
const SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
return ::boost::algorithm::find_format_all_copy(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
//! Replace all algorithm
/*!
Replace all occurrences of the search string in the input
with the format string. The input sequence is modified in-place.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\return A reference to the modified input
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void replace_all(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format )
{
::boost::algorithm::find_format_all(
Input,
::boost::algorithm::first_finder(Search),
::boost::algorithm::const_formatter(Format) );
}
// replace_all ( case insensitive ) -----------------------------------------------//
//! Replace all algorithm ( case insensitive )
/*!
Replace all occurrences of the search string in the input
with the format string.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
Searching is case insensitive.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T,
typename Range3T>
inline OutputIteratorT ireplace_all_copy(
OutputIteratorT Output,
const Range1T& Input,
const Range2T& Search,
const Range3T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_all_copy(
Output,
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace all algorithm ( case insensitive )
/*!
\overload
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline SequenceT ireplace_all_copy(
const SequenceT& Input,
const Range1T& Search,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::find_format_all_copy(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
//! Replace all algorithm ( case insensitive )
/*!
Replace all occurrences of the search string in the input
with the format string.The input sequence is modified in-place.
Searching is case insensitive.
\param Input An input string
\param Search A substring to be searched for
\param Format A substitute string
\param Loc A locale used for case insensitive comparison
*/
template<typename SequenceT, typename Range1T, typename Range2T>
inline void ireplace_all(
SequenceT& Input,
const Range1T& Search,
const Range2T& Format,
const std::locale& Loc=std::locale() )
{
::boost::algorithm::find_format_all(
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc)),
::boost::algorithm::const_formatter(Format) );
}
// replace_head --------------------------------------------------------------------//
//! Replace head algorithm
/*!
Replace the head of the input with the given format string.
The head is a prefix of a string of given size.
If the sequence is shorter then required, whole string if
considered to be the head.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param N Length of the head.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT replace_head_copy(
OutputIteratorT Output,
const Range1T& Input,
int N,
const Range2T& Format )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::const_formatter(Format) );
}
//! Replace head algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT replace_head_copy(
const SequenceT& Input,
int N,
const RangeT& Format )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::const_formatter(Format) );
}
//! Replace head algorithm
/*!
Replace the head of the input with the given format string.
The head is a prefix of a string of given size.
If the sequence is shorter then required, the whole string is
considered to be the head. The input sequence is modified in-place.
\param Input An input string
\param N Length of the head.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\param Format A substitute string
*/
template<typename SequenceT, typename RangeT>
inline void replace_head(
SequenceT& Input,
int N,
const RangeT& Format )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::head_finder(N),
::boost::algorithm::const_formatter(Format) );
}
// replace_tail --------------------------------------------------------------------//
//! Replace tail algorithm
/*!
Replace the tail of the input with the given format string.
The tail is a suffix of a string of given size.
If the sequence is shorter then required, whole string is
considered to be the tail.
The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator.
\param Output An output iterator to which the result will be copied
\param Input An input string
\param N Length of the tail.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\param Format A substitute string
\return An output iterator pointing just after the last inserted character or
a modified copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<
typename OutputIteratorT,
typename Range1T,
typename Range2T>
inline OutputIteratorT replace_tail_copy(
OutputIteratorT Output,
const Range1T& Input,
int N,
const Range2T& Format )
{
return ::boost::algorithm::find_format_copy(
Output,
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::const_formatter(Format) );
}
//! Replace tail algorithm
/*!
\overload
*/
template<typename SequenceT, typename RangeT>
inline SequenceT replace_tail_copy(
const SequenceT& Input,
int N,
const RangeT& Format )
{
return ::boost::algorithm::find_format_copy(
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::const_formatter(Format) );
}
//! Replace tail algorithm
/*!
Replace the tail of the input with the given format sequence.
The tail is a suffix of a string of given size.
If the sequence is shorter then required, the whole string is
considered to be the tail. The input sequence is modified in-place.
\param Input An input string
\param N Length of the tail.
For N>=0, at most N characters are extracted.
For N<0, size(Input)-|N| characters are extracted.
\param Format A substitute string
*/
template<typename SequenceT, typename RangeT>
inline void replace_tail(
SequenceT& Input,
int N,
const RangeT& Format )
{
::boost::algorithm::find_format(
Input,
::boost::algorithm::tail_finder(N),
::boost::algorithm::const_formatter(Format) );
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::replace_range_copy;
using algorithm::replace_range;
using algorithm::replace_first_copy;
using algorithm::replace_first;
using algorithm::ireplace_first_copy;
using algorithm::ireplace_first;
using algorithm::replace_last_copy;
using algorithm::replace_last;
using algorithm::ireplace_last_copy;
using algorithm::ireplace_last;
using algorithm::replace_nth_copy;
using algorithm::replace_nth;
using algorithm::ireplace_nth_copy;
using algorithm::ireplace_nth;
using algorithm::replace_all_copy;
using algorithm::replace_all;
using algorithm::ireplace_all_copy;
using algorithm::ireplace_all;
using algorithm::replace_head_copy;
using algorithm::replace_head;
using algorithm::replace_tail_copy;
using algorithm::replace_tail;
} // namespace boost
#endif // BOOST_REPLACE_HPP
@@ -1,193 +0,0 @@
// Boost string_algo library sequence_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_SEQUENCE_TRAITS_HPP
#define BOOST_STRING_SEQUENCE_TRAITS_HPP
#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/yes_no_type.hpp>
/*! \file
Traits defined in this header are used by various algorithms to achieve
better performance for specific containers.
Traits provide fail-safe defaults. If a container supports some of these
features, it is possible to specialize the specific trait for this container.
For lacking compilers, it is possible of define an override for a specific tester
function.
Due to a language restriction, it is not currently possible to define specializations for
stl containers without including the corresponding header. To decrease the overhead
needed by this inclusion, user can selectively include a specialization
header for a specific container. They are located in boost/algorithm/string/stl
directory. Alternatively she can include boost/algorithm/string/std_collection_traits.hpp
header which contains specializations for all stl containers.
*/
namespace boost {
namespace algorithm {
// sequence traits -----------------------------------------------//
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
//! Native replace tester
/*!
Declare an override of this tester function with return
type boost::string_algo::yes_type for a sequence with this property.
\return yes_type if the container has basic_string like native replace
method.
*/
no_type has_native_replace_tester(...);
//! Stable iterators tester
/*!
Declare an override of this tester function with return
type boost::string_algo::yes_type for a sequence with this property.
\return yes_type if the sequence's insert/replace/erase methods do not invalidate
existing iterators.
*/
no_type has_stable_iterators_tester(...);
//! const time insert tester
/*!
Declare an override of this tester function with return
type boost::string_algo::yes_type for a sequence with this property.
\return yes_type if the sequence's insert method is working in constant time
*/
no_type has_const_time_insert_tester(...);
//! const time erase tester
/*!
Declare an override of this tester function with return
type boost::string_algo::yes_type for a sequence with this property.
\return yes_type if the sequence's erase method is working in constant time
*/
no_type has_const_time_erase_tester(...);
#endif //BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
//! Native replace trait
/*!
This trait specifies that the sequence has \c std::string like replace method
*/
template< typename T >
class has_native_replace
{
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_native_replace_tester(t))==sizeof(yes_type) ) );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = false };
# else
BOOST_STATIC_CONSTANT(bool, value=false);
# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef mpl::bool_<has_native_replace<T>::value> type;
};
//! Stable iterators trait
/*!
This trait specifies that the sequence has stable iterators. It means
that operations like insert/erase/replace do not invalidate iterators.
*/
template< typename T >
class has_stable_iterators
{
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_stable_iterators_tester(t))==sizeof(yes_type) ) );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = false };
# else
BOOST_STATIC_CONSTANT(bool, value=false);
# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef mpl::bool_<has_stable_iterators<T>::value> type;
};
//! Const time insert trait
/*!
This trait specifies that the sequence's insert method has
constant time complexity.
*/
template< typename T >
class has_const_time_insert
{
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_const_time_insert_tester(t))==sizeof(yes_type) ) );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = false };
# else
BOOST_STATIC_CONSTANT(bool, value=false);
# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef mpl::bool_<has_const_time_insert<T>::value> type;
};
//! Const time erase trait
/*!
This trait specifies that the sequence's erase method has
constant time complexity.
*/
template< typename T >
class has_const_time_erase
{
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_const_time_erase_tester(t))==sizeof(yes_type) ) );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = false };
# else
BOOST_STATIC_CONSTANT(bool, value=false);
# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef mpl::bool_<has_const_time_erase<T>::value> type;
};
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_SEQUENCE_TRAITS_HPP
@@ -1,163 +0,0 @@
// Boost string_algo library split.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2006.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_SPLIT_HPP
#define BOOST_STRING_SPLIT_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/iter_find.hpp>
#include <boost/algorithm/string/finder.hpp>
#include <boost/algorithm/string/compare.hpp>
/*! \file
Defines basic split algorithms.
Split algorithms can be used to divide a string
into several parts according to given criteria.
Each part is copied and added as a new element to the
output container.
Thus the result container must be able to hold copies
of the matches (in a compatible structure like std::string) or
a reference to it (e.g. using the iterator range class).
Examples of such a container are \c std::vector<std::string>
or \c std::list<boost::iterator_range<std::string::iterator>>
*/
namespace boost {
namespace algorithm {
// find_all ------------------------------------------------------------//
//! Find all algorithm
/*!
This algorithm finds all occurrences of the search string
in the input.
Each part is copied and added as a new element to the
output container.
Thus the result container must be able to hold copies
of the matches (in a compatible structure like std::string) or
a reference to it (e.g. using the iterator range class).
Examples of such a container are \c std::vector<std::string>
or \c std::list<boost::iterator_range<std::string::iterator>>
\param Result A container that can hold copies of references to the substrings
\param Input A container which will be searched.
\param Search A substring to be searched for.
\return A reference the result
\note Prior content of the result will be overwritten.
\note This function provides the strong exception-safety guarantee
*/
template< typename SequenceSequenceT, typename Range1T, typename Range2T >
inline SequenceSequenceT& find_all(
SequenceSequenceT& Result,
Range1T& Input,
const Range2T& Search)
{
return ::boost::algorithm::iter_find(
Result,
Input,
::boost::algorithm::first_finder(Search) );
}
//! Find all algorithm ( case insensitive )
/*!
This algorithm finds all occurrences of the search string
in the input.
Each part is copied and added as a new element to the
output container. Thus the result container must be able to hold copies
of the matches (in a compatible structure like std::string) or
a reference to it (e.g. using the iterator range class).
Examples of such a container are \c std::vector<std::string>
or \c std::list<boost::iterator_range<std::string::iterator>>
Searching is case insensitive.
\param Result A container that can hold copies of references to the substrings
\param Input A container which will be searched.
\param Search A substring to be searched for.
\param Loc A locale used for case insensitive comparison
\return A reference the result
\note Prior content of the result will be overwritten.
\note This function provides the strong exception-safety guarantee
*/
template< typename SequenceSequenceT, typename Range1T, typename Range2T >
inline SequenceSequenceT& ifind_all(
SequenceSequenceT& Result,
Range1T& Input,
const Range2T& Search,
const std::locale& Loc=std::locale() )
{
return ::boost::algorithm::iter_find(
Result,
Input,
::boost::algorithm::first_finder(Search, is_iequal(Loc) ) );
}
// tokenize -------------------------------------------------------------//
//! Split algorithm
/*!
Tokenize expression. This function is equivalent to C strtok. Input
sequence is split into tokens, separated by separators. Separators
are given by means of the predicate.
Each part is copied and added as a new element to the
output container.
Thus the result container must be able to hold copies
of the matches (in a compatible structure like std::string) or
a reference to it (e.g. using the iterator range class).
Examples of such a container are \c std::vector<std::string>
or \c std::list<boost::iterator_range<std::string::iterator>>
\param Result A container that can hold copies of references to the substrings
\param Input A container which will be searched.
\param Pred A predicate to identify separators. This predicate is
supposed to return true if a given element is a separator.
\param eCompress If eCompress argument is set to token_compress_on, adjacent
separators are merged together. Otherwise, every two separators
delimit a token.
\return A reference the result
\note Prior content of the result will be overwritten.
\note This function provides the strong exception-safety guarantee
*/
template< typename SequenceSequenceT, typename RangeT, typename PredicateT >
inline SequenceSequenceT& split(
SequenceSequenceT& Result,
RangeT& Input,
PredicateT Pred,
token_compress_mode_type eCompress=token_compress_off )
{
return ::boost::algorithm::iter_split(
Result,
Input,
::boost::algorithm::token_finder( Pred, eCompress ) );
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::find_all;
using algorithm::ifind_all;
using algorithm::split;
} // namespace boost
#endif // BOOST_STRING_SPLIT_HPP
@@ -1,85 +0,0 @@
// Boost string_algo library list_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_STD_LIST_TRAITS_HPP
#define BOOST_STRING_STD_LIST_TRAITS_HPP
#include <boost/algorithm/string/yes_no_type.hpp>
#include <list>
#include <boost/algorithm/string/sequence_traits.hpp>
namespace boost {
namespace algorithm {
// std::list<> traits -----------------------------------------------//
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// stable iterators tester
template<typename T, typename AllocT>
yes_type has_stable_iterators_tester( const ::std::list<T,AllocT>* );
// const time insert tester
template<typename T, typename AllocT>
yes_type has_const_time_insert_tester( const ::std::list<T,AllocT>* );
// const time erase tester
template<typename T, typename AllocT>
yes_type has_const_time_erase_tester( const ::std::list<T,AllocT>* );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// stable iterators trait
template<typename T, typename AllocT>
class has_stable_iterators< ::std::list<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_stable_iterators<T>::value> type;
};
// const time insert trait
template<typename T, typename AllocT>
class has_const_time_insert< ::std::list<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_const_time_insert<T>::value> type;
};
// const time erase trait
template<typename T, typename AllocT>
class has_const_time_erase< ::std::list<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_const_time_erase<T>::value> type;
};
#endif
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_STD_LIST_TRAITS_HPP
@@ -1,85 +0,0 @@
// Boost string_algo library slist_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_STD_SLIST_TRAITS_HPP
#define BOOST_STRING_STD_SLIST_TRAITS_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/yes_no_type.hpp>
#include BOOST_SLIST_HEADER
#include <boost/algorithm/string/sequence_traits.hpp>
namespace boost {
namespace algorithm {
// SGI's std::slist<> traits -----------------------------------------------//
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// stable iterators tester
template<typename T, typename AllocT>
yes_type has_stable_iterators_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT>* );
// const time insert tester
template<typename T, typename AllocT>
yes_type has_const_time_insert_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT>* );
// const time erase tester
template<typename T, typename AllocT>
yes_type has_const_time_erase_tester( const BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT>* );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// stable iterators trait
template<typename T, typename AllocT>
class has_stable_iterators< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_stable_iterators<T>::value> type;
};
// const time insert trait
template<typename T, typename AllocT>
class has_const_time_insert< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_const_time_insert<T>::value> type;
};
// const time erase trait
template<typename T, typename AllocT>
class has_const_time_erase< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true };
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_const_time_erase<T>::value> type;
};
#endif
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_STD_LIST_TRAITS_HPP
@@ -1,52 +0,0 @@
// Boost string_algo library string_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_STD_STRING_TRAITS_HPP
#define BOOST_STRING_STD_STRING_TRAITS_HPP
#include <boost/algorithm/string/yes_no_type.hpp>
#include <string>
#include <boost/algorithm/string/sequence_traits.hpp>
namespace boost {
namespace algorithm {
// std::basic_string<> traits -----------------------------------------------//
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// native replace tester
template<typename T, typename TraitsT, typename AllocT>
yes_type has_native_replace_tester( const std::basic_string<T, TraitsT, AllocT>* );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// native replace trait
template<typename T, typename TraitsT, typename AllocT>
class has_native_replace< std::basic_string<T, TraitsT, AllocT> >
{
public:
#if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = true } ;
#else
BOOST_STATIC_CONSTANT(bool, value=true);
#endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
typedef mpl::bool_<has_native_replace<T>::value> type;
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_LIST_TRAITS_HPP
@@ -1,26 +0,0 @@
// Boost string_algo library std_containers_traits.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_STD_CONTAINERS_TRAITS_HPP
#define BOOST_STRING_STD_CONTAINERS_TRAITS_HPP
/*!\file
This file includes sequence traits for stl containers.
*/
#include <boost/config.hpp>
#include <boost/algorithm/string/std/string_traits.hpp>
#include <boost/algorithm/string/std/list_traits.hpp>
#ifdef BOOST_HAS_SLIST
# include <boost/algorithm/string/std/slist_traits.hpp>
#endif
#endif // BOOST_STRING_STD_CONTAINERS_TRAITS_HPP
@@ -1,398 +0,0 @@
// Boost string_algo library trim.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_TRIM_HPP
#define BOOST_STRING_TRIM_HPP
#include <boost/algorithm/string/config.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/const_iterator.hpp>
#include <boost/range/as_literal.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/algorithm/string/detail/trim.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <locale>
/*! \file
Defines trim algorithms.
Trim algorithms are used to remove trailing and leading spaces from a
sequence (string). Space is recognized using given locales.
Parametric (\c _if) variants use a predicate (functor) to select which characters
are to be trimmed..
Functions take a selection predicate as a parameter, which is used to determine
whether a character is a space. Common predicates are provided in classification.hpp header.
*/
namespace boost {
namespace algorithm {
// left trim -----------------------------------------------//
//! Left trim - parametric
/*!
Remove all leading spaces from the input.
The supplied predicate is used to determine which characters are considered spaces.
The result is a trimmed copy of the input. It is returned as a sequence
or copied to the output iterator
\param Output An output iterator to which the result will be copied
\param Input An input range
\param IsSpace An unary predicate identifying spaces
\return
An output iterator pointing just after the last inserted character or
a copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT, typename PredicateT>
inline OutputIteratorT trim_left_copy_if(
OutputIteratorT Output,
const RangeT& Input,
PredicateT IsSpace)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
std::copy(
::boost::algorithm::detail::trim_begin(
::boost::begin(lit_range),
::boost::end(lit_range),
IsSpace ),
::boost::end(lit_range),
Output);
return Output;
}
//! Left trim - parametric
/*!
\overload
*/
template<typename SequenceT, typename PredicateT>
inline SequenceT trim_left_copy_if(const SequenceT& Input, PredicateT IsSpace)
{
return SequenceT(
::boost::algorithm::detail::trim_begin(
::boost::begin(Input),
::boost::end(Input),
IsSpace ),
::boost::end(Input));
}
//! Left trim - parametric
/*!
Remove all leading spaces from the input.
The result is a trimmed copy of the input.
\param Input An input sequence
\param Loc a locale used for 'space' classification
\return A trimmed copy of the input
\note This function provides the strong exception-safety guarantee
*/
template<typename SequenceT>
inline SequenceT trim_left_copy(const SequenceT& Input, const std::locale& Loc=std::locale())
{
return
::boost::algorithm::trim_left_copy_if(
Input,
is_space(Loc));
}
//! Left trim
/*!
Remove all leading spaces from the input. The supplied predicate is
used to determine which characters are considered spaces.
The input sequence is modified in-place.
\param Input An input sequence
\param IsSpace An unary predicate identifying spaces
*/
template<typename SequenceT, typename PredicateT>
inline void trim_left_if(SequenceT& Input, PredicateT IsSpace)
{
Input.erase(
::boost::begin(Input),
::boost::algorithm::detail::trim_begin(
::boost::begin(Input),
::boost::end(Input),
IsSpace));
}
//! Left trim
/*!
Remove all leading spaces from the input.
The Input sequence is modified in-place.
\param Input An input sequence
\param Loc A locale used for 'space' classification
*/
template<typename SequenceT>
inline void trim_left(SequenceT& Input, const std::locale& Loc=std::locale())
{
::boost::algorithm::trim_left_if(
Input,
is_space(Loc));
}
// right trim -----------------------------------------------//
//! Right trim - parametric
/*!
Remove all trailing spaces from the input.
The supplied predicate is used to determine which characters are considered spaces.
The result is a trimmed copy of the input. It is returned as a sequence
or copied to the output iterator
\param Output An output iterator to which the result will be copied
\param Input An input range
\param IsSpace An unary predicate identifying spaces
\return
An output iterator pointing just after the last inserted character or
a copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT, typename PredicateT>
inline OutputIteratorT trim_right_copy_if(
OutputIteratorT Output,
const RangeT& Input,
PredicateT IsSpace )
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
std::copy(
::boost::begin(lit_range),
::boost::algorithm::detail::trim_end(
::boost::begin(lit_range),
::boost::end(lit_range),
IsSpace ),
Output );
return Output;
}
//! Right trim - parametric
/*!
\overload
*/
template<typename SequenceT, typename PredicateT>
inline SequenceT trim_right_copy_if(const SequenceT& Input, PredicateT IsSpace)
{
return SequenceT(
::boost::begin(Input),
::boost::algorithm::detail::trim_end(
::boost::begin(Input),
::boost::end(Input),
IsSpace)
);
}
//! Right trim
/*!
Remove all trailing spaces from the input.
The result is a trimmed copy of the input
\param Input An input sequence
\param Loc A locale used for 'space' classification
\return A trimmed copy of the input
\note This function provides the strong exception-safety guarantee
*/
template<typename SequenceT>
inline SequenceT trim_right_copy(const SequenceT& Input, const std::locale& Loc=std::locale())
{
return
::boost::algorithm::trim_right_copy_if(
Input,
is_space(Loc));
}
//! Right trim - parametric
/*!
Remove all trailing spaces from the input.
The supplied predicate is used to determine which characters are considered spaces.
The input sequence is modified in-place.
\param Input An input sequence
\param IsSpace An unary predicate identifying spaces
*/
template<typename SequenceT, typename PredicateT>
inline void trim_right_if(SequenceT& Input, PredicateT IsSpace)
{
Input.erase(
::boost::algorithm::detail::trim_end(
::boost::begin(Input),
::boost::end(Input),
IsSpace ),
::boost::end(Input)
);
}
//! Right trim
/*!
Remove all trailing spaces from the input.
The input sequence is modified in-place.
\param Input An input sequence
\param Loc A locale used for 'space' classification
*/
template<typename SequenceT>
inline void trim_right(SequenceT& Input, const std::locale& Loc=std::locale())
{
::boost::algorithm::trim_right_if(
Input,
is_space(Loc) );
}
// both side trim -----------------------------------------------//
//! Trim - parametric
/*!
Remove all trailing and leading spaces from the input.
The supplied predicate is used to determine which characters are considered spaces.
The result is a trimmed copy of the input. It is returned as a sequence
or copied to the output iterator
\param Output An output iterator to which the result will be copied
\param Input An input range
\param IsSpace An unary predicate identifying spaces
\return
An output iterator pointing just after the last inserted character or
a copy of the input
\note The second variant of this function provides the strong exception-safety guarantee
*/
template<typename OutputIteratorT, typename RangeT, typename PredicateT>
inline OutputIteratorT trim_copy_if(
OutputIteratorT Output,
const RangeT& Input,
PredicateT IsSpace)
{
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_range(::boost::as_literal(Input));
BOOST_STRING_TYPENAME
range_const_iterator<RangeT>::type TrimEnd=
::boost::algorithm::detail::trim_end(
::boost::begin(lit_range),
::boost::end(lit_range),
IsSpace);
std::copy(
detail::trim_begin(
::boost::begin(lit_range), TrimEnd, IsSpace),
TrimEnd,
Output
);
return Output;
}
//! Trim - parametric
/*!
\overload
*/
template<typename SequenceT, typename PredicateT>
inline SequenceT trim_copy_if(const SequenceT& Input, PredicateT IsSpace)
{
BOOST_STRING_TYPENAME
range_const_iterator<SequenceT>::type TrimEnd=
::boost::algorithm::detail::trim_end(
::boost::begin(Input),
::boost::end(Input),
IsSpace);
return SequenceT(
detail::trim_begin(
::boost::begin(Input),
TrimEnd,
IsSpace),
TrimEnd
);
}
//! Trim
/*!
Remove all leading and trailing spaces from the input.
The result is a trimmed copy of the input
\param Input An input sequence
\param Loc A locale used for 'space' classification
\return A trimmed copy of the input
\note This function provides the strong exception-safety guarantee
*/
template<typename SequenceT>
inline SequenceT trim_copy( const SequenceT& Input, const std::locale& Loc=std::locale() )
{
return
::boost::algorithm::trim_copy_if(
Input,
is_space(Loc) );
}
//! Trim
/*!
Remove all leading and trailing spaces from the input.
The supplied predicate is used to determine which characters are considered spaces.
The input sequence is modified in-place.
\param Input An input sequence
\param IsSpace An unary predicate identifying spaces
*/
template<typename SequenceT, typename PredicateT>
inline void trim_if(SequenceT& Input, PredicateT IsSpace)
{
::boost::algorithm::trim_right_if( Input, IsSpace );
::boost::algorithm::trim_left_if( Input, IsSpace );
}
//! Trim
/*!
Remove all leading and trailing spaces from the input.
The input sequence is modified in-place.
\param Input An input sequence
\param Loc A locale used for 'space' classification
*/
template<typename SequenceT>
inline void trim(SequenceT& Input, const std::locale& Loc=std::locale())
{
::boost::algorithm::trim_if(
Input,
is_space( Loc ) );
}
} // namespace algorithm
// pull names to the boost namespace
using algorithm::trim_left;
using algorithm::trim_left_if;
using algorithm::trim_left_copy;
using algorithm::trim_left_copy_if;
using algorithm::trim_right;
using algorithm::trim_right_if;
using algorithm::trim_right_copy;
using algorithm::trim_right_copy_if;
using algorithm::trim;
using algorithm::trim_if;
using algorithm::trim_copy;
using algorithm::trim_copy_if;
} // namespace boost
#endif // BOOST_STRING_TRIM_HPP
@@ -1,33 +0,0 @@
// Boost string_algo library yes_no_type.hpp header file ---------------------------//
// Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/ for updates, documentation, and revision history.
#ifndef BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
#define BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
namespace boost {
namespace algorithm {
// taken from boost mailing-list
// when yes_no_type will become officially
// a part of boost distribution, this header
// will be deprecated
template<int I> struct size_descriptor
{
typedef char (& type)[I];
};
typedef size_descriptor<1>::type yes_type;
typedef size_descriptor<2>::type no_type;
} // namespace algorithm
} // namespace boost
#endif // BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
-181
View File
@@ -1,181 +0,0 @@
//-----------------------------------------------------------------------------
// boost aligned_storage.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002-2003
// Eric Friedman, Itay Maman
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ALIGNED_STORAGE_HPP
#define BOOST_ALIGNED_STORAGE_HPP
#include <cstddef> // for std::size_t
#include "boost/config.hpp"
#include "boost/detail/workaround.hpp"
#include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/type_with_alignment.hpp"
#include "boost/type_traits/is_pod.hpp"
#include "boost/mpl/eval_if.hpp"
#include "boost/mpl/identity.hpp"
#include "boost/type_traits/detail/bool_trait_def.hpp"
namespace boost {
namespace detail { namespace aligned_storage {
BOOST_STATIC_CONSTANT(
std::size_t
, alignment_of_max_align = ::boost::alignment_of<max_align>::value
);
//
// To be TR1 conforming this must be a POD type:
//
template <
std::size_t size_
, std::size_t alignment_
>
struct aligned_storage_imp
{
union data_t
{
char buf[size_];
typename mpl::eval_if_c<
alignment_ == std::size_t(-1)
, mpl::identity<detail::max_align>
, type_with_alignment<alignment_>
>::type align_;
} data_;
void* address() const { return const_cast<aligned_storage_imp*>(this); }
};
template< std::size_t alignment_ >
struct aligned_storage_imp<0u,alignment_>
{
/* intentionally empty */
void* address() const { return 0; }
};
}} // namespace detail::aligned_storage
template <
std::size_t size_
, std::size_t alignment_ = std::size_t(-1)
>
class aligned_storage :
#ifndef __BORLANDC__
private
#else
public
#endif
detail::aligned_storage::aligned_storage_imp<size_, alignment_>
{
public: // constants
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
BOOST_STATIC_CONSTANT(
std::size_t
, size = size_
);
BOOST_STATIC_CONSTANT(
std::size_t
, alignment = (
alignment_ == std::size_t(-1)
? ::boost::detail::aligned_storage::alignment_of_max_align
: alignment_
)
);
#if defined(__GNUC__) &&\
(__GNUC__ > 3) ||\
(__GNUC__ == 3 && (__GNUC_MINOR__ > 2 ||\
(__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ >=3)))
private: // noncopyable
aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&);
#else // gcc less than 3.2.3
public: // _should_ be noncopyable, but GCC compiler emits error
aligned_storage(const aligned_storage&);
aligned_storage& operator=(const aligned_storage&);
#endif // gcc < 3.2.3 workaround
public: // structors
aligned_storage()
{
}
~aligned_storage()
{
}
public: // accessors
void* address()
{
return static_cast<type*>(this)->address();
}
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
const void* address() const
{
return static_cast<const type*>(this)->address();
}
#else // MSVC6
const void* address() const;
#endif // MSVC6 workaround
};
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
// MSVC6 seems not to like inline functions with const void* returns, so we
// declare the following here:
template <std::size_t S, std::size_t A>
const void* aligned_storage<S,A>::address() const
{
return const_cast< aligned_storage<S,A>* >(this)->address();
}
#endif // MSVC6 workaround
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
//
// Make sure that is_pod recognises aligned_storage<>::type
// as a POD (Note that aligned_storage<> itself is not a POD):
//
template <std::size_t size_, std::size_t alignment_>
struct is_pod<boost::detail::aligned_storage::aligned_storage_imp<size_,alignment_> >
BOOST_TT_AUX_BOOL_C_BASE(true)
{
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true)
};
#endif
} // namespace boost
#include "boost/type_traits/detail/bool_trait_undef.hpp"
#endif // BOOST_ALIGNED_STORAGE_HPP
-253
View File
@@ -1,253 +0,0 @@
// See http://www.boost.org/libs/any for Documentation.
#ifndef BOOST_ANY_INCLUDED
#define BOOST_ANY_INCLUDED
// what: variant type boost::any
// who: contributed by Kevlin Henney,
// with features contributed and bugs found by
// Ed Brey, Mark Rodgers, Peter Dimov, and James Curran
// when: July 2001
// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.95
#include <algorithm>
#include <typeinfo>
#include "boost/config.hpp"
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/throw_exception.hpp>
#include <boost/static_assert.hpp>
// See boost/python/type_id.hpp
// TODO: add BOOST_TYPEID_COMPARE_BY_NAME to config.hpp
# if (defined(__GNUC__) && __GNUC__ >= 3) \
|| defined(_AIX) \
|| ( defined(__sgi) && defined(__host_mips)) \
|| (defined(__hpux) && defined(__HP_aCC)) \
|| (defined(linux) && defined(__INTEL_COMPILER) && defined(__ICC))
# define BOOST_AUX_ANY_TYPE_ID_NAME
#include <cstring>
# endif
namespace boost
{
class any
{
public: // structors
any()
: content(0)
{
}
template<typename ValueType>
any(const ValueType & value)
: content(new holder<ValueType>(value))
{
}
any(const any & other)
: content(other.content ? other.content->clone() : 0)
{
}
~any()
{
delete content;
}
public: // modifiers
any & swap(any & rhs)
{
std::swap(content, rhs.content);
return *this;
}
template<typename ValueType>
any & operator=(const ValueType & rhs)
{
any(rhs).swap(*this);
return *this;
}
any & operator=(any rhs)
{
rhs.swap(*this);
return *this;
}
public: // queries
bool empty() const
{
return !content;
}
const std::type_info & type() const
{
return content ? content->type() : typeid(void);
}
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private: // types
#else
public: // types (public so any_cast can be non-friend)
#endif
class placeholder
{
public: // structors
virtual ~placeholder()
{
}
public: // queries
virtual const std::type_info & type() const = 0;
virtual placeholder * clone() const = 0;
};
template<typename ValueType>
class holder : public placeholder
{
public: // structors
holder(const ValueType & value)
: held(value)
{
}
public: // queries
virtual const std::type_info & type() const
{
return typeid(ValueType);
}
virtual placeholder * clone() const
{
return new holder(held);
}
public: // representation
ValueType held;
private: // intentionally left unimplemented
holder & operator=(const holder &);
};
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private: // representation
template<typename ValueType>
friend ValueType * any_cast(any *);
template<typename ValueType>
friend ValueType * unsafe_any_cast(any *);
#else
public: // representation (public so any_cast can be non-friend)
#endif
placeholder * content;
};
class bad_any_cast : public std::bad_cast
{
public:
virtual const char * what() const throw()
{
return "boost::bad_any_cast: "
"failed conversion using boost::any_cast";
}
};
template<typename ValueType>
ValueType * any_cast(any * operand)
{
return operand &&
#ifdef BOOST_AUX_ANY_TYPE_ID_NAME
std::strcmp(operand->type().name(), typeid(ValueType).name()) == 0
#else
operand->type() == typeid(ValueType)
#endif
? &static_cast<any::holder<ValueType> *>(operand->content)->held
: 0;
}
template<typename ValueType>
inline const ValueType * any_cast(const any * operand)
{
return any_cast<ValueType>(const_cast<any *>(operand));
}
template<typename ValueType>
ValueType any_cast(any & operand)
{
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// If 'nonref' is still reference type, it means the user has not
// specialized 'remove_reference'.
// Please use BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION macro
// to generate specialization of remove_reference for your class
// See type traits library documentation for details
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
#endif
nonref * result = any_cast<nonref>(&operand);
if(!result)
boost::throw_exception(bad_any_cast());
return *result;
}
template<typename ValueType>
inline ValueType any_cast(const any & operand)
{
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// The comment in the above version of 'any_cast' explains when this
// assert is fired and what to do.
BOOST_STATIC_ASSERT(!is_reference<nonref>::value);
#endif
return any_cast<const nonref &>(const_cast<any &>(operand));
}
// Note: The "unsafe" versions of any_cast are not part of the
// public interface and may be removed at any time. They are
// required where we know what type is stored in the any and can't
// use typeid() comparison, e.g., when our types may travel across
// different shared libraries.
template<typename ValueType>
inline ValueType * unsafe_any_cast(any * operand)
{
return &static_cast<any::holder<ValueType> *>(operand->content)->held;
}
template<typename ValueType>
inline const ValueType * unsafe_any_cast(const any * operand)
{
return unsafe_any_cast<ValueType>(const_cast<any *>(operand));
}
}
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#endif
-437
View File
@@ -1,437 +0,0 @@
/* The following code declares class array,
* an STL container (as wrapper) for arrays of constant size.
*
* See
* http://www.boost.org/libs/array/
* for documentation.
*
* The original author site is at: http://www.josuttis.com/
*
* (C) Copyright Nicolai M. Josuttis 2001.
*
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
* 05 Aug 2001 - minor update (Nico Josuttis)
* 20 Jan 2001 - STLport fix (Beman Dawes)
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
*
* Jan 29, 2004
*/
#ifndef BOOST_ARRAY_HPP
#define BOOST_ARRAY_HPP
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
# pragma warning(push)
# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
#endif
#include <cstddef>
#include <stdexcept>
#include <boost/assert.hpp>
#include <boost/swap.hpp>
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
#include <boost/throw_exception.hpp>
#include <algorithm>
// FIXES for broken compilers
#include <boost/config.hpp>
namespace boost {
template<class T, std::size_t N>
class array {
public:
T elems[N]; // fixed-size array of elements of type T
public:
// type definitions
typedef T value_type;
typedef T* iterator;
typedef const T* const_iterator;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// iterator support
iterator begin() { return elems; }
const_iterator begin() const { return elems; }
const_iterator cbegin() const { return elems; }
iterator end() { return elems+N; }
const_iterator end() const { return elems+N; }
const_iterator cend() const { return elems+N; }
// reverse iterator support
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
// workaround for broken reverse_iterator in VC7
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
reference, iterator, reference> > reverse_iterator;
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
const_reference, iterator, reference> > const_reverse_iterator;
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
value_type, reference, iterator, difference_type> reverse_iterator;
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
#else
// workaround for broken reverse_iterator implementations
typedef std::reverse_iterator<iterator,T> reverse_iterator;
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
#endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
const_reverse_iterator crbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
const_reverse_iterator crend() const {
return const_reverse_iterator(begin());
}
// operator[]
reference operator[](size_type i)
{
BOOST_ASSERT( i < N && "out of range" );
return elems[i];
}
const_reference operator[](size_type i) const
{
BOOST_ASSERT( i < N && "out of range" );
return elems[i];
}
// at() with range check
reference at(size_type i) { rangecheck(i); return elems[i]; }
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
// front() and back()
reference front()
{
return elems[0];
}
const_reference front() const
{
return elems[0];
}
reference back()
{
return elems[N-1];
}
const_reference back() const
{
return elems[N-1];
}
// size is constant
static size_type size() { return N; }
static bool empty() { return false; }
static size_type max_size() { return N; }
enum { static_size = N };
// swap (note: linear complexity)
void swap (array<T,N>& y) {
for (size_type i = 0; i < N; ++i)
boost::swap(elems[i],y.elems[i]);
}
// direct access to data (read-only)
const T* data() const { return elems; }
T* data() { return elems; }
// use array as C array (direct read/write access to data)
T* c_array() { return elems; }
// assignment with type conversion
template <typename T2>
array<T,N>& operator= (const array<T2,N>& rhs) {
std::copy(rhs.begin(),rhs.end(), begin());
return *this;
}
// assign one value to all elements
void assign (const T& value) { fill ( value ); } // A synonym for fill
void fill (const T& value)
{
std::fill_n(begin(),size(),value);
}
// check range (may be private because it is static)
static void rangecheck (size_type i) {
if (i >= size()) {
std::out_of_range e("array<>: index out of range");
boost::throw_exception(e);
}
}
};
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< class T >
class array< T, 0 > {
public:
// type definitions
typedef T value_type;
typedef T* iterator;
typedef const T* const_iterator;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// iterator support
iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
iterator end() { return begin(); }
const_iterator end() const { return begin(); }
const_iterator cend() const { return cbegin(); }
// reverse iterator support
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
// workaround for broken reverse_iterator in VC7
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
reference, iterator, reference> > reverse_iterator;
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
const_reference, iterator, reference> > const_reverse_iterator;
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
value_type, reference, iterator, difference_type> reverse_iterator;
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
#else
// workaround for broken reverse_iterator implementations
typedef std::reverse_iterator<iterator,T> reverse_iterator;
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
#endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const {
return const_reverse_iterator(end());
}
const_reverse_iterator crbegin() const {
return const_reverse_iterator(end());
}
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
const_reverse_iterator crend() const {
return const_reverse_iterator(begin());
}
// operator[]
reference operator[](size_type /*i*/)
{
return failed_rangecheck();
}
const_reference operator[](size_type /*i*/) const
{
return failed_rangecheck();
}
// at() with range check
reference at(size_type /*i*/) { return failed_rangecheck(); }
const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
// front() and back()
reference front()
{
return failed_rangecheck();
}
const_reference front() const
{
return failed_rangecheck();
}
reference back()
{
return failed_rangecheck();
}
const_reference back() const
{
return failed_rangecheck();
}
// size is constant
static size_type size() { return 0; }
static bool empty() { return true; }
static size_type max_size() { return 0; }
enum { static_size = 0 };
void swap (array<T,0>& /*y*/) {
}
// direct access to data (read-only)
const T* data() const { return 0; }
T* data() { return 0; }
// use array as C array (direct read/write access to data)
T* c_array() { return 0; }
// assignment with type conversion
template <typename T2>
array<T,0>& operator= (const array<T2,0>& ) {
return *this;
}
// assign one value to all elements
void assign (const T& value) { fill ( value ); }
void fill (const T& ) {}
// check range (may be private because it is static)
static reference failed_rangecheck () {
std::out_of_range e("attempt to access element of an empty array");
boost::throw_exception(e);
#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
//
// We need to return something here to keep
// some compilers happy: however we will never
// actually get here....
//
static T placeholder;
return placeholder;
#endif
}
};
#endif
// comparisons
template<class T, std::size_t N>
bool operator== (const array<T,N>& x, const array<T,N>& y) {
return std::equal(x.begin(), x.end(), y.begin());
}
template<class T, std::size_t N>
bool operator< (const array<T,N>& x, const array<T,N>& y) {
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
}
template<class T, std::size_t N>
bool operator!= (const array<T,N>& x, const array<T,N>& y) {
return !(x==y);
}
template<class T, std::size_t N>
bool operator> (const array<T,N>& x, const array<T,N>& y) {
return y<x;
}
template<class T, std::size_t N>
bool operator<= (const array<T,N>& x, const array<T,N>& y) {
return !(y<x);
}
template<class T, std::size_t N>
bool operator>= (const array<T,N>& x, const array<T,N>& y) {
return !(x<y);
}
// global swap()
template<class T, std::size_t N>
inline void swap (array<T,N>& x, array<T,N>& y) {
x.swap(y);
}
#if defined(__SUNPRO_CC)
// Trac ticket #4757; the Sun Solaris compiler can't handle
// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
//
// We can't just use this for all compilers, because the
// borland compilers can't handle this form.
namespace detail {
template <typename T, std::size_t N> struct c_array
{
typedef T type[N];
};
}
// Specific for boost::array: simply returns its elems data member.
template <typename T, std::size_t N>
typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
{
return arg.elems;
}
// Specific for boost::array: simply returns its elems data member.
template <typename T, std::size_t N>
typename const detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& arg)
{
return arg.elems;
}
#else
// Specific for boost::array: simply returns its elems data member.
template <typename T, std::size_t N>
T(&get_c_array(boost::array<T,N>& arg))[N]
{
return arg.elems;
}
// Const version.
template <typename T, std::size_t N>
const T(&get_c_array(const boost::array<T,N>& arg))[N]
{
return arg.elems;
}
#endif
#if 0
// Overload for std::array, assuming that std::array will have
// explicit conversion functions as discussed at the WG21 meeting
// in Summit, March 2009.
template <typename T, std::size_t N>
T(&get_c_array(std::array<T,N>& arg))[N]
{
return static_cast<T(&)[N]>(arg);
}
// Const version.
template <typename T, std::size_t N>
const T(&get_c_array(const std::array<T,N>& arg))[N]
{
return static_cast<T(&)[N]>(arg);
}
#endif
} /* namespace boost */
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
# pragma warning(pop)
#endif
#endif /*BOOST_ARRAY_HPP*/
-112
View File
@@ -1,112 +0,0 @@
//
// asio.hpp
// ~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See www.boost.org/libs/asio for documentation.
//
#ifndef BOOST_ASIO_HPP
#define BOOST_ASIO_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/basic_datagram_socket.hpp>
#include <boost/asio/basic_deadline_timer.hpp>
#include <boost/asio/basic_io_object.hpp>
#include <boost/asio/basic_raw_socket.hpp>
#include <boost/asio/basic_seq_packet_socket.hpp>
#include <boost/asio/basic_serial_port.hpp>
#include <boost/asio/basic_signal_set.hpp>
#include <boost/asio/basic_socket_acceptor.hpp>
#include <boost/asio/basic_socket_iostream.hpp>
#include <boost/asio/basic_socket_streambuf.hpp>
#include <boost/asio/basic_stream_socket.hpp>
#include <boost/asio/basic_streambuf.hpp>
#include <boost/asio/basic_waitable_timer.hpp>
#include <boost/asio/buffer.hpp>
#include <boost/asio/buffered_read_stream_fwd.hpp>
#include <boost/asio/buffered_read_stream.hpp>
#include <boost/asio/buffered_stream_fwd.hpp>
#include <boost/asio/buffered_stream.hpp>
#include <boost/asio/buffered_write_stream_fwd.hpp>
#include <boost/asio/buffered_write_stream.hpp>
#include <boost/asio/buffers_iterator.hpp>
#include <boost/asio/completion_condition.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/datagram_socket_service.hpp>
#include <boost/asio/deadline_timer_service.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/handler_alloc_hook.hpp>
#include <boost/asio/handler_invoke_hook.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/address.hpp>
#include <boost/asio/ip/address_v4.hpp>
#include <boost/asio/ip/address_v6.hpp>
#include <boost/asio/ip/basic_endpoint.hpp>
#include <boost/asio/ip/basic_resolver.hpp>
#include <boost/asio/ip/basic_resolver_entry.hpp>
#include <boost/asio/ip/basic_resolver_iterator.hpp>
#include <boost/asio/ip/basic_resolver_query.hpp>
#include <boost/asio/ip/host_name.hpp>
#include <boost/asio/ip/icmp.hpp>
#include <boost/asio/ip/multicast.hpp>
#include <boost/asio/ip/resolver_query_base.hpp>
#include <boost/asio/ip/resolver_service.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
#include <boost/asio/ip/unicast.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/asio/is_read_buffered.hpp>
#include <boost/asio/is_write_buffered.hpp>
#include <boost/asio/local/basic_endpoint.hpp>
#include <boost/asio/local/connect_pair.hpp>
#include <boost/asio/local/datagram_protocol.hpp>
#include <boost/asio/local/stream_protocol.hpp>
#include <boost/asio/placeholders.hpp>
#include <boost/asio/posix/basic_descriptor.hpp>
#include <boost/asio/posix/basic_stream_descriptor.hpp>
#include <boost/asio/posix/descriptor_base.hpp>
#include <boost/asio/posix/stream_descriptor.hpp>
#include <boost/asio/posix/stream_descriptor_service.hpp>
#include <boost/asio/raw_socket_service.hpp>
#include <boost/asio/read.hpp>
#include <boost/asio/read_at.hpp>
#include <boost/asio/read_until.hpp>
#include <boost/asio/seq_packet_socket_service.hpp>
#include <boost/asio/serial_port.hpp>
#include <boost/asio/serial_port_base.hpp>
#include <boost/asio/serial_port_service.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/asio/signal_set_service.hpp>
#include <boost/asio/socket_acceptor_service.hpp>
#include <boost/asio/socket_base.hpp>
#include <boost/asio/strand.hpp>
#include <boost/asio/stream_socket_service.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/asio/time_traits.hpp>
#include <boost/asio/version.hpp>
#include <boost/asio/wait_traits.hpp>
#include <boost/asio/waitable_timer_service.hpp>
#include <boost/asio/windows/basic_handle.hpp>
#include <boost/asio/windows/basic_object_handle.hpp>
#include <boost/asio/windows/basic_random_access_handle.hpp>
#include <boost/asio/windows/basic_stream_handle.hpp>
#include <boost/asio/windows/object_handle.hpp>
#include <boost/asio/windows/object_handle_service.hpp>
#include <boost/asio/windows/overlapped_ptr.hpp>
#include <boost/asio/windows/random_access_handle.hpp>
#include <boost/asio/windows/random_access_handle_service.hpp>
#include <boost/asio/windows/stream_handle.hpp>
#include <boost/asio/windows/stream_handle_service.hpp>
#include <boost/asio/write.hpp>
#include <boost/asio/write_at.hpp>
#endif // BOOST_ASIO_HPP
@@ -1,888 +0,0 @@
//
// basic_datagram_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP
#define BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/datagram_socket_service.hpp>
#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
/// Provides datagram-oriented socket functionality.
/**
* The basic_datagram_socket class template provides asynchronous and blocking
* datagram-oriented socket functionality.
*
* @par Thread Safety
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*/
template <typename Protocol,
typename DatagramSocketService = datagram_socket_service<Protocol> >
class basic_datagram_socket
: public basic_socket<Protocol, DatagramSocketService>
{
public:
/// (Deprecated: Use native_handle_type.) The native representation of a
/// socket.
typedef typename DatagramSocketService::native_handle_type native_type;
/// The native representation of a socket.
typedef typename DatagramSocketService::native_handle_type native_handle_type;
/// The protocol type.
typedef Protocol protocol_type;
/// The endpoint type.
typedef typename Protocol::endpoint endpoint_type;
/// Construct a basic_datagram_socket without opening it.
/**
* This constructor creates a datagram socket without opening it. The open()
* function must be called before data can be sent or received on the socket.
*
* @param io_service The io_service object that the datagram socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*/
explicit basic_datagram_socket(boost::asio::io_service& io_service)
: basic_socket<Protocol, DatagramSocketService>(io_service)
{
}
/// Construct and open a basic_datagram_socket.
/**
* This constructor creates and opens a datagram socket.
*
* @param io_service The io_service object that the datagram socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_datagram_socket(boost::asio::io_service& io_service,
const protocol_type& protocol)
: basic_socket<Protocol, DatagramSocketService>(io_service, protocol)
{
}
/// Construct a basic_datagram_socket, opening it and binding it to the given
/// local endpoint.
/**
* This constructor creates a datagram socket and automatically opens it bound
* to the specified endpoint on the local machine. The protocol used is the
* protocol associated with the given endpoint.
*
* @param io_service The io_service object that the datagram socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param endpoint An endpoint on the local machine to which the datagram
* socket will be bound.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_datagram_socket(boost::asio::io_service& io_service,
const endpoint_type& endpoint)
: basic_socket<Protocol, DatagramSocketService>(io_service, endpoint)
{
}
/// Construct a basic_datagram_socket on an existing native socket.
/**
* This constructor creates a datagram socket object to hold an existing
* native socket.
*
* @param io_service The io_service object that the datagram socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @param native_socket The new underlying socket implementation.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_datagram_socket(boost::asio::io_service& io_service,
const protocol_type& protocol, const native_handle_type& native_socket)
: basic_socket<Protocol, DatagramSocketService>(
io_service, protocol, native_socket)
{
}
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_datagram_socket from another.
/**
* This constructor moves a datagram socket from one object to another.
*
* @param other The other basic_datagram_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_datagram_socket(io_service&) constructor.
*/
basic_datagram_socket(basic_datagram_socket&& other)
: basic_socket<Protocol, DatagramSocketService>(
BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other))
{
}
/// Move-assign a basic_datagram_socket from another.
/**
* This assignment operator moves a datagram socket from one object to
* another.
*
* @param other The other basic_datagram_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_datagram_socket(io_service&) constructor.
*/
basic_datagram_socket& operator=(basic_datagram_socket&& other)
{
basic_socket<Protocol, DatagramSocketService>::operator=(
BOOST_ASIO_MOVE_CAST(basic_datagram_socket)(other));
return *this;
}
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Send some data on a connected socket.
/**
* This function is used to send data on the datagram socket. The function
* call will block until the data has been sent successfully or an error
* occurs.
*
* @param buffers One ore more data buffers to be sent on the socket.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected datagram socket.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code socket.send(boost::asio::buffer(data, size)); @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send(
this->get_implementation(), buffers, 0, ec);
boost::asio::detail::throw_error(ec, "send");
return s;
}
/// Send some data on a connected socket.
/**
* This function is used to send data on the datagram socket. The function
* call will block until the data has been sent successfully or an error
* occurs.
*
* @param buffers One ore more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected datagram socket.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send(
this->get_implementation(), buffers, flags, ec);
boost::asio::detail::throw_error(ec, "send");
return s;
}
/// Send some data on a connected socket.
/**
* This function is used to send data on the datagram socket. The function
* call will block until the data has been sent successfully or an error
* occurs.
*
* @param buffers One or more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes sent.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected datagram socket.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags, boost::system::error_code& ec)
{
return this->get_service().send(
this->get_implementation(), buffers, flags, ec);
}
/// Start an asynchronous send on a connected socket.
/**
* This function is used to send data on the datagram socket. The function
* call will block until the data has been sent successfully or an error
* occurs.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
* remain valid until the handler is called.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected datagram
* socket.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* socket.async_send(boost::asio::buffer(data, size), handler);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send(const ConstBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send(this->get_implementation(),
buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Start an asynchronous send on a connected socket.
/**
* This function is used to send data on the datagram socket. The function
* call will block until the data has been sent successfully or an error
* occurs.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
* remain valid until the handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected datagram
* socket.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send(this->get_implementation(),
buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Send a datagram to the specified endpoint.
/**
* This function is used to send a datagram to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* boost::asio::ip::udp::endpoint destination(
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
* socket.send_to(boost::asio::buffer(data, size), destination);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send_to(
this->get_implementation(), buffers, destination, 0, ec);
boost::asio::detail::throw_error(ec, "send_to");
return s;
}
/// Send a datagram to the specified endpoint.
/**
* This function is used to send a datagram to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @param flags Flags specifying how the send call is to be made.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send_to(
this->get_implementation(), buffers, destination, flags, ec);
boost::asio::detail::throw_error(ec, "send_to");
return s;
}
/// Send a datagram to the specified endpoint.
/**
* This function is used to send a datagram to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes sent.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
boost::system::error_code& ec)
{
return this->get_service().send_to(this->get_implementation(),
buffers, destination, flags, ec);
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send a datagram to the specified
* remote endpoint. The function call always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* boost::asio::ip::udp::endpoint destination(
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
* socket.async_send_to(
* boost::asio::buffer(data, size), destination, handler);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send_to(this->get_implementation(), buffers,
destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send a datagram to the specified
* remote endpoint. The function call always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send_to(this->get_implementation(), buffers,
destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the datagram socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected datagram
* socket.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code socket.receive(boost::asio::buffer(data, size)); @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, 0, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the datagram socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected datagram
* socket.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, flags, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the datagram socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes received.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected datagram
* socket.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags, boost::system::error_code& ec)
{
return this->get_service().receive(
this->get_implementation(), buffers, flags, ec);
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the datagram
* socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* datagram socket.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.async_receive(boost::asio::buffer(data, size), handler);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(),
buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the datagram
* socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* datagram socket.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(),
buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Receive a datagram with the endpoint of the sender.
/**
* This function is used to receive a datagram. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* boost::asio::ip::udp::endpoint sender_endpoint;
* socket.receive_from(
* boost::asio::buffer(data, size), sender_endpoint);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive_from(
this->get_implementation(), buffers, sender_endpoint, 0, ec);
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
/// Receive a datagram with the endpoint of the sender.
/**
* This function is used to receive a datagram. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive_from(
this->get_implementation(), buffers, sender_endpoint, flags, ec);
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
/// Receive a datagram with the endpoint of the sender.
/**
* This function is used to receive a datagram. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes received.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
boost::system::error_code& ec)
{
return this->get_service().receive_from(this->get_implementation(),
buffers, sender_endpoint, flags, ec);
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive a datagram. The function
* call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
* handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code socket.async_receive_from(
* boost::asio::buffer(data, size), 0, sender_endpoint, handler); @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive_from(this->get_implementation(), buffers,
sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive a datagram. The function
* call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the datagram. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
* handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive_from(this->get_implementation(), buffers,
sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
};
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP
@@ -1,511 +0,0 @@
//
// basic_deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP
#define BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <boost/asio/basic_io_object.hpp>
#include <boost/asio/deadline_timer_service.hpp>
#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
/// Provides waitable timer functionality.
/**
* The basic_deadline_timer class template provides the ability to perform a
* blocking or asynchronous wait for a timer to expire.
*
* A deadline timer is always in one of two states: "expired" or "not expired".
* If the wait() or async_wait() function is called on an expired timer, the
* wait operation will complete immediately.
*
* Most applications will use the boost::asio::deadline_timer typedef.
*
* @par Thread Safety
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*
* @par Examples
* Performing a blocking wait:
* @code
* // Construct a timer without setting an expiry time.
* boost::asio::deadline_timer timer(io_service);
*
* // Set an expiry time relative to now.
* timer.expires_from_now(boost::posix_time::seconds(5));
*
* // Wait for the timer to expire.
* timer.wait();
* @endcode
*
* @par
* Performing an asynchronous wait:
* @code
* void handler(const boost::system::error_code& error)
* {
* if (!error)
* {
* // Timer expired.
* }
* }
*
* ...
*
* // Construct a timer with an absolute expiry time.
* boost::asio::deadline_timer timer(io_service,
* boost::posix_time::time_from_string("2005-12-07 23:59:59.000"));
*
* // Start an asynchronous wait.
* timer.async_wait(handler);
* @endcode
*
* @par Changing an active deadline_timer's expiry time
*
* Changing the expiry time of a timer while there are pending asynchronous
* waits causes those wait operations to be cancelled. To ensure that the action
* associated with the timer is performed only once, use something like this:
* used:
*
* @code
* void on_some_event()
* {
* if (my_timer.expires_from_now(seconds(5)) > 0)
* {
* // We managed to cancel the timer. Start new asynchronous wait.
* my_timer.async_wait(on_timeout);
* }
* else
* {
* // Too late, timer has already expired!
* }
* }
*
* void on_timeout(const boost::system::error_code& e)
* {
* if (e != boost::asio::error::operation_aborted)
* {
* // Timer was not cancelled, take necessary action.
* }
* }
* @endcode
*
* @li The boost::asio::basic_deadline_timer::expires_from_now() function
* cancels any pending asynchronous waits, and returns the number of
* asynchronous waits that were cancelled. If it returns 0 then you were too
* late and the wait handler has already been executed, or will soon be
* executed. If it returns 1 then the wait handler was successfully cancelled.
*
* @li If a wait handler is cancelled, the boost::system::error_code passed to
* it contains the value boost::asio::error::operation_aborted.
*/
template <typename Time,
typename TimeTraits = boost::asio::time_traits<Time>,
typename TimerService = deadline_timer_service<Time, TimeTraits> >
class basic_deadline_timer
: public basic_io_object<TimerService>
{
public:
/// The time traits type.
typedef TimeTraits traits_type;
/// The time type.
typedef typename traits_type::time_type time_type;
/// The duration type.
typedef typename traits_type::duration_type duration_type;
/// Constructor.
/**
* This constructor creates a timer without setting an expiry time. The
* expires_at() or expires_from_now() functions must be called to set an
* expiry time before the timer can be waited on.
*
* @param io_service The io_service object that the timer will use to dispatch
* handlers for any asynchronous operations performed on the timer.
*/
explicit basic_deadline_timer(boost::asio::io_service& io_service)
: basic_io_object<TimerService>(io_service)
{
}
/// Constructor to set a particular expiry time as an absolute time.
/**
* This constructor creates a timer and sets the expiry time.
*
* @param io_service The io_service object that the timer will use to dispatch
* handlers for any asynchronous operations performed on the timer.
*
* @param expiry_time The expiry time to be used for the timer, expressed
* as an absolute time.
*/
basic_deadline_timer(boost::asio::io_service& io_service,
const time_type& expiry_time)
: basic_io_object<TimerService>(io_service)
{
boost::system::error_code ec;
this->service.expires_at(this->implementation, expiry_time, ec);
boost::asio::detail::throw_error(ec, "expires_at");
}
/// Constructor to set a particular expiry time relative to now.
/**
* This constructor creates a timer and sets the expiry time.
*
* @param io_service The io_service object that the timer will use to dispatch
* handlers for any asynchronous operations performed on the timer.
*
* @param expiry_time The expiry time to be used for the timer, relative to
* now.
*/
basic_deadline_timer(boost::asio::io_service& io_service,
const duration_type& expiry_time)
: basic_io_object<TimerService>(io_service)
{
boost::system::error_code ec;
this->service.expires_from_now(this->implementation, expiry_time, ec);
boost::asio::detail::throw_error(ec, "expires_from_now");
}
/// Cancel any asynchronous operations that are waiting on the timer.
/**
* This function forces the completion of any pending asynchronous wait
* operations against the timer. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* Cancelling the timer does not change the expiry time.
*
* @return The number of asynchronous operations that were cancelled.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note If the timer has already expired when cancel() is called, then the
* handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t cancel()
{
boost::system::error_code ec;
std::size_t s = this->service.cancel(this->implementation, ec);
boost::asio::detail::throw_error(ec, "cancel");
return s;
}
/// Cancel any asynchronous operations that are waiting on the timer.
/**
* This function forces the completion of any pending asynchronous wait
* operations against the timer. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* Cancelling the timer does not change the expiry time.
*
* @param ec Set to indicate what error occurred, if any.
*
* @return The number of asynchronous operations that were cancelled.
*
* @note If the timer has already expired when cancel() is called, then the
* handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t cancel(boost::system::error_code& ec)
{
return this->service.cancel(this->implementation, ec);
}
/// Cancels one asynchronous operation that is waiting on the timer.
/**
* This function forces the completion of one pending asynchronous wait
* operation against the timer. Handlers are cancelled in FIFO order. The
* handler for the cancelled operation will be invoked with the
* boost::asio::error::operation_aborted error code.
*
* Cancelling the timer does not change the expiry time.
*
* @return The number of asynchronous operations that were cancelled. That is,
* either 0 or 1.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note If the timer has already expired when cancel_one() is called, then
* the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t cancel_one()
{
boost::system::error_code ec;
std::size_t s = this->service.cancel_one(this->implementation, ec);
boost::asio::detail::throw_error(ec, "cancel_one");
return s;
}
/// Cancels one asynchronous operation that is waiting on the timer.
/**
* This function forces the completion of one pending asynchronous wait
* operation against the timer. Handlers are cancelled in FIFO order. The
* handler for the cancelled operation will be invoked with the
* boost::asio::error::operation_aborted error code.
*
* Cancelling the timer does not change the expiry time.
*
* @param ec Set to indicate what error occurred, if any.
*
* @return The number of asynchronous operations that were cancelled. That is,
* either 0 or 1.
*
* @note If the timer has already expired when cancel_one() is called, then
* the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t cancel_one(boost::system::error_code& ec)
{
return this->service.cancel_one(this->implementation, ec);
}
/// Get the timer's expiry time as an absolute time.
/**
* This function may be used to obtain the timer's current expiry time.
* Whether the timer has expired or not does not affect this value.
*/
time_type expires_at() const
{
return this->service.expires_at(this->implementation);
}
/// Set the timer's expiry time as an absolute time.
/**
* This function sets the expiry time. Any pending asynchronous wait
* operations will be cancelled. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* @param expiry_time The expiry time to be used for the timer.
*
* @return The number of asynchronous operations that were cancelled.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note If the timer has already expired when expires_at() is called, then
* the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t expires_at(const time_type& expiry_time)
{
boost::system::error_code ec;
std::size_t s = this->service.expires_at(
this->implementation, expiry_time, ec);
boost::asio::detail::throw_error(ec, "expires_at");
return s;
}
/// Set the timer's expiry time as an absolute time.
/**
* This function sets the expiry time. Any pending asynchronous wait
* operations will be cancelled. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* @param expiry_time The expiry time to be used for the timer.
*
* @param ec Set to indicate what error occurred, if any.
*
* @return The number of asynchronous operations that were cancelled.
*
* @note If the timer has already expired when expires_at() is called, then
* the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t expires_at(const time_type& expiry_time,
boost::system::error_code& ec)
{
return this->service.expires_at(this->implementation, expiry_time, ec);
}
/// Get the timer's expiry time relative to now.
/**
* This function may be used to obtain the timer's current expiry time.
* Whether the timer has expired or not does not affect this value.
*/
duration_type expires_from_now() const
{
return this->service.expires_from_now(this->implementation);
}
/// Set the timer's expiry time relative to now.
/**
* This function sets the expiry time. Any pending asynchronous wait
* operations will be cancelled. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* @param expiry_time The expiry time to be used for the timer.
*
* @return The number of asynchronous operations that were cancelled.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note If the timer has already expired when expires_from_now() is called,
* then the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t expires_from_now(const duration_type& expiry_time)
{
boost::system::error_code ec;
std::size_t s = this->service.expires_from_now(
this->implementation, expiry_time, ec);
boost::asio::detail::throw_error(ec, "expires_from_now");
return s;
}
/// Set the timer's expiry time relative to now.
/**
* This function sets the expiry time. Any pending asynchronous wait
* operations will be cancelled. The handler for each cancelled operation will
* be invoked with the boost::asio::error::operation_aborted error code.
*
* @param expiry_time The expiry time to be used for the timer.
*
* @param ec Set to indicate what error occurred, if any.
*
* @return The number of asynchronous operations that were cancelled.
*
* @note If the timer has already expired when expires_from_now() is called,
* then the handlers for asynchronous wait operations will:
*
* @li have already been invoked; or
*
* @li have been queued for invocation in the near future.
*
* These handlers can no longer be cancelled, and therefore are passed an
* error code that indicates the successful completion of the wait operation.
*/
std::size_t expires_from_now(const duration_type& expiry_time,
boost::system::error_code& ec)
{
return this->service.expires_from_now(
this->implementation, expiry_time, ec);
}
/// Perform a blocking wait on the timer.
/**
* This function is used to wait for the timer to expire. This function
* blocks and does not return until the timer has expired.
*
* @throws boost::system::system_error Thrown on failure.
*/
void wait()
{
boost::system::error_code ec;
this->service.wait(this->implementation, ec);
boost::asio::detail::throw_error(ec, "wait");
}
/// Perform a blocking wait on the timer.
/**
* This function is used to wait for the timer to expire. This function
* blocks and does not return until the timer has expired.
*
* @param ec Set to indicate what error occurred, if any.
*/
void wait(boost::system::error_code& ec)
{
this->service.wait(this->implementation, ec);
}
/// Start an asynchronous wait on the timer.
/**
* This function may be used to initiate an asynchronous wait against the
* timer. It always returns immediately.
*
* For each call to async_wait(), the supplied handler will be called exactly
* once. The handler will be called when:
*
* @li The timer has expired.
*
* @li The timer was cancelled, in which case the handler is passed the error
* code boost::asio::error::operation_aborted.
*
* @param handler The handler to be called when the timer expires. Copies
* will be made of the handler as required. The function signature of the
* handler must be:
* @code void handler(
* const boost::system::error_code& error // Result of operation.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*/
template <typename WaitHandler>
void async_wait(BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WaitHandler.
BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
this->service.async_wait(this->implementation,
BOOST_ASIO_MOVE_CAST(WaitHandler)(handler));
}
};
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_BASIC_DEADLINE_TIMER_HPP
@@ -1,242 +0,0 @@
//
// basic_io_object.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_BASIC_IO_OBJECT_HPP
#define BOOST_ASIO_BASIC_IO_OBJECT_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
#if defined(BOOST_ASIO_HAS_MOVE)
namespace detail
{
// Type trait used to determine whether a service supports move.
template <typename IoObjectService>
class service_has_move
{
private:
typedef IoObjectService service_type;
typedef typename service_type::implementation_type implementation_type;
template <typename T, typename U>
static auto eval(T* t, U* u) -> decltype(t->move_construct(*u, *u), char());
static char (&eval(...))[2];
public:
static const bool value =
sizeof(service_has_move::eval(
static_cast<service_type*>(0),
static_cast<implementation_type*>(0))) == 1;
};
}
#endif // defined(BOOST_ASIO_HAS_MOVE)
/// Base class for all I/O objects.
/**
* @note All I/O objects are non-copyable. However, when using C++0x, certain
* I/O objects do support move construction and move assignment.
*/
#if !defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
template <typename IoObjectService>
#else
template <typename IoObjectService,
bool Movable = detail::service_has_move<IoObjectService>::value>
#endif
class basic_io_object
{
public:
/// The type of the service that will be used to provide I/O operations.
typedef IoObjectService service_type;
/// The underlying implementation type of I/O object.
typedef typename service_type::implementation_type implementation_type;
/// Get the io_service associated with the object.
/**
* This function may be used to obtain the io_service object that the I/O
* object uses to dispatch handlers for asynchronous operations.
*
* @return A reference to the io_service object that the I/O object will use
* to dispatch handlers. Ownership is not transferred to the caller.
*/
boost::asio::io_service& get_io_service()
{
return service.get_io_service();
}
protected:
/// Construct a basic_io_object.
/**
* Performs:
* @code get_service().construct(get_implementation()); @endcode
*/
explicit basic_io_object(boost::asio::io_service& io_service)
: service(boost::asio::use_service<IoObjectService>(io_service))
{
service.construct(implementation);
}
#if defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_io_object.
/**
* Performs:
* @code get_service().move_construct(
* get_implementation(), other.get_implementation()); @endcode
*
* @note Available only for services that support movability,
*/
basic_io_object(basic_io_object&& other);
/// Move-assign a basic_io_object.
/**
* Performs:
* @code get_service().move_assign(get_implementation(),
* other.get_service(), other.get_implementation()); @endcode
*
* @note Available only for services that support movability,
*/
basic_io_object& operator=(basic_io_object&& other);
#endif // defined(GENERATING_DOCUMENTATION)
/// Protected destructor to prevent deletion through this type.
/**
* Performs:
* @code get_service().destroy(get_implementation()); @endcode
*/
~basic_io_object()
{
service.destroy(implementation);
}
/// Get the service associated with the I/O object.
service_type& get_service()
{
return service;
}
/// Get the service associated with the I/O object.
const service_type& get_service() const
{
return service;
}
/// (Deprecated: Use get_service().) The service associated with the I/O
/// object.
/**
* @note Available only for services that do not support movability.
*/
service_type& service;
/// Get the underlying implementation of the I/O object.
implementation_type& get_implementation()
{
return implementation;
}
/// Get the underlying implementation of the I/O object.
const implementation_type& get_implementation() const
{
return implementation;
}
/// (Deprecated: Use get_implementation().) The underlying implementation of
/// the I/O object.
implementation_type implementation;
private:
basic_io_object(const basic_io_object&);
basic_io_object& operator=(const basic_io_object&);
};
#if defined(BOOST_ASIO_HAS_MOVE)
// Specialisation for movable objects.
template <typename IoObjectService>
class basic_io_object<IoObjectService, true>
{
public:
typedef IoObjectService service_type;
typedef typename service_type::implementation_type implementation_type;
boost::asio::io_service& get_io_service()
{
return service_->get_io_service();
}
protected:
explicit basic_io_object(boost::asio::io_service& io_service)
: service_(&boost::asio::use_service<IoObjectService>(io_service))
{
service_->construct(implementation);
}
basic_io_object(basic_io_object&& other)
: service_(&other.get_service())
{
service_->move_construct(implementation, other.implementation);
}
~basic_io_object()
{
service_->destroy(implementation);
}
basic_io_object& operator=(basic_io_object&& other)
{
service_->move_assign(implementation,
*other.service_, other.implementation);
service_ = other.service_;
return *this;
}
service_type& get_service()
{
return *service_;
}
const service_type& get_service() const
{
return *service_;
}
implementation_type& get_implementation()
{
return implementation;
}
const implementation_type& get_implementation() const
{
return implementation;
}
implementation_type implementation;
private:
basic_io_object(const basic_io_object&);
void operator=(const basic_io_object&);
IoObjectService* service_;
};
#endif // defined(BOOST_ASIO_HAS_MOVE)
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_BASIC_IO_OBJECT_HPP
@@ -1,882 +0,0 @@
//
// basic_raw_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_BASIC_RAW_SOCKET_HPP
#define BOOST_ASIO_BASIC_RAW_SOCKET_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/raw_socket_service.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
/// Provides raw-oriented socket functionality.
/**
* The basic_raw_socket class template provides asynchronous and blocking
* raw-oriented socket functionality.
*
* @par Thread Safety
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*/
template <typename Protocol,
typename RawSocketService = raw_socket_service<Protocol> >
class basic_raw_socket
: public basic_socket<Protocol, RawSocketService>
{
public:
/// (Deprecated: Use native_handle_type.) The native representation of a
/// socket.
typedef typename RawSocketService::native_handle_type native_type;
/// The native representation of a socket.
typedef typename RawSocketService::native_handle_type native_handle_type;
/// The protocol type.
typedef Protocol protocol_type;
/// The endpoint type.
typedef typename Protocol::endpoint endpoint_type;
/// Construct a basic_raw_socket without opening it.
/**
* This constructor creates a raw socket without opening it. The open()
* function must be called before data can be sent or received on the socket.
*
* @param io_service The io_service object that the raw socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*/
explicit basic_raw_socket(boost::asio::io_service& io_service)
: basic_socket<Protocol, RawSocketService>(io_service)
{
}
/// Construct and open a basic_raw_socket.
/**
* This constructor creates and opens a raw socket.
*
* @param io_service The io_service object that the raw socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_raw_socket(boost::asio::io_service& io_service,
const protocol_type& protocol)
: basic_socket<Protocol, RawSocketService>(io_service, protocol)
{
}
/// Construct a basic_raw_socket, opening it and binding it to the given
/// local endpoint.
/**
* This constructor creates a raw socket and automatically opens it bound
* to the specified endpoint on the local machine. The protocol used is the
* protocol associated with the given endpoint.
*
* @param io_service The io_service object that the raw socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param endpoint An endpoint on the local machine to which the raw
* socket will be bound.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_raw_socket(boost::asio::io_service& io_service,
const endpoint_type& endpoint)
: basic_socket<Protocol, RawSocketService>(io_service, endpoint)
{
}
/// Construct a basic_raw_socket on an existing native socket.
/**
* This constructor creates a raw socket object to hold an existing
* native socket.
*
* @param io_service The io_service object that the raw socket will use
* to dispatch handlers for any asynchronous operations performed on the
* socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @param native_socket The new underlying socket implementation.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_raw_socket(boost::asio::io_service& io_service,
const protocol_type& protocol, const native_handle_type& native_socket)
: basic_socket<Protocol, RawSocketService>(
io_service, protocol, native_socket)
{
}
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_raw_socket from another.
/**
* This constructor moves a raw socket from one object to another.
*
* @param other The other basic_raw_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_raw_socket(io_service&) constructor.
*/
basic_raw_socket(basic_raw_socket&& other)
: basic_socket<Protocol, RawSocketService>(
BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other))
{
}
/// Move-assign a basic_raw_socket from another.
/**
* This assignment operator moves a raw socket from one object to another.
*
* @param other The other basic_raw_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_raw_socket(io_service&) constructor.
*/
basic_raw_socket& operator=(basic_raw_socket&& other)
{
basic_socket<Protocol, RawSocketService>::operator=(
BOOST_ASIO_MOVE_CAST(basic_raw_socket)(other));
return *this;
}
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Send some data on a connected socket.
/**
* This function is used to send data on the raw socket. The function call
* will block until the data has been sent successfully or an error occurs.
*
* @param buffers One ore more data buffers to be sent on the socket.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected raw socket.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code socket.send(boost::asio::buffer(data, size)); @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send(
this->get_implementation(), buffers, 0, ec);
boost::asio::detail::throw_error(ec, "send");
return s;
}
/// Send some data on a connected socket.
/**
* This function is used to send data on the raw socket. The function call
* will block until the data has been sent successfully or an error occurs.
*
* @param buffers One ore more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected raw socket.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send(
this->get_implementation(), buffers, flags, ec);
boost::asio::detail::throw_error(ec, "send");
return s;
}
/// Send some data on a connected socket.
/**
* This function is used to send data on the raw socket. The function call
* will block until the data has been sent successfully or an error occurs.
*
* @param buffers One or more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes sent.
*
* @note The send operation can only be used with a connected socket. Use
* the send_to function to send data on an unconnected raw socket.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags, boost::system::error_code& ec)
{
return this->get_service().send(
this->get_implementation(), buffers, flags, ec);
}
/// Start an asynchronous send on a connected socket.
/**
* This function is used to send data on the raw socket. The function call
* will block until the data has been sent successfully or an error occurs.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
* remain valid until the handler is called.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected raw
* socket.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* socket.async_send(boost::asio::buffer(data, size), handler);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send(const ConstBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send(this->get_implementation(),
buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Start an asynchronous send on a connected socket.
/**
* This function is used to send data on the raw socket. The function call
* will block until the data has been sent successfully or an error occurs.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
* remain valid until the handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_send operation can only be used with a connected socket.
* Use the async_send_to function to send data on an unconnected raw
* socket.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send(this->get_implementation(),
buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Send raw data to the specified endpoint.
/**
* This function is used to send raw data to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* boost::asio::ip::udp::endpoint destination(
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
* socket.send_to(boost::asio::buffer(data, size), destination);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send_to(
this->get_implementation(), buffers, destination, 0, ec);
boost::asio::detail::throw_error(ec, "send_to");
return s;
}
/// Send raw data to the specified endpoint.
/**
* This function is used to send raw data to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @param flags Flags specifying how the send call is to be made.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send_to(
this->get_implementation(), buffers, destination, flags, ec);
boost::asio::detail::throw_error(ec, "send_to");
return s;
}
/// Send raw data to the specified endpoint.
/**
* This function is used to send raw data to the specified remote endpoint.
* The function call will block until the data has been sent successfully or
* an error occurs.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
*
* @param destination The remote endpoint to which the data will be sent.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes sent.
*/
template <typename ConstBufferSequence>
std::size_t send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
boost::system::error_code& ec)
{
return this->get_service().send_to(this->get_implementation(),
buffers, destination, flags, ec);
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send raw data to the specified
* remote endpoint. The function call always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* boost::asio::ip::udp::endpoint destination(
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
* socket.async_send_to(
* boost::asio::buffer(data, size), destination, handler);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send_to(this->get_implementation(), buffers,
destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send raw data to the specified
* remote endpoint. The function call always returns immediately.
*
* @param buffers One or more data buffers to be sent to the remote endpoint.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param destination The remote endpoint to which the data will be sent.
* Copies will be made of the endpoint as required.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send_to(const ConstBufferSequence& buffers,
const endpoint_type& destination, socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send_to(this->get_implementation(), buffers,
destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the raw socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected raw
* socket.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code socket.receive(boost::asio::buffer(data, size)); @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, 0, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the raw socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected raw
* socket.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, flags, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the raw socket. The function
* call will block until data has been received successfully or an error
* occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes received.
*
* @note The receive operation can only be used with a connected socket. Use
* the receive_from function to receive data on an unconnected raw
* socket.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags, boost::system::error_code& ec)
{
return this->get_service().receive(
this->get_implementation(), buffers, flags, ec);
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the raw
* socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* raw socket.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.async_receive(boost::asio::buffer(data, size), handler);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(),
buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Start an asynchronous receive on a connected socket.
/**
* This function is used to asynchronously receive data from the raw
* socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @note The async_receive operation can only be used with a connected socket.
* Use the async_receive_from function to receive data on an unconnected
* raw socket.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(),
buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Receive raw data with the endpoint of the sender.
/**
* This function is used to receive raw data. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* boost::asio::ip::udp::endpoint sender_endpoint;
* socket.receive_from(
* boost::asio::buffer(data, size), sender_endpoint);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive_from(
this->get_implementation(), buffers, sender_endpoint, 0, ec);
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
/// Receive raw data with the endpoint of the sender.
/**
* This function is used to receive raw data. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive_from(
this->get_implementation(), buffers, sender_endpoint, flags, ec);
boost::asio::detail::throw_error(ec, "receive_from");
return s;
}
/// Receive raw data with the endpoint of the sender.
/**
* This function is used to receive raw data. The function call will block
* until data has been received successfully or an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes received.
*/
template <typename MutableBufferSequence>
std::size_t receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
boost::system::error_code& ec)
{
return this->get_service().receive_from(this->get_implementation(),
buffers, sender_endpoint, flags, ec);
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive raw data. The function
* call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
* handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code socket.async_receive_from(
* boost::asio::buffer(data, size), 0, sender_endpoint, handler); @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive_from(this->get_implementation(), buffers,
sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive raw data. The function
* call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param sender_endpoint An endpoint object that receives the endpoint of
* the remote sender of the data. Ownership of the sender_endpoint object
* is retained by the caller, which must guarantee that it is valid until the
* handler is called.
*
* @param flags Flags specifying how the receive call is to be made.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive_from(const MutableBufferSequence& buffers,
endpoint_type& sender_endpoint, socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive_from(this->get_implementation(), buffers,
sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
};
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_BASIC_RAW_SOCKET_HPP
@@ -1,514 +0,0 @@
//
// basic_seq_packet_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP
#define BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <cstddef>
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/seq_packet_socket_service.hpp>
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
/// Provides sequenced packet socket functionality.
/**
* The basic_seq_packet_socket class template provides asynchronous and blocking
* sequenced packet socket functionality.
*
* @par Thread Safety
* @e Distinct @e objects: Safe.@n
* @e Shared @e objects: Unsafe.
*/
template <typename Protocol,
typename SeqPacketSocketService = seq_packet_socket_service<Protocol> >
class basic_seq_packet_socket
: public basic_socket<Protocol, SeqPacketSocketService>
{
public:
/// (Deprecated: Use native_handle_type.) The native representation of a
/// socket.
typedef typename SeqPacketSocketService::native_handle_type native_type;
/// The native representation of a socket.
typedef typename SeqPacketSocketService::native_handle_type
native_handle_type;
/// The protocol type.
typedef Protocol protocol_type;
/// The endpoint type.
typedef typename Protocol::endpoint endpoint_type;
/// Construct a basic_seq_packet_socket without opening it.
/**
* This constructor creates a sequenced packet socket without opening it. The
* socket needs to be opened and then connected or accepted before data can
* be sent or received on it.
*
* @param io_service The io_service object that the sequenced packet socket
* will use to dispatch handlers for any asynchronous operations performed on
* the socket.
*/
explicit basic_seq_packet_socket(boost::asio::io_service& io_service)
: basic_socket<Protocol, SeqPacketSocketService>(io_service)
{
}
/// Construct and open a basic_seq_packet_socket.
/**
* This constructor creates and opens a sequenced_packet socket. The socket
* needs to be connected or accepted before data can be sent or received on
* it.
*
* @param io_service The io_service object that the sequenced packet socket
* will use to dispatch handlers for any asynchronous operations performed on
* the socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_seq_packet_socket(boost::asio::io_service& io_service,
const protocol_type& protocol)
: basic_socket<Protocol, SeqPacketSocketService>(io_service, protocol)
{
}
/// Construct a basic_seq_packet_socket, opening it and binding it to the
/// given local endpoint.
/**
* This constructor creates a sequenced packet socket and automatically opens
* it bound to the specified endpoint on the local machine. The protocol used
* is the protocol associated with the given endpoint.
*
* @param io_service The io_service object that the sequenced packet socket
* will use to dispatch handlers for any asynchronous operations performed on
* the socket.
*
* @param endpoint An endpoint on the local machine to which the sequenced
* packet socket will be bound.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_seq_packet_socket(boost::asio::io_service& io_service,
const endpoint_type& endpoint)
: basic_socket<Protocol, SeqPacketSocketService>(io_service, endpoint)
{
}
/// Construct a basic_seq_packet_socket on an existing native socket.
/**
* This constructor creates a sequenced packet socket object to hold an
* existing native socket.
*
* @param io_service The io_service object that the sequenced packet socket
* will use to dispatch handlers for any asynchronous operations performed on
* the socket.
*
* @param protocol An object specifying protocol parameters to be used.
*
* @param native_socket The new underlying socket implementation.
*
* @throws boost::system::system_error Thrown on failure.
*/
basic_seq_packet_socket(boost::asio::io_service& io_service,
const protocol_type& protocol, const native_handle_type& native_socket)
: basic_socket<Protocol, SeqPacketSocketService>(
io_service, protocol, native_socket)
{
}
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Move-construct a basic_seq_packet_socket from another.
/**
* This constructor moves a sequenced packet socket from one object to
* another.
*
* @param other The other basic_seq_packet_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_seq_packet_socket(io_service&) constructor.
*/
basic_seq_packet_socket(basic_seq_packet_socket&& other)
: basic_socket<Protocol, SeqPacketSocketService>(
BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other))
{
}
/// Move-assign a basic_seq_packet_socket from another.
/**
* This assignment operator moves a sequenced packet socket from one object to
* another.
*
* @param other The other basic_seq_packet_socket object from which the move
* will occur.
*
* @note Following the move, the moved-from object is in the same state as if
* constructed using the @c basic_seq_packet_socket(io_service&) constructor.
*/
basic_seq_packet_socket& operator=(basic_seq_packet_socket&& other)
{
basic_socket<Protocol, SeqPacketSocketService>::operator=(
BOOST_ASIO_MOVE_CAST(basic_seq_packet_socket)(other));
return *this;
}
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
/// Send some data on the socket.
/**
* This function is used to send data on the sequenced packet socket. The
* function call will block until the data has been sent successfully, or an
* until error occurs.
*
* @param buffers One or more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @returns The number of bytes sent.
*
* @throws boost::system::system_error Thrown on failure.
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* socket.send(boost::asio::buffer(data, size), 0);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().send(
this->get_implementation(), buffers, flags, ec);
boost::asio::detail::throw_error(ec, "send");
return s;
}
/// Send some data on the socket.
/**
* This function is used to send data on the sequenced packet socket. The
* function call will block the data has been sent successfully, or an until
* error occurs.
*
* @param buffers One or more data buffers to be sent on the socket.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes sent. Returns 0 if an error occurred.
*
* @note The send operation may not transmit all of the data to the peer.
* Consider using the @ref write function if you need to ensure that all data
* is written before the blocking operation completes.
*/
template <typename ConstBufferSequence>
std::size_t send(const ConstBufferSequence& buffers,
socket_base::message_flags flags, boost::system::error_code& ec)
{
return this->get_service().send(
this->get_implementation(), buffers, flags, ec);
}
/// Start an asynchronous send.
/**
* This function is used to asynchronously send data on the sequenced packet
* socket. The function call always returns immediately.
*
* @param buffers One or more data buffers to be sent on the socket. Although
* the buffers object may be copied as necessary, ownership of the underlying
* memory blocks is retained by the caller, which must guarantee that they
* remain valid until the handler is called.
*
* @param flags Flags specifying how the send call is to be made.
*
* @param handler The handler to be called when the send operation completes.
* Copies will be made of the handler as required. The function signature of
* the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes sent.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To send a single data buffer use the @ref buffer function as follows:
* @code
* socket.async_send(boost::asio::buffer(data, size), 0, handler);
* @endcode
* See the @ref buffer documentation for information on sending multiple
* buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename ConstBufferSequence, typename WriteHandler>
void async_send(const ConstBufferSequence& buffers,
socket_base::message_flags flags,
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a WriteHandler.
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
this->get_service().async_send(this->get_implementation(),
buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler));
}
/// Receive some data on the socket.
/**
* This function is used to receive data on the sequenced packet socket. The
* function call will block until data has been received successfully, or
* until an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param out_flags After the receive call completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure. An error code of
* boost::asio::error::eof indicates that the connection was closed by the
* peer.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.receive(boost::asio::buffer(data, size), out_flags);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags& out_flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, 0, out_flags, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on the socket.
/**
* This function is used to receive data on the sequenced packet socket. The
* function call will block until data has been received successfully, or
* until an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param in_flags Flags specifying how the receive call is to be made.
*
* @param out_flags After the receive call completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record.
*
* @returns The number of bytes received.
*
* @throws boost::system::system_error Thrown on failure. An error code of
* boost::asio::error::eof indicates that the connection was closed by the
* peer.
*
* @note The receive operation may not receive all of the requested number of
* bytes. Consider using the @ref read function if you need to ensure that the
* requested amount of data is read before the blocking operation completes.
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.receive(boost::asio::buffer(data, size), 0, out_flags);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags in_flags,
socket_base::message_flags& out_flags)
{
boost::system::error_code ec;
std::size_t s = this->get_service().receive(
this->get_implementation(), buffers, in_flags, out_flags, ec);
boost::asio::detail::throw_error(ec, "receive");
return s;
}
/// Receive some data on a connected socket.
/**
* This function is used to receive data on the sequenced packet socket. The
* function call will block until data has been received successfully, or
* until an error occurs.
*
* @param buffers One or more buffers into which the data will be received.
*
* @param in_flags Flags specifying how the receive call is to be made.
*
* @param out_flags After the receive call completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record.
*
* @param ec Set to indicate what error occurred, if any.
*
* @returns The number of bytes received. Returns 0 if an error occurred.
*
* @note The receive operation may not receive all of the requested number of
* bytes. Consider using the @ref read function if you need to ensure that the
* requested amount of data is read before the blocking operation completes.
*/
template <typename MutableBufferSequence>
std::size_t receive(const MutableBufferSequence& buffers,
socket_base::message_flags in_flags,
socket_base::message_flags& out_flags, boost::system::error_code& ec)
{
return this->get_service().receive(this->get_implementation(),
buffers, in_flags, out_flags, ec);
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the sequenced
* packet socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param out_flags Once the asynchronous operation completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record. The caller must guarantee that the referenced
* variable remains valid until the handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.async_receive(boost::asio::buffer(data, size), out_flags, handler);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags& out_flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(), buffers,
0, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
/// Start an asynchronous receive.
/**
* This function is used to asynchronously receive data from the sequenced
* data socket. The function call always returns immediately.
*
* @param buffers One or more buffers into which the data will be received.
* Although the buffers object may be copied as necessary, ownership of the
* underlying memory blocks is retained by the caller, which must guarantee
* that they remain valid until the handler is called.
*
* @param in_flags Flags specifying how the receive call is to be made.
*
* @param out_flags Once the asynchronous operation completes, contains flags
* associated with the received data. For example, if the
* socket_base::message_end_of_record bit is set then the received data marks
* the end of a record. The caller must guarantee that the referenced
* variable remains valid until the handler is called.
*
* @param handler The handler to be called when the receive operation
* completes. Copies will be made of the handler as required. The function
* signature of the handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes received.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
* not, the handler will not be invoked from within this function. Invocation
* of the handler will be performed in a manner equivalent to using
* boost::asio::io_service::post().
*
* @par Example
* To receive into a single data buffer use the @ref buffer function as
* follows:
* @code
* socket.async_receive(
* boost::asio::buffer(data, size),
* 0, out_flags, handler);
* @endcode
* See the @ref buffer documentation for information on receiving into
* multiple buffers in one go, and how to use it with arrays, boost::array or
* std::vector.
*/
template <typename MutableBufferSequence, typename ReadHandler>
void async_receive(const MutableBufferSequence& buffers,
socket_base::message_flags in_flags,
socket_base::message_flags& out_flags,
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
{
// If you get an error on the following line it means that your handler does
// not meet the documented type requirements for a ReadHandler.
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
this->get_service().async_receive(this->get_implementation(), buffers,
in_flags, out_flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler));
}
};
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
#endif // BOOST_ASIO_BASIC_SEQ_PACKET_SOCKET_HPP

Some files were not shown because too many files have changed in this diff Show More