OpenMS
Loading...
Searching...
No Matches
SourceFile.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14namespace OpenMS
15{
21 class OPENMS_DLLAPI SourceFile :
22 public CVTermList
23 {
24public:
27 {
31 SIZE_OF_CHECKSUMTYPE
32 };
33
35 static const std::string NamesOfChecksumType[SIZE_OF_CHECKSUMTYPE];
36
39
43 SourceFile(const SourceFile&) = default;
45 SourceFile(SourceFile&&) = default;
47 ~SourceFile() override;
48
50 SourceFile& operator=(const SourceFile&) = default;
53
55 bool operator==(const SourceFile& rhs) const;
57 bool operator!=(const SourceFile& rhs) const;
58
60 const String& getNameOfFile() const;
62 void setNameOfFile(const String& name_of_file);
63
65 const String& getPathToFile() const;
67 void setPathToFile(const String& path_path_to_file);
68
70 float getFileSize() const;
72 void setFileSize(float file_size);
73
75 const String& getFileType() const;
77 void setFileType(const String& file_type);
78
80 const String& getChecksum() const;
82 void setChecksum(const String& checksum, ChecksumType type);
85
87 const String& getNativeIDType() const;
89 void setNativeIDType(const String& type);
90
94 void setNativeIDTypeAccession(const String& accesssion);
95
96protected:
99 double file_size_;
102 ChecksumType checksum_type_ = SourceFile::ChecksumType::UNKNOWN_CHECKSUM;
105 };
106} // namespace OpenMS
107
Representation of controlled vocabulary term list.
Definition CVTermList.h:29
Description of a file location, used to store the origin of (meta) data.
Definition SourceFile.h:23
const String & getNativeIDTypeAccession() const
Returns the nativeID of the spectra.
SourceFile & operator=(const SourceFile &)=default
Assignment operator.
String checksum_
Definition SourceFile.h:101
void setFileType(const String &file_type)
sets the file type
void setPathToFile(const String &path_path_to_file)
sets the file path
const String & getNativeIDType() const
Returns the native ID type of the spectra.
bool operator!=(const SourceFile &rhs) const
Equality operator.
SourceFile & operator=(SourceFile &&)=default
Move assignment operator.
SourceFile()
Constructor.
const String & getNameOfFile() const
returns the file name
ChecksumType
Type of the checksum.
Definition SourceFile.h:27
@ SHA1
Secure Hash Algorithm-1.
Definition SourceFile.h:29
@ UNKNOWN_CHECKSUM
Unknown checksum type.
Definition SourceFile.h:28
@ MD5
Message-Digest algorithm 5.
Definition SourceFile.h:30
SourceFile(SourceFile &&)=default
Move constructor.
~SourceFile() override
Destructor.
static StringList getAllNamesOfChecksumType()
returns all checksum type names known to OpenMS
float getFileSize() const
returns the file size in MB
String native_id_type_
Definition SourceFile.h:103
String path_to_file_
Definition SourceFile.h:98
ChecksumType getChecksumType() const
returns the checksum type
String native_id_type_accession_
Definition SourceFile.h:104
SourceFile(const SourceFile &)=default
Copy constructor.
void setNativeIDType(const String &type)
Sets the native ID type of the spectra.
double file_size_
Definition SourceFile.h:99
void setNameOfFile(const String &name_of_file)
sets the file name
const String & getChecksum() const
returns the file's checksum
const String & getFileType() const
returns the file type
String file_type_
Definition SourceFile.h:100
String name_of_file_
Definition SourceFile.h:97
const String & getPathToFile() const
returns the file path
void setNativeIDTypeAccession(const String &accesssion)
Sets the native ID of the spectra.
void setFileSize(float file_size)
sets the file size in MB
bool operator==(const SourceFile &rhs) const
Equality operator.
void setChecksum(const String &checksum, ChecksumType type)
sets the file's checksum
A more convenient string class.
Definition String.h:34
std::vector< String > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19