This file is indexed.

/usr/include/mimetic/circular_buffer.h is in libmimetic-dev 0.9.8-5.

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
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/***************************************************************************
    copyright            : (C) 2002-2008 by Stefano Barbato
    email                : stefano@codesink.org

    $Id: circular_buffer.h,v 1.8 2008-10-07 11:06:25 tat Exp $
 ***************************************************************************/
#ifndef _MIMETIC_CODEC_CIRCULAR_BUFFER_H_
#define _MIMETIC_CODEC_CIRCULAR_BUFFER_H_
#include <string>
#include <iostream>

namespace mimetic
{

template<typename T>
struct circular_buffer
{
    typedef circular_buffer<T> self_type;
    typedef T value_type;
    typedef unsigned int size_type;
    circular_buffer(unsigned int sz = 4)
    : m_sz(sz), m_count(0), m_first(0), m_last(0)
    {
        m_pItem = new value_type[sz];
    }
    ~circular_buffer()
    {
        delete[]  m_pItem;
    }
    circular_buffer(const circular_buffer& r)
    : m_sz(r.m_sz), m_count(r.m_count),
      m_first(r.m_first) ,m_last(r.m_last)
    {
         m_pItem = new value_type[m_sz];
        for(size_type i =0; i < m_sz; i++)
            m_pItem[i] = r.m_pItem[i];
    }
    circular_buffer& operator=(const circular_buffer& r)
    {
        m_sz = r.m_sz;
        m_count = r.m_count;
          m_first = r.m_first;
        m_last = r.m_last;

        if(m_pItem)
            delete[] m_pItem;
         m_pItem = new value_type[m_sz];
        for(size_type i =0; i < m_sz; i++)
            m_pItem[i] = r.m_pItem[i];
        return *this;
    }
    inline void push_back(const value_type& c)
    {
        m_pItem[m_last] = c;    
        m_last = ++m_last % m_sz;
        m_count += (m_count == m_sz ? 0 : 1);
    }
    inline void push_front(const value_type& c)
    {
        m_first = (--m_first + m_sz) % m_sz;        
        m_pItem[m_first] = c;    
        m_count += (m_count == m_sz ? 0 : 1);
    }
    inline void pop_front()
    {
        m_first = ++m_first % m_sz;        
        m_count--;
    }
    inline void pop_back()
    {
        m_last = (--m_last + m_sz) % m_sz;
        m_count--;
    }
    inline const value_type& front() const
    {
        return m_pItem[m_first];
    }
    inline const value_type& back() const
    {
        int last = (m_last -1 + m_sz) % m_sz;
        return m_pItem[last];
    }
    inline bool operator==(const std::string& r) const
    {
        if(m_count < r.length())
            return false;
        const self_type& me = *this;
        for(size_type i = 0; i < m_count; i++)
            if(me[i] != r[i])
                return false;
        return true;
    }
    inline bool operator!=(const std::string& r) const
    {
        return !operator==(r);
    }    
    bool compare(size_type off, size_type n0, const std::string& r) const
    {
        const self_type& me = *this;
        for(size_type i = 0; i < n0; i++)
            if(me[off+i] != r[i])
                return false;
        return true;
    }
    inline value_type& operator[](unsigned int i) const
    {
        unsigned int idx = (m_first + i) % m_sz;
        return m_pItem[idx];
    }
    inline bool empty() const
    {
        return m_count == 0;
    }
    std::string str() const
    {
        std::string result;
        const self_type& me = *this;
        for(size_type i = 0; i < m_count; i++)
            result += me[i];
        return result;
    }
    inline size_type count() const
    {
        return m_count;
    }
    inline size_type max_size() const
    {
        return m_sz;
    }
private:
    size_type m_sz, m_count;
    int m_first, m_last;
    value_type* m_pItem;
};

}

#endif