OpenMS
Loading...
Searching...
No Matches
FileNameUtils.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, Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12#include <string>
13
14namespace OpenMS
15{
24 class OPENMS_DLLAPI FileNameUtils
25 {
26 public:
31 static FileTypes::Type getTypeByFileName(const std::string& filename);
32
37 static bool hasValidExtension(const std::string& filename, FileTypes::Type type);
38
44 static std::string stripExtension(const std::string& filename);
45
51 static std::string swapExtension(const std::string& filename, FileTypes::Type new_type);
52 };
53}
Filename-only format recognition and extension manipulation.
Definition FileNameUtils.h:25
static FileTypes::Type getTypeByFileName(const std::string &filename)
Determine a file type from its name, including compression suffixes.
static bool hasValidExtension(const std::string &filename, FileTypes::Type type)
Accept the expected extension or an unknown extension.
static std::string stripExtension(const std::string &filename)
Remove the extension using the established FileHandler rules.
static std::string swapExtension(const std::string &filename, FileTypes::Type new_type)
Strip the existing extension and append the requested extension.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Type
Actual file types enum.
Definition FileTypes.h:31