2 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file src/common/exceptions/BucketRecordCorruptedException.h
18 * @author Aleksander Zdyb <a.zdyb@samsung.com>
19 * @author Pawel Wieczorek <p.wieczorek2@samsung.com>
21 * @brief Implementation of BucketRecordCorruptedException
24 #ifndef SRC_COMMON_EXCEPTIONS_BUCKETRECORDCORRUPTEDEXCEPTION_H_
25 #define SRC_COMMON_EXCEPTIONS_BUCKETRECORDCORRUPTEDEXCEPTION_H_
29 #include <exceptions/RecordCorruptedException.h>
33 class BucketRecordCorruptedException : public RecordCorruptedException {
35 BucketRecordCorruptedException() = delete;
36 virtual ~BucketRecordCorruptedException() {};
38 BucketRecordCorruptedException(const std::string &line) : RecordCorruptedException(line) {
39 setMessage(subtype());
42 BucketRecordCorruptedException withLineNumber(const size_t &lineNumber) const {
43 BucketRecordCorruptedException copy(*this);
44 copy.m_lineNumber = lineNumber;
45 copy.setMessage(copy.subtype());
49 BucketRecordCorruptedException withFilename(const std::string &filename) const {
50 BucketRecordCorruptedException copy(*this);
51 copy.m_filename = filename;
52 copy.setMessage(copy.subtype());
57 const std::string &subtype(void) {
58 static const std::string subtype("Bucket");
63 } /* namespace Cynara */
65 #endif /* SRC_COMMON_EXCEPTIONS_BUCKETRECORDCORRUPTEDEXCEPTION_H_ */