~ubuntu-branches/ubuntu/vivid/regina-normal/vivid

« back to all changes in this revision

Viewing changes to engine/foreign/pdf.h

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2014-08-29 17:37:46 UTC
  • mfrom: (19.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140829173746-igmqc9b67y366a7u
Tags: 4.96-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Regina - A Normal Surface Theory Calculator                           *
5
5
 *  Computational Engine                                                  *
6
6
 *                                                                        *
7
 
 *  Copyright (c) 1999-2013, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2014, Ben Burton                                   *
8
8
 *  For further details contact Ben Burton (bab@debian.org).              *
9
9
 *                                                                        *
10
10
 *  This program is free software; you can redistribute it and/or         *
34
34
 
35
35
/*! \file foreign/pdf.h
36
36
 *  \brief Allows reading and writing PDF documents.
 
37
 *
 
38
 *  \deprecated All global functions that were once declared in this file have
 
39
 *  now been renamed to member functions of NPDF.
37
40
 */
38
41
 
39
42
#ifndef __PDF_H
53
56
 */
54
57
 
55
58
/**
56
 
 * Reads a PDF document from the given file.  A newly allocated PDF packet
57
 
 * will be returned; it is the user's responsibility to deallocate this
58
 
 * when it is finished with.
59
 
 *
60
 
 * This routine does not check whether the given file \e looks like a
61
 
 * PDF document; it simply loads the file contents blindly.
62
 
 *
63
 
 * The packet label of the new PDF packet will be left empty.
64
 
 *
65
 
 * If the file could not be read, 0 will be returned.
66
 
 *
67
 
 * \i18n This routine makes no assumptions about the
68
 
 * \ref i18n "character encoding" used in the given file \e name, and
69
 
 * simply passes it through unchanged to low-level C/C++ file I/O routines.
70
 
 *
71
 
 * @param filename the filename of the PDF document to read.
72
 
 * @return a new PDF packet containing the PDF document, or 0 on error.
 
59
 * Deprecated function that reads a PDF document from the given file.
 
60
 *
 
61
 * If the file could not be read, or if the file is empty, then 0 will be
 
62
 * returned.  Otherwise a newly allocated PDF packet will be returned, and it
 
63
 * is the user's responsibility to deallocate this when it is finished with.
 
64
 *
 
65
 * \deprecated You should use the NPDF constructor NPDF::NPDF(const char*),
 
66
 * and you should pass the filename as the single string argument.
 
67
 * In situations where this routine would have returned a null pointer, the
 
68
 * NPDF constructor will instead create a null document (i.e., one for which
 
69
 * NPDF::isNull() returns \c true).  See the NPDF constructor for further
 
70
 * details.
73
71
 */
74
72
REGINA_API NPDF* readPDF(const char *filename);
75
73
 
76
74
/**
77
 
 * Writes the given PDF document to the given file.
78
 
 *
79
 
 * This routine does not check whether the contents of the given packet
80
 
 * \e look like a PDF document; it simply writes them blindly to the
81
 
 * given file.
82
 
 *
83
 
 * If the given PDF packet is empty (i.e., does not contain a real block
84
 
 * of data) then the resulting file will be created but left empty.
85
 
 *
86
 
 * \i18n This routine makes no assumptions about the
87
 
 * \ref i18n "character encoding" used in the given file \e name, and
88
 
 * simply passes it through unchanged to low-level C/C++ file I/O routines.
89
 
 *
90
 
 * @param filename the filename of the PDF document to write.
91
 
 * @param pdf the PDF packet to write to the given file.
92
 
 * @return \c true if the export was successful, or \c false otherwise.
 
75
 * Deprecated function that writes the given PDF document to the given file.
 
76
 *
 
77
 * \deprecated This routine has been renamed as NPDF::savePDF().  This old
 
78
 * routine behaves exactly as in the past, but the new NPDF::savePDF() has
 
79
 * a slight change in behaviour: if the PDF packet contains no data then
 
80
 * it no longer creates an empty file, but instead does nothing and returns
 
81
 * \c false.  See NPDF::savePDF() for further details.
93
82
 */
94
83
REGINA_API bool writePDF(const char* filename, const NPDF& pdf);
95
84