NCBI C++ ToolKit
win_mask_counts_converter.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: win_mask_counts_converter.hpp 84663 2018-11-27 18:22:00Z ucko $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Aleksandr Morgulis
27  *
28  * File Description:
29  * Header for counts format converter class.
30  *
31  */
32 
33 #ifndef C_WIN_MASK_COUNTS_CONVERTER_H
34 #define C_WIN_MASK_COUNTS_CONVERTER_H
35 
36 #include <corelib/ncbistre.hpp>
37 #include <corelib/ncbiexpt.hpp>
38 
40 
42 
43 /**
44  \brief Class responsible for converting unit counts between different formats.
45  **/
47 {
48  public:
49 
50  /**
51  \brief Class defining exceptions specific to CWinMaskCountsConverter.
52  **/
54  {
55  public:
56 
57  /**\brief Error codes.
58  */
59  enum EErrCode
60  {
61  eBadOption ///< Command line options inconsistency.
62  };
63 
64  /**
65  \brief Return description string corresponding to an error code.
66 
67  \return error string
68  **/
69  virtual const char * GetErrCodeString() const override;
70 
72  };
73 
74  /**
75  \brief Instance constructor.
76 
77  \param input_fname input file name
78  \param output_fname output file name
79  \param counts_format desired format for the output
80  **/
82  const string & input_fname,
83  const string & output_fname,
84  const string & counts_oformat,
85  string const & metadata );
86 
87  /**
88  \brief Instance constructor.
89 
90  \param input_fname input file name
91  \param out_stream the output stream
92  \param counts_format desired format for the output
93  **/
95  const string & input_fname,
96  CNcbiOstream & out_stream,
97  const string & counts_oformat,
98  string const & metadata );
99 
100  /**
101  \brief Method performing the actual conversion.
102 
103  \return 0 on success; 1 on failure.
104  **/
105  int operator()();
106 
107  private:
108 
109  CRef< CSeqMaskerIstat > istat; ///< object containing unit counts read from the input
110  string ofname; ///< output file name
111  string oformat; ///< target n-mer counts format for the output
113  string metadata;
114 };
115 
117 
118 #endif
119 
Class defining exceptions specific to CWinMaskCountsConverter.
NCBI_EXCEPTION_DEFAULT(Exception, CException)
Class responsible for converting unit counts between different formats.
string oformat
target n-mer counts format for the output
CRef< CSeqMaskerIstat > istat
object containing unit counts read from the input
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define NCBI_XALGOWINMASK_EXPORT
Definition: ncbi_export.h:1033
Defines NCBI C++ exception handling.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
Modified on Sun Apr 21 03:42:39 2024 by modify_doxy.py rev. 669887