OpenMS
Loading...
Searching...
No Matches
S3InputSource.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: Julianus Pfeuffer, Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12#include <OpenMS/config.h>
13
14#include <xercesc/sax/InputSource.hpp>
15
16#include <memory>
17#include <string>
18
19namespace OpenMS
20{
36 class OPENMS_DLLAPI S3InputSource :
37 public xercesc::InputSource
38 {
39public:
48 explicit S3InputSource(const std::string& uri);
49
50 ~S3InputSource() override;
51
57 xercesc::BinInputStream* makeStream() const override;
58
60 static bool isS3URI(const std::string& uri);
61
63 static bool isAvailable();
64
70 static Int64 objectSize(const std::string& uri);
71
78 static std::string readRange(const std::string& uri, Int64 offset, Int64 length);
79
80private:
81 struct Impl;
82 std::unique_ptr<Impl> impl_;
83 };
84
85} // namespace OpenMS
Xerces InputSource for reading XML files from Amazon S3 (s3://bucket/key), with Arrow's S3 filesystem...
Definition S3InputSource.h:38
xercesc::BinInputStream * makeStream() const override
A stream of the (decompressed) content of the object, for the parser.
static bool isS3URI(const std::string &uri)
Whether uri is an S3 URI (starts with "s3://")
static std::string readRange(const std::string &uri, Int64 offset, Int64 length)
The bytes [offset, offset + length) of the S3 object uri (fewer at its end).
S3InputSource(const std::string &uri)
Opens the S3 object uri.
std::unique_ptr< Impl > impl_
The opened object (Arrow types stay out of this header)
Definition S3InputSource.h:82
static bool isAvailable()
Whether OpenMS can read S3 URIs: it was built with an Arrow library that has S3 support.
~S3InputSource() override
static Int64 objectSize(const std::string &uri)
The size of the S3 object uri, in bytes.
int64_t Int64
Signed integer type (64bit)
Definition Types.h:40
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19