This file is indexed.

/usr/include/davix/davixcontext.hpp is in davix-dev 0.6.7-1.

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
139
140
141
142
143
/*
 * This File is part of Davix, The IO library for HTTP based protocols
 * Copyright (C) CERN 2013
 * Author: Adrien Devresse <adrien.devresse@cern.ch>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
*/

#ifndef DAVIXCONTEXT_HPP
#define DAVIXCONTEXT_HPP

#include <string>
#include <status/davixstatusrequest.hpp>
#include <hooks/davix_hooks.hpp>
#include <utils/davix_uri.hpp>

#ifndef __DAVIX_INSIDE__
#error "Only davix.h or davix.hpp should be included."
#endif


///
/// @file davixcontext.hpp
/// @author Devresse Adrien
///
///  Handle of Davix

namespace Davix{

struct ContextInternal;
struct ContextExplorer;
class HookList;
class HttpRequest;
class DavPosix;



/// @brief Main handle for Davix
///
/// Each new davix context contains its own session-reuse pool and set of parameters
/// a Context can execute multiple queries in parallels and is thread safe
class DAVIX_EXPORT Context
{
public:
    ///
    /// \brief Default constructor
    ///
    Context();
    ///
    /// \brief copy constructor
    /// \param c
    ///
    Context(const Context & c);
    ///
    /// \brief assignment operator
    /// \param c
    /// \return
    ///
    Context & operator=(const Context & c);
    ///
    /// \brief destructor
    ///
    virtual ~Context();

    /// clone this instance to a new context
    Context* clone();

#ifdef __DAVIX_HAS_STD_FUNCTION

    /// set a new hook (callback) to intercept event in davix
    /// see davix_hooks.hpp for more details about hooks
    /// WARNING: setting a new HOOK override exiting ones
    template<typename HookType>
    inline void setHook(const HookType & id){
        hookDefine<HookType>(getHookList(), id);
    }

    /// get the value register for one type of hook
    template<typename HookType>
    inline const HookType & getHook(){
        return hookGet<HookType>(getHookList());
    }

#endif


    /// @brief load a plugin or a profile identified by name
    /// @param name : name of the plugin or  profile to load
    ///
    /// Example: loadModule("grid") configure davix
    /// for a grid environment usage
    void loadModule(const std::string & name);

    ///  enable or disable the session caching
    void setSessionCaching(bool caching);

    /// get session caching status
    bool getSessionCaching() const;

    /// clear both redirect and session cache
    void clearCache();

private:
    // internal context
    ContextInternal* _intern;

    friend class DavPosix;
    friend struct ContextExplorer;
    HookList & getHookList();
public:

    /// @deprecated
    HttpRequest* createRequest(const Uri & uri, DavixError** err);
    /// @deprecated
    HttpRequest* createRequest(const std::string & url, DavixError** err);
    /// @deprecated
    DavPosix* createDavPosix();

private:

};


/// version string of the current davix library
/// @return version of davix
DAVIX_EXPORT const std::string & version();

}

#endif // DAVIXCONTEXT_HPP