]> git.donarmstrong.com Git - bamtools.git/blob - src/api/internal/io/BamFtp_p.cpp
10181cb54564013b13cdba1c149dab8649f38056
[bamtools.git] / src / api / internal / io / BamFtp_p.cpp
1 // ***************************************************************************
2 // BamFtp_p.cpp (c) 2011 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 25 October 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides reading/writing of BAM files on FTP server
8 // ***************************************************************************
9
10 #include "api/internal/io/BamFtp_p.h"
11 using namespace BamTools;
12 using namespace BamTools::Internal;
13
14 using namespace std;
15
16 BamFtp::BamFtp(const string& url)
17     : IBamIODevice()
18 {
19     BT_ASSERT_X(false, "BamFtp not yet implemented");
20 }
21
22 BamFtp::~BamFtp(void) { }
23
24 void BamFtp::Close(void) {
25     return ;
26 }
27
28 bool BamFtp::IsRandomAccess(void) const {
29     return true;
30 }
31
32 bool BamFtp::Open(const IBamIODevice::OpenMode mode) {
33
34     if ( mode != IBamIODevice::ReadOnly ) {
35         SetErrorString("BamFtp::Open", "writing on this device is not supported");
36         return false;
37     }
38
39
40     return true;
41 }
42
43 int64_t BamFtp::Read(char* data, const unsigned int numBytes) {
44     (void)data;
45     (void)numBytes;
46     return 0;
47 }
48
49 bool BamFtp::Seek(const int64_t& position) {
50     (void)position;
51     return true;
52 }
53
54 int64_t BamFtp::Tell(void) const {
55     return -1;
56 }
57
58 int64_t BamFtp::Write(const char* data, const unsigned int numBytes) {
59     (void)data;
60     (void)numBytes;
61     BT_ASSERT_X(false, "BamFtp::Write : write-mode not supported on this device");
62     return 0;
63 }