-
Notifications
You must be signed in to change notification settings - Fork 0
/
pickleException.h
51 lines (38 loc) · 1015 Bytes
/
pickleException.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// -*- @c C/C++ Library -*-
/// -*- @c #include"pickle.h" -*-
/**
* Standerd @c Exception file for @c pickle Module.
**/
/**
* @author @c "Usama_Azad"
*
* All the Rights are reserved @c 2k20 @c 2k21.
*
* This file is not a @c C/C++ standard @c Header.
**/
#ifndef __pickle_Exception__
#define __pickle_Exception__
#ifdef __cplusplus
#include <string>
#include <stdexcept>
class file_name_error : public std::runtime_error
{
public:
file_name_error()
: runtime_error("File name is Invalid: Please enter only file name without Extension...") {}
};
class file_open_error : public std::runtime_error
{
public:
file_open_error()
: runtime_error("File does not open: Please check file name or file present in your current working directory and try again...") {}
};
bool check_file_name(std::string filename)
{
for (auto c : filename)
if (c == '.' || c == '*')
return false;
return true;
}
#endif
#endif