00001
00002
00011
00012 #include "CommonPreamble.h"
00013
00014 #include "FennelResource.h"
00015 #include "ResourceBundle.h"
00016 #include "Locale.h"
00017
00018 #include <map>
00019 #include <string>
00020
00021 namespace fennel {
00022
00023 using namespace std;
00024
00025 #define BASENAME ("FennelResource")
00026
00027 static FennelResourceBundleCache bundleCache;
00028 static string bundleLocation("");
00029
00030 const FennelResource &FennelResource::instance()
00031 {
00032 return FennelResource::instance(Locale::getDefault());
00033 }
00034
00035 const FennelResource &FennelResource::instance(const Locale &locale)
00036 {
00037 return *makeInstance<FennelResource, FennelResourceBundleCache, FennelResourceBundleCache::iterator>(bundleCache, locale);
00038 }
00039
00040 void FennelResource::setResourceFileLocation(const string &location)
00041 {
00042 bundleLocation = location;
00043 }
00044
00045 FennelResource::FennelResource(Locale locale)
00046 : ResourceBundle(BASENAME, locale, bundleLocation),
00047 _sysCallFailed(this, "sysCallFailed"),
00048 _duplicateKeyDetected(this, "duplicateKeyDetected"),
00049 _internalError(this, "internalError"),
00050 _executionAborted(this, "executionAborted"),
00051 _rowTooLong(this, "rowTooLong"),
00052 _invalidParam(this, "invalidParam"),
00053 _scalarQueryReturnedMultipleRows(this, "scalarQueryReturnedMultipleRows"),
00054 _scratchMemExhausted(this, "scratchMemExhausted"),
00055 _uniqueConstraintViolated(this, "uniqueConstraintViolated"),
00056 _incompatibleDataFormat(this, "incompatibleDataFormat"),
00057 _libaioRequired(this, "libaioRequired"),
00058 _unsupportedOperation(this, "unsupportedOperation"),
00059 _outOfBackupSpace(this, "outOfBackupSpace"),
00060 _mismatchedRestore(this, "mismatchedRestore"),
00061 _openBackupFileFailed(this, "openBackupFileFailed"),
00062 _readBackupFileFailed(this, "readBackupFileFailed"),
00063 _writeBackupFileFailed(this, "writeBackupFileFailed"),
00064 _readDataPageFailed(this, "readDataPageFailed"),
00065 _writeDataPageFailed(this, "writeDataPageFailed"),
00066 _outOfSpaceDuringRestore(this, "outOfSpaceDuringRestore"),
00067 _bitmapEntryTooLong(this, "bitmapEntryTooLong"),
00068 _readDataFailed(this, "readDataFailed"),
00069 _dataTransferFailed(this, "dataTransferFailed"),
00070 _writeLogFailed(this, "writeLogFailed"),
00071 _noRowsReturned(this, "noRowsReturned"),
00072 _errorsEncountered(this, "errorsEncountered"),
00073 _noRowDelimiter(this, "noRowDelimiter"),
00074 _incompleteColumn(this, "incompleteColumn"),
00075 _noColumnDelimiter(this, "noColumnDelimiter"),
00076 _tooFewColumns(this, "tooFewColumns"),
00077 _tooManyColumns(this, "tooManyColumns"),
00078 _rowTextTooLong(this, "rowTextTooLong"),
00079 _flatfileDescribeFailed(this, "flatfileDescribeFailed"),
00080 _flatfileNoHeader(this, "flatfileNoHeader"),
00081 _flatfileMappedRequiresLenient(this, "flatfileMappedRequiresLenient"),
00082 _flatfileNoMappedColumns(this, "flatfileNoMappedColumns")
00083 {
00084 }
00085
00086 string FennelResource::sysCallFailed(const std::string &p0) const
00087 {
00088 return _sysCallFailed.format(p0);
00089 }
00090 string FennelResource::duplicateKeyDetected(const std::string &p0) const
00091 {
00092 return _duplicateKeyDetected.format(p0);
00093 }
00094 string FennelResource::internalError(const std::string &p0) const
00095 {
00096 return _internalError.format(p0);
00097 }
00098 string FennelResource::executionAborted() const
00099 {
00100 return _executionAborted.format();
00101 }
00102 string FennelResource::rowTooLong(int p0, int p1, const std::string &p2) const
00103 {
00104 return _rowTooLong.format(p0, p1, p2);
00105 }
00106 string FennelResource::invalidParam(const std::string &p0, const std::string &p1) const
00107 {
00108 return _invalidParam.format(p0, p1);
00109 }
00110 string FennelResource::scalarQueryReturnedMultipleRows() const
00111 {
00112 return _scalarQueryReturnedMultipleRows.format();
00113 }
00114 string FennelResource::scratchMemExhausted() const
00115 {
00116 return _scratchMemExhausted.format();
00117 }
00118 string FennelResource::uniqueConstraintViolated() const
00119 {
00120 return _uniqueConstraintViolated.format();
00121 }
00122 string FennelResource::incompatibleDataFormat() const
00123 {
00124 return _incompatibleDataFormat.format();
00125 }
00126 string FennelResource::libaioRequired() const
00127 {
00128 return _libaioRequired.format();
00129 }
00130 string FennelResource::unsupportedOperation(const std::string &p0) const
00131 {
00132 return _unsupportedOperation.format(p0);
00133 }
00134 string FennelResource::outOfBackupSpace() const
00135 {
00136 return _outOfBackupSpace.format();
00137 }
00138 string FennelResource::mismatchedRestore() const
00139 {
00140 return _mismatchedRestore.format();
00141 }
00142 string FennelResource::openBackupFileFailed(const std::string &p0) const
00143 {
00144 return _openBackupFileFailed.format(p0);
00145 }
00146 string FennelResource::readBackupFileFailed(const std::string &p0) const
00147 {
00148 return _readBackupFileFailed.format(p0);
00149 }
00150 string FennelResource::writeBackupFileFailed(const std::string &p0) const
00151 {
00152 return _writeBackupFileFailed.format(p0);
00153 }
00154 string FennelResource::readDataPageFailed() const
00155 {
00156 return _readDataPageFailed.format();
00157 }
00158 string FennelResource::writeDataPageFailed() const
00159 {
00160 return _writeDataPageFailed.format();
00161 }
00162 string FennelResource::outOfSpaceDuringRestore() const
00163 {
00164 return _outOfSpaceDuringRestore.format();
00165 }
00166 string FennelResource::bitmapEntryTooLong(int p0, int p1, const std::string &p2) const
00167 {
00168 return _bitmapEntryTooLong.format(p0, p1, p2);
00169 }
00170 string FennelResource::readDataFailed(const std::string &p0) const
00171 {
00172 return _readDataFailed.format(p0);
00173 }
00174 string FennelResource::dataTransferFailed(const std::string &p0, int p1) const
00175 {
00176 return _dataTransferFailed.format(p0, p1);
00177 }
00178 string FennelResource::writeLogFailed(const std::string &p0) const
00179 {
00180 return _writeLogFailed.format(p0);
00181 }
00182 string FennelResource::noRowsReturned(const std::string &p0, const std::string &p1) const
00183 {
00184 return _noRowsReturned.format(p0, p1);
00185 }
00186 string FennelResource::errorsEncountered(const std::string &p0, const std::string &p1) const
00187 {
00188 return _errorsEncountered.format(p0, p1);
00189 }
00190 string FennelResource::noRowDelimiter(const std::string &p0) const
00191 {
00192 return _noRowDelimiter.format(p0);
00193 }
00194 string FennelResource::incompleteColumn() const
00195 {
00196 return _incompleteColumn.format();
00197 }
00198 string FennelResource::noColumnDelimiter() const
00199 {
00200 return _noColumnDelimiter.format();
00201 }
00202 string FennelResource::tooFewColumns() const
00203 {
00204 return _tooFewColumns.format();
00205 }
00206 string FennelResource::tooManyColumns() const
00207 {
00208 return _tooManyColumns.format();
00209 }
00210 string FennelResource::rowTextTooLong() const
00211 {
00212 return _rowTextTooLong.format();
00213 }
00214 string FennelResource::flatfileDescribeFailed(const std::string &p0) const
00215 {
00216 return _flatfileDescribeFailed.format(p0);
00217 }
00218 string FennelResource::flatfileNoHeader(const std::string &p0, const std::string &p1) const
00219 {
00220 return _flatfileNoHeader.format(p0, p1);
00221 }
00222 string FennelResource::flatfileMappedRequiresLenient() const
00223 {
00224 return _flatfileMappedRequiresLenient.format();
00225 }
00226 string FennelResource::flatfileNoMappedColumns(const std::string &p0, const std::string &p1) const
00227 {
00228 return _flatfileNoMappedColumns.format(p0, p1);
00229 }
00230
00231 }
00232
00233