]> git.lyx.org Git - lyx.git/blob - src/graphics/EPS_Renderer.C
prepare for 1.1.6pre2
[lyx.git] / src / graphics / EPS_Renderer.C
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995 Matthias Ettrich.
7  *          Copyright 1995-2000 The LyX Team.
8  *
9  *          This file Copyright 2000 Baruch Even
10  * ================================================= */
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include <config.h>
17 #include "EPS_Renderer.h"
18
19 #include FORMS_H_LOCATION
20 #include <iostream>
21 #include <fstream>
22
23 #include "support/LAssert.h"
24 #include "debug.h"
25
26 using std::endl;
27 using std::ios;
28
29
30 EPS_Renderer::EPS_Renderer()
31         : Renderer()
32 {}
33
34
35 bool EPS_Renderer::renderImage()
36 {
37         return false;
38 }
39
40
41 bool EPS_Renderer::isImageFormatOK(string const & filename) const
42 {
43         std::ifstream is(filename.c_str());
44
45         // The signature of the file without the spaces.
46         static const char str[] = "%!PS";
47         const char * ptr = str;
48
49         do {
50                 char c;
51                 is >> c;
52
53                 if (c != *ptr)
54                         return false;
55                 
56                 ++ptr;
57         } while (*ptr != '\0');
58
59         return true;
60 }