This file is indexed.

/usr/include/gloox/resource.h is in libgloox-dev 1.0.11-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
/*
  Copyright (c) 2004-2014 by Jakob Schroeter <js@camaya.net>
  This file is part of the gloox library. http://camaya.net/gloox

  This software is distributed under a license. The full license
  agreement can be found in the file LICENSE in this distribution.
  This software may not be copied, modified, sold or distributed
  other than expressed in the named license agreement.

  This software is distributed without any warranty.
*/


#ifndef RESOURCE_H__
#define RESOURCE_H__

#include "presence.h"
#include "util.h"

#include <string>

namespace gloox
{

  class Presence;

  /**
   * @brief Holds resource attributes.
   *
   * This holds the information of a single resource of a contact that is online.
   *
   * @author Jakob Schroeter <js@camaya.net>
   * @since 0.8
   */
  class GLOOX_API Resource
  {

    friend class RosterItem;

    public:
      /**
       * Constructor.
       * @param priority The resource's priority.
       * @param msg The resource's status message.
       * @param presence The resource's presence status.
       */
      Resource( int priority, const std::string& msg, Presence::PresenceType presence )
        : m_priority( priority ), m_message( msg ), m_presence( presence ) {}

      /**
       * Virtual destrcutor.
       */
      virtual ~Resource()
      {
        util::clearList( m_extensions );
      }

      /**
       * Lets you fetch the resource's priority.
       * @return The resource's priority.
       */
      int priority() const { return m_priority; }

      /**
       * Lets you fetch the resource's status message.
       * @return The resource's status message.
       */
      const std::string& message() const { return m_message; }

      /**
       * Lets you fetch the resource's last presence.
       * @return The resource's presence status.
       */
      Presence::PresenceType presence() const { return m_presence; }

      /**
       * Returns the StanzaExtensions that were sent with the last presence stanza
       * by the resource.
       * @return A list of stanza extensions.
       */
      const StanzaExtensionList& extensions() const { return m_extensions; }

    private:
      void setPriority( int priority ) { m_priority = priority; }
      void setMessage( std::string message ) { m_message = message; }
      void setStatus( Presence::PresenceType presence ) { m_presence = presence; }
      void setExtensions( const StanzaExtensionList& exts )
      {
        StanzaExtensionList::const_iterator it = exts.begin();
        for( ; it != exts.end(); ++it )
        {
          m_extensions.push_back( (*it)->clone() );
        }
      }

      int m_priority;
      std::string m_message;
      std::string m_name;
      Presence::PresenceType m_presence;
      StanzaExtensionList m_extensions;

  };

}

#endif // RESOURCE_H__