source: Sophya/trunk/Poubelle/DPC:FitsIOServer/Blitz/blitz/prettyprint.h@ 658

Last change on this file since 658 was 658, checked in by ansari, 26 years ago

no message

File size: 2.3 KB
Line 
1/***************************************************************************
2 * blitz/prettyprint.h Format object for pretty-printing of
3 * array expressions
4 *
5 * $Id: prettyprint.h,v 1.1.1.1 1999-11-26 16:37:04 ansari Exp $
6 *
7 * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Suggestions: blitz-suggest@cybervision.com
20 * Bugs: blitz-bugs@cybervision.com
21 *
22 * For more information, please see the Blitz++ Home Page:
23 * http://seurat.uwaterloo.ca/blitz/
24 *
25 ***************************************************************************
26 * $Log: not supported by cvs2svn $
27 * Revision 1.1.1.1 1999/04/09 17:59:02 ansari
28 * Creation module DPC/Blitz (blitz 0.4) Reza 09/04/99
29 *
30 * Revision 1.2 1998/03/14 00:04:47 tveldhui
31 * 0.2-alpha-05
32 *
33 */
34
35#ifndef BZ_PRETTYPRINT_H
36#define BZ_PRETTYPRINT_H
37
38BZ_NAMESPACE(blitz)
39
40class prettyPrintFormat {
41
42public:
43 prettyPrintFormat(_bz_bool terse = _bz_false)
44 : tersePrintingSelected_(terse)
45 {
46 arrayOperandCounter_ = 0;
47 scalarOperandCounter_ = 0;
48 dumpArrayShapes_ = _bz_false;
49 }
50
51 void setDumpArrayShapesMode()
52 {
53 dumpArrayShapes_ = _bz_true;
54 }
55
56 char nextArrayOperandSymbol()
57 {
58 return 'A' + ((arrayOperandCounter_++) % 26);
59 }
60
61 char nextScalarOperandSymbol()
62 {
63 return 's' + ((scalarOperandCounter_++) % 26);
64 }
65
66 _bz_bool tersePrintingSelected() const
67 {
68 return tersePrintingSelected_;
69 }
70
71 _bz_bool dumpArrayShapesMode() const
72 {
73 return dumpArrayShapes_;
74 }
75
76private:
77 _bz_bool tersePrintingSelected_;
78 _bz_bool dumpArrayShapes_;
79 int arrayOperandCounter_;
80 int scalarOperandCounter_;
81};
82
83BZ_NAMESPACE_END
84
85#endif // BZ_PRETTYPRINT_H
Note: See TracBrowser for help on using the repository browser.