tandemparametersfile.h 2.29 KB
Newer Older
1
2
3
4
5
6
7
8
/**
 * \file /files/tandemparametersfile.h
 * \date 19/9/2017
 * \author Olivier Langella
 * \brief handles X!Tandem parameters file (presets)
 */

/*******************************************************************************
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
 *
 * This file is part of XTPcpp.
 *
 *     XTPcpp is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     XTPcpp is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with XTPcpp.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Contributors:
 *     Olivier Langella <olivier.langella@u-psud.fr> - initial API and
 *implementation
 ******************************************************************************/
30

31
#pragma once
32
33
34
35
36
37
38
39

#include <QFileInfo>
#include <QXmlStreamWriter>
#include "../core/tandem_run/tandemparameters.h"

class TandemParametersFile
{

40
41
42
43
44
  public:
  TandemParametersFile(const QString &param_file);
  TandemParametersFile(const QFileInfo &param_file);
  TandemParametersFile(const TandemParametersFile &other);
  ~TandemParametersFile();
45

46
47
48
49
50
  const QString getMethodName() const;
  const QString getFilename() const;
  const QDir getAbsoluteDir() const;
  const QString getAbsoluteFilePath() const;
  bool exists() const;
51

52
53
  /** @brief tells if this file is really a tandem preset file
   */
54
  bool isTandemPresetFile();
55
56
57

  /** @brief read tandem parameters from XML file
   */
58
  TandemParameters getTandemParameters();
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

  /** @brief write tandem parameters  to XML file
   */
  void setTandemParameters(const TandemParameters &parameters);

  /** @brief set param file directory
   */
  void setDirectory(const QDir &directory);

  private:
  void writeXmlParametersFile(QXmlStreamWriter *p_out,
                              const TandemParameters &parameters) const;

  private:
  QFileInfo _param_source;
74
  bool m_isTandemParameterFile = false;
75
};