uses enum
[scilab.git] / scilab / modules / output_stream / src / cpp / Diary.hxx
1 /*--------------------------------------------------------------------------*/ 
2 /*
3 * ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) DIGITEO - 2009 - Allan CORNET
5
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution.  The terms
9 * are also available at    
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11 *
12 */
13 /*--------------------------------------------------------------------------*/ 
14 #ifndef __DIARY_HXX__
15 #define __DIARY_HXX__
16 /*--------------------------------------------------------------------------*/ 
17 #include <string>
18 #include "DiaryModesEnum.hxx"
19 /*--------------------------------------------------------------------------*/ 
20 class Diary
21 {
22 private:
23         std::wstring wfilename;
24         int ID_foutstream;
25
26         int fileAttribMode;
27
28         void setID(int _ID);
29
30         /* resume mode */
31         bool suspendwrite;
32
33         /* see DiaryModesEnum.hxx */
34         diary_prefix_time_format PrefixTimeFormat;
35
36         /* see DiaryModesEnum.hxx */
37         diary_prefix_time_filter PrefixIoModeFilter;
38
39         /* see DiaryModesEnum.hxx */
40         diary_filter IoModeFilter;
41
42         /*
43         * used on Windows to replace carriage return
44         */
45         std::wstring replace(std::wstring text, std::wstring s, std::wstring replacement);
46
47 public:
48         /*
49         * constructor
50         */
51         Diary(std::wstring _wfilename,int _mode,int ID);
52
53         /*
54         * destructor
55         */
56         ~Diary();
57
58         /*
59         * get filename of this diary
60         */
61         std::wstring getFilename(void);
62
63         /*
64         * get & set IO mode
65         */
66         void setIOMode(diary_filter _mode);
67         diary_filter getIOMode(void);
68
69         /*
70         * get ID of this diary
71         */
72         int getID(void);
73
74         /*
75         * write a string in this diary
76         */
77         void write(std::wstring _wstr, bool bInput);
78
79         /*
80         * write a line in this diary
81         */
82         void writeln(std::wstring _wstr, bool bInput);
83
84         /*
85         * get & set Resume mode 
86         */
87         bool setSuspendWrite(bool bWith);
88         bool getSuspendWrite(void);
89
90         /*
91         * get & set Prefix mode
92         */
93         void setPrefixMode(diary_prefix_time_format iPrefixTimeFormat);
94         diary_prefix_time_format getPrefixMode(void);
95
96         /*
97         * get & set IO mode filter
98         */
99         void setPrefixIoModeFilter(diary_prefix_time_filter mode);
100         diary_prefix_time_filter getPrefixIoModeFilter(void);
101 };
102
103 #endif /* __DIARY_HXX__ */
104 /*--------------------------------------------------------------------------*/ 
105 bool compareDiary(Diary first,Diary second);
106 /*--------------------------------------------------------------------------*/