Changeset 2182
- Timestamp:
- 28/05/2008 16:25:59 (4 years ago)
- Location:
- box/trunk/bin/bbackupquery
- Files:
-
- 2 edited
-
BackupQueries.cpp (modified) (19 diffs)
-
BackupQueries.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupquery/BackupQueries.cpp
r2158 r2182 123 123 BOX_WARNING("System command returned error code " << 124 124 result); 125 SetReturnCode( COMMAND_RETURN_ERROR);125 SetReturnCode(ReturnCode::Command_Error); 126 126 } 127 127 return; … … 296 296 { 297 297 // If not a quit command, set the return code to zero 298 SetReturnCode( 0);298 SetReturnCode(ReturnCode::Command_OK); 299 299 } 300 300 … … 411 411 BOX_ERROR("Directory '" << args[0] << "' not found " 412 412 "on store."); 413 SetReturnCode( COMMAND_RETURN_ERROR);413 SetReturnCode(ReturnCode::Command_Error); 414 414 return; 415 415 } … … 449 449 { 450 450 BOX_ERROR("Failed to list directory: " << e.what()); 451 SetReturnCode( COMMAND_RETURN_ERROR);451 SetReturnCode(ReturnCode::Command_Error); 452 452 return; 453 453 } … … 455 455 { 456 456 BOX_ERROR("Failed to list directory: unknown error"); 457 SetReturnCode( COMMAND_RETURN_ERROR);457 SetReturnCode(ReturnCode::Command_Error); 458 458 return; 459 459 } … … 774 774 { 775 775 BOX_ERROR("Incorrect usage. cd [-o] [-d] <directory>"); 776 SetReturnCode( COMMAND_RETURN_ERROR);776 SetReturnCode(ReturnCode::Command_Error); 777 777 return; 778 778 } … … 792 792 { 793 793 BOX_ERROR("Directory '" << args[0] << "' not found."); 794 SetReturnCode( COMMAND_RETURN_ERROR);794 SetReturnCode(ReturnCode::Command_Error); 795 795 return; 796 796 } … … 814 814 { 815 815 BOX_ERROR("Incorrect usage. lcd <local-directory>"); 816 SetReturnCode( COMMAND_RETURN_ERROR);816 SetReturnCode(ReturnCode::Command_Error); 817 817 return; 818 818 } … … 824 824 { 825 825 BOX_ERROR("Failed to convert path from console encoding."); 826 SetReturnCode( COMMAND_RETURN_ERROR);826 SetReturnCode(ReturnCode::Command_Error); 827 827 return; 828 828 } … … 843 843 } 844 844 845 SetReturnCode( COMMAND_RETURN_ERROR);845 SetReturnCode(ReturnCode::Command_Error); 846 846 return; 847 847 } … … 852 852 { 853 853 BOX_LOG_SYS_ERROR("Error getting current directory"); 854 SetReturnCode( COMMAND_RETURN_ERROR);854 SetReturnCode(ReturnCode::Command_Error); 855 855 return; 856 856 } … … 860 860 { 861 861 BOX_ERROR("Failed to convert new path from console encoding."); 862 SetReturnCode( COMMAND_RETURN_ERROR);862 SetReturnCode(ReturnCode::Command_Error); 863 863 return; 864 864 } … … 1070 1070 BOX_ERROR("The local file " << localName << " already exists, " 1071 1071 "will not overwrite it."); 1072 SetReturnCode( COMMAND_RETURN_ERROR);1072 SetReturnCode(ReturnCode::Command_Error); 1073 1073 return; 1074 1074 } … … 1269 1269 if (params.mUncheckedFiles != 0) 1270 1270 { 1271 SetReturnCode( COMPARE_RETURN_ERROR);1271 SetReturnCode(ReturnCode::Compare_Error); 1272 1272 } 1273 1273 else if (params.mDifferences != 0) 1274 1274 { 1275 SetReturnCode( COMPARE_RETURN_DIFFERENT);1275 SetReturnCode(ReturnCode::Compare_Different); 1276 1276 } 1277 1277 else 1278 1278 { 1279 SetReturnCode( COMPARE_RETURN_SAME);1279 SetReturnCode(ReturnCode::Compare_Same); 1280 1280 } 1281 1281 } … … 2056 2056 { 2057 2057 BOX_ERROR("Failed to restore: " << e.what()); 2058 SetReturnCode( COMMAND_RETURN_ERROR);2058 SetReturnCode(ReturnCode::Command_Error); 2059 2059 return; 2060 2060 } … … 2062 2062 { 2063 2063 BOX_ERROR("Failed to restore: unknown exception"); 2064 SetReturnCode( COMMAND_RETURN_ERROR);2064 SetReturnCode(ReturnCode::Command_Error); 2065 2065 return; 2066 2066 } … … 2080 2080 BOX_ERROR("Resume possible -- repeat command with -r flag " 2081 2081 "to resume."); 2082 SetReturnCode( COMMAND_RETURN_ERROR);2082 SetReturnCode(ReturnCode::Command_Error); 2083 2083 break; 2084 2084 … … 2086 2086 BOX_ERROR("The target directory exists. You cannot restore " 2087 2087 "over an existing directory."); 2088 SetReturnCode( COMMAND_RETURN_ERROR);2088 SetReturnCode(ReturnCode::Command_Error); 2089 2089 break; 2090 2090 … … 2093 2093 "To restore to a directory whose parent " 2094 2094 "does not exist, create the parent first."); 2095 SetReturnCode( COMMAND_RETURN_ERROR);2095 SetReturnCode(ReturnCode::Command_Error); 2096 2096 break; 2097 2097 2098 2098 case Restore_UnknownError: 2099 2099 BOX_ERROR("Unknown error during restore."); 2100 SetReturnCode( COMMAND_RETURN_ERROR);2100 SetReturnCode(ReturnCode::Command_Error); 2101 2101 break; 2102 2102 2103 2103 default: 2104 2104 BOX_ERROR("Unknown restore result " << result << "."); 2105 SetReturnCode( COMMAND_RETURN_ERROR);2105 SetReturnCode(ReturnCode::Command_Error); 2106 2106 break; 2107 2107 } -
box/trunk/bin/bbackupquery/BackupQueries.h
r1487 r2182 80 80 box_time_t mLatestFileUploadTime; 81 81 }; 82 void CompareLocation(const std::string &rLocation, CompareParams &rParams); 83 void Compare(const std::string &rStoreDir, const std::string &rLocalDir, CompareParams &rParams); 84 void Compare(int64_t DirID, const std::string &rStoreDir, const std::string &rLocalDir, CompareParams &rParams); 82 void CompareLocation(const std::string &rLocation, 83 CompareParams &rParams); 84 void Compare(const std::string &rStoreDir, 85 const std::string &rLocalDir, CompareParams &rParams); 86 void Compare(int64_t DirID, const std::string &rStoreDir, 87 const std::string &rLocalDir, CompareParams &rParams); 88 89 public: 90 91 class ReturnCode 92 { 93 public: 94 enum { 95 Command_OK = 0, 96 Compare_Same = 1, 97 Compare_Different, 98 Compare_Error, 99 Command_Error, 100 } Type; 101 }; 102 103 private: 85 104 86 105 // Utility functions
Note: See TracChangeset
for help on using the changeset viewer.
