Mass++ mzML IO Plugin v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations
MzmlIOPluginFunctions.cpp
Go to the documentation of this file.
1 
12 #include "stdafx.h"
13 #include "MzmlIOPluginFunctions.h"
14 #include "MzmlSample.h"
15 #include "MzmlManager.h"
16 #include "MzmlSampleSet.h"
17 
18 #define DATA_STATUS "data_status"
19 
20 
21 using namespace kome::io::mzml;
22 
23 
24 #include <crtdbg.h>
25 #ifdef _DEBUG
26  #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
27  #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
28 #endif // _DEBUG
29 
30 
31 
32 // open file
33 kome::objects::Variant openMzml( kome::objects::Parameters* params ) {
34  // return value
35  kome::objects::Variant ret;
36  ret.type = kome::objects::Variant::SAMPLE_SET;
37  ret.prim.pt = NULL;
38 
39  // get path
40  const char* path = kome::plugin::PluginCallTool::getPath( params );
41  if( path == NULL ) {
42  return ret;
43  }
44 
45  // open
46  MzmlSampleSet* sampleSet = new MzmlSampleSet();
47 
48  // set file
49  ret.prim.pt = sampleSet;
50 
51  return ret;
52 }
53 
54 // save file
55 kome::objects::Variant saveMzml( kome::objects::Parameters* params ) {
56  // return value
57  kome::objects::Variant ret;
58  ret.type = kome::objects::Variant::BOOL;
59  ret.prim.boolVal = false;
60 
61  // gets parameters
62  kome::objects::DataSet* dataSet = kome::plugin::PluginCallTool::getDataSet( params );
63  if( dataSet == NULL ) {
64  return ret;
65  }
66 
67  char* path = kome::plugin::PluginCallTool::getPath( params );
68  if( path == NULL ) {
69  return ret;
70  }
71 
72  kome::core::Progress* progress = kome::plugin::PluginCallTool::getProgress( params );
73  if( progress == NULL ) {
74  progress = &kome::core::Progress::getIgnoringProgress();
75  }
76 
77  kome::objects::SettingParameterValues* saveSettings = kome::plugin::PluginCallTool::getSettingValues( params ); // @date 2012/08/21 <Add> FUJITA
78 
79  // write
81  ret.prim.boolVal = mgr.exportDataSet( path, *dataSet, *progress, saveSettings );
82  return ret;
83 }
interfaces of MzmlSample class
mzML sample set class
Definition: MzmlSampleSet.h:24
interfaces of MzmlManager class
common header file
interfaces of MzmlSampleSet class
static MzmlManager & getInstance()
gets mzML IO management object
mzML IO management class
Definition: MzmlManager.h:26
kome::objects::Variant openMzml(kome::objects::Parameters *params)
open mzml file
interfaces of MzmlIO plug-in function
kome::objects::Variant saveMzml(kome::objects::Parameters *params)
save mzml file