This file is indexed.

/usr/include/libtomahawk/utils/Cloudstream.h is in libtomahawk-dev 0.8.4+dfsg1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* This file is part of Clementine.
   Copyright 2012, David Sansome <me@davidsansome.com>

   Clementine is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   Clementine is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with Clementine.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GOOGLEDRIVESTREAM_H
#define GOOGLEDRIVESTREAM_H

#include <QObject>
#include <QList>
#include <QSslError>
#include <QUrl>

#include <google/sparsetable>
#include <taglib/tiostream.h>

class QNetworkAccessManager;

class CloudStream : public QObject, public TagLib::IOStream {
  Q_OBJECT
 public:
  CloudStream(const QUrl& url, const long length,
              const QMap<QString, QString>& headers, QNetworkAccessManager* network);

  // Taglib::IOStream
  virtual TagLib::FileName name() const;
  virtual TagLib::ByteVector readBlock(ulong length);
  virtual void writeBlock(const TagLib::ByteVector&);
  virtual void insert(const TagLib::ByteVector&, ulong, ulong);
  virtual void removeBlock(ulong, ulong);
  virtual bool readOnly() const;
  virtual bool isOpen() const;
  virtual void seek(long offset, TagLib::IOStream::Position p);
  virtual void clear();
  virtual long tell() const;
  virtual long length();
  virtual void truncate(long);

  google::sparsetable<char>::size_type cached_bytes() const {
    return cache_.num_nonempty();
  }

  int num_requests() const { return num_requests_; }

  // Use educated guess to request the bytes that TagLib will probably want.
  void Precache();

 private:
  bool CheckCache(int start, int end);
  void FillCache(int start, TagLib::ByteVector data);
  TagLib::ByteVector GetCached(int start, int end);

 private slots:
  void SSLErrors(const QList<QSslError>& errors);

 private:
  const QUrl url_;
  const QString filename_;
  const QByteArray encoded_filename_;
  const ulong length_;
  const QMap<QString, QString> headers_;

  int cursor_;
  QNetworkAccessManager* network_;

  google::sparsetable<char> cache_;
  int num_requests_;
};

#endif  // GOOGLEDRIVESTREAM_H