~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/asobj/flash/net/SharedObject_as.h

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// 
 
2
//   Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
3
//
 
4
// This program is free software; you can redistribute it and/or modify
 
5
// it under the terms of the GNU General Public License as published by
 
6
// the Free Software Foundation; either version 3 of the License, or
 
7
// (at your option) any later version.
 
8
//
 
9
// This program is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
// GNU General Public License for more details.
 
13
//
 
14
// You should have received a copy of the GNU General Public License
 
15
// along with this program; if not, write to the Free Software
 
16
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
//
 
18
 
 
19
#ifndef GNASH_ASOBJ_SHAREDOBJECT_H
 
20
#define GNASH_ASOBJ_SHAREDOBJECT_H
 
21
 
 
22
#include <string>
 
23
#include <map>
 
24
 
 
25
// Forward declarations
 
26
namespace gnash {
 
27
    class as_object;
 
28
    class Network;
 
29
    class ObjectURI;
 
30
    class SharedObject_as;
 
31
    class VM;
 
32
}
 
33
 
 
34
namespace gnash {
 
35
 
 
36
class SharedObjectLibrary
 
37
{
 
38
public:
 
39
 
 
40
    typedef std::map<std::string, SharedObject_as *> SoLib;
 
41
 
 
42
    SharedObjectLibrary(VM& vm);
 
43
 
 
44
    ~SharedObjectLibrary();
 
45
 
 
46
    /// Return a local shared object with given name and with given root
 
47
    //
 
48
    /// May return NULL if name is invalid or can't access the given root
 
49
    ///
 
50
    SharedObject_as* getLocal(const std::string& name, const std::string& root);
 
51
 
 
52
    /// Return a remote shared object with given name
 
53
    ///
 
54
    /// @param persistance false
 
55
    /// May return NULL if name is invalid or can't access the given root
 
56
    ///
 
57
    SharedObject_as* getRemote(const std::string& name, const std::string& uri,
 
58
        const std::string& persistance);
 
59
 
 
60
    void markReachableResources() const;
 
61
 
 
62
    // Drop all library items
 
63
    void clear();
 
64
 
 
65
private:
 
66
 
 
67
    VM& _vm;
 
68
 
 
69
    /// Domain component of the VM SWF url
 
70
    std::string _baseDomain;
 
71
 
 
72
    /// Path component of the VM SWF url
 
73
    std::string _basePath;
 
74
 
 
75
    /// Base SOL dir
 
76
    std::string _solSafeDir;
 
77
    SoLib       _soLib;
 
78
};
 
79
 
 
80
/// Initialize the global SharedObject class
 
81
void sharedobject_class_init(as_object& where, const ObjectURI& uri);
 
82
 
 
83
void registerSharedObjectNative(as_object& o);
 
84
 
 
85
  
 
86
} // end of gnash namespace
 
87
 
 
88
#endif
 
89
 
 
90
// local Variables:
 
91
// mode: C++
 
92
// indent-tabs-mode: t
 
93
// End: