Last change
on this file since 62330 was 1, checked in by vboxsync, 55 years ago |
import
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.1 KB
|
Line | |
---|
1 | // Test05.cpp
|
---|
2 |
|
---|
3 | #include "nsIDOMNode.h"
|
---|
4 | #include "nsCOMPtr.h"
|
---|
5 |
|
---|
6 | #ifdef __MWERKS__
|
---|
7 | #pragma exceptions off
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | NS_DEF_PTR(nsIDOMNode);
|
---|
11 |
|
---|
12 | /*
|
---|
13 | Windows:
|
---|
14 | raw, nsCOMPtr 21 bytes
|
---|
15 |
|
---|
16 | Macintosh:
|
---|
17 | Raw, nsCOMPtr 64 bytes
|
---|
18 | */
|
---|
19 |
|
---|
20 | class Test05_Raw
|
---|
21 | {
|
---|
22 | public:
|
---|
23 | Test05_Raw();
|
---|
24 | ~Test05_Raw();
|
---|
25 |
|
---|
26 | void /*nsresult*/ GetNode( nsIDOMNode** aNode );
|
---|
27 |
|
---|
28 | private:
|
---|
29 | nsIDOMNode* mNode;
|
---|
30 | };
|
---|
31 |
|
---|
32 | Test05_Raw::Test05_Raw()
|
---|
33 | : mNode(0)
|
---|
34 | {
|
---|
35 | // nothing else to do here
|
---|
36 | }
|
---|
37 |
|
---|
38 | Test05_Raw::~Test05_Raw()
|
---|
39 | {
|
---|
40 | NS_IF_RELEASE(mNode);
|
---|
41 | }
|
---|
42 |
|
---|
43 | void // nsresult
|
---|
44 | Test05_Raw::GetNode( nsIDOMNode** aNode )
|
---|
45 | // m64, w21
|
---|
46 | {
|
---|
47 | // if ( !aNode )
|
---|
48 | // return NS_ERROR_NULL_POINTER;
|
---|
49 |
|
---|
50 | *aNode = mNode;
|
---|
51 | NS_IF_ADDREF(*aNode);
|
---|
52 |
|
---|
53 | // return NS_OK;
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 | class Test05_nsCOMPtr
|
---|
59 | {
|
---|
60 | public:
|
---|
61 | void /*nsresult*/ GetNode( nsIDOMNode** aNode );
|
---|
62 |
|
---|
63 | private:
|
---|
64 | nsCOMPtr<nsIDOMNode> mNode;
|
---|
65 | };
|
---|
66 |
|
---|
67 | void // nsresult
|
---|
68 | Test05_nsCOMPtr::GetNode( nsIDOMNode** aNode )
|
---|
69 | // m64, w21
|
---|
70 | {
|
---|
71 | // if ( !aNode )
|
---|
72 | // return NS_ERROR_NULL_POINTER;
|
---|
73 |
|
---|
74 | *aNode = mNode;
|
---|
75 | NS_IF_ADDREF(*aNode);
|
---|
76 |
|
---|
77 | // return NS_OK;
|
---|
78 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.