1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-11 14:19:49 +00:00

Throw if glob parsing fails.

This also fixes the warning about an unused boolean variable.
This commit is contained in:
King_DuckZ 2016-05-12 20:02:33 +02:00
parent 217b41ace2
commit 253af1a3ad
6 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/* Copyright 2015, 2016, Michele Santullo
* This file is part of "dindexer".
*
* "dindexer" 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.
*
* "dindexer" 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 "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef id998F0978CB064D728DDD7BE77F1FD9DC
#define id998F0978CB064D728DDD7BE77F1FD9DC
#include <stdexcept>
#include <string>
namespace g2r {
class ParsingError : public std::runtime_error {
public:
ParsingError ( void ) = delete;
~ParsingError ( void ) noexcept = default;
ParsingError ( const std::string& parGlob, unsigned int parPosition );
const std::string& glob ( void ) const noexcept;
unsigned int position ( void ) const noexcept;
private:
std::string m_glob;
unsigned int m_position;
};
} //namespace g2r
#endif

View file

@ -18,6 +18,7 @@
#ifndef id98DC1C17239B4DD38C8697EC91BC3DA4
#define id98DC1C17239B4DD38C8697EC91BC3DA4
#include "glob2regex/exceptions.hpp"
#include <string>
namespace g2r {