VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/xpcom/io/nsLocalFileL4.cpp@ 44770

最後變更 在這個檔案從44770是 1,由 vboxsync 提交於 55 年 前

import

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 11.4 KB
 
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is Mozilla Communicator client code, released
16 * March 31, 1998.
17 *
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998-1999
21 * the Initial Developer. All Rights Reserved.
22 *
23 * Contributor(s):
24 * Mike Shaver <[email protected]>
25 * Christopher Blizzard <[email protected]>
26 * Jason Eager <[email protected]>
27 * Stuart Parmenter <[email protected]>
28 * Brendan Eich <[email protected]>
29 * Pete Collins <[email protected]>
30 * Paul Ashford <[email protected]>
31 *
32 * Alternatively, the contents of this file may be used under the terms of
33 * either of the GNU General Public License Version 2 or later (the "GPL"),
34 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
35 * in which case the provisions of the GPL or the LGPL are applicable instead
36 * of those above. If you wish to allow use of your version of this file only
37 * under the terms of either the GPL or the LGPL, and not to allow others to
38 * use your version of this file under the terms of the MPL, indicate your
39 * decision by deleting the provisions above and replace them with the notice
40 * and other provisions required by the GPL or the LGPL. If you do not delete
41 * the provisions above, a recipient may use your version of this file under
42 * the terms of any one of the MPL, the GPL or the LGPL.
43 *
44 * ***** END LICENSE BLOCK ***** */
45
46/**
47 * Implementation of nsIFile for L4 systems.
48 *
49 * Notes to all those who have something to do with this file again: I have told almost
50 * all functions to return NS_ERROR_FAILURE. A good starting point if you need to
51 * implement any of it would be to search/replace those with standard assertions.
52 */
53
54#include "nsDirectoryServiceDefs.h"
55#include "nsCRT.h"
56#include "nsCOMPtr.h"
57#include "nsMemory.h"
58#include "nsIFile.h"
59#include "nsString.h"
60#include "nsReadableUtils.h"
61#include "nsLocalFile.h"
62#include "nsIComponentManager.h"
63#include "nsXPIDLString.h"
64#include "prproces.h"
65#include "nsISimpleEnumerator.h"
66#include "nsITimelineService.h"
67
68#include "nsNativeCharsetUtils.h"
69
70#if 0
71/* directory enumerator */
72class NS_COM
73nsDirEnumeratorL4 : public nsISimpleEnumerator
74{
75 public:
76 nsDirEnumeratorL4();
77
78 // nsISupports interface
79 NS_DECL_ISUPPORTS
80
81 // nsISimpleEnumerator interface
82 NS_DECL_NSISIMPLEENUMERATOR
83
84 NS_IMETHOD Init(nsLocalFile *parent, PRBool ignored);
85
86 private:
87 ~nsDirEnumeratorL4();
88
89 protected:
90 NS_IMETHOD GetNextEntry();
91
92};
93
94nsDirEnumeratorL4::nsDirEnumeratorL4() :
95 mDir(nsnull),
96 mEntry(nsnull)
97{
98 NS_ASSERTION(0, "nsDirEnumeratorL4 created!");
99}
100
101nsDirEnumeratorL4::~nsDirEnumeratorL4()
102{
103}
104
105NS_IMPL_ISUPPORTS1(nsDirEnumeratorL4, nsISimpleEnumerator)
106
107NS_IMETHODIMP
108nsDirEnumeratorL4::Init(nsLocalFile *parent, PRBool resolveSymlinks /*ignored*/)
109{
110 return NS_ERROR_FAILURE;
111}
112
113NS_IMETHODIMP
114nsDirEnumeratorL4::HasMoreElements(PRBool *result)
115{
116 return NS_ERROR_FAILURE;
117}
118
119NS_IMETHODIMP
120nsDirEnumeratorL4::GetNext(nsISupports **_retval)
121{
122 return NS_ERROR_FAILURE;
123}
124
125NS_IMETHODIMP
126nsDirEnumeratorL4::GetNextEntry()
127{
128 return NS_ERROR_FAILURE;
129}
130#endif /* 0 */
131
132nsLocalFile::nsLocalFile()
133{
134 NS_ASSERTION(0, "nsLocalFile created!");
135}
136
137nsLocalFile::nsLocalFile(const nsLocalFile& other)
138{
139 NS_ASSERTION(0, "nsLocalFile created!");
140}
141
142NS_IMPL_THREADSAFE_ISUPPORTS2(nsLocalFile,
143 nsIFile,
144 nsILocalFile)
145
146nsresult
147nsLocalFile::nsLocalFileConstructor(nsISupports *outer,
148 const nsIID &aIID,
149 void **aInstancePtr)
150{
151 NS_ASSERTION(0, "nsLocalFile::nsLocalFileConstructor called!");
152 return NS_ERROR_FAILURE;
153}
154
155NS_IMETHODIMP
156nsLocalFile::Clone(nsIFile **file)
157{
158 // Just copy-construct ourselves
159 *file = new nsLocalFile(*this);
160 if (!*file)
161 return NS_ERROR_OUT_OF_MEMORY;
162
163 NS_ADDREF(*file);
164
165 return NS_OK;
166}
167
168NS_IMETHODIMP
169nsLocalFile::InitWithNativePath(const nsACString &filePath)
170{
171 return NS_ERROR_FAILURE;
172}
173
174NS_IMETHODIMP
175nsLocalFile::OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc **_retval)
176{
177 return NS_ERROR_FAILURE;
178}
179
180NS_IMETHODIMP
181nsLocalFile::OpenANSIFileDesc(const char *mode, FILE **_retval)
182{
183 return NS_ERROR_FAILURE;
184}
185
186NS_IMETHODIMP
187nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
188{
189 return NS_ERROR_FAILURE;
190}
191
192NS_IMETHODIMP
193nsLocalFile::AppendNative(const nsACString &fragment)
194{
195 return NS_ERROR_FAILURE;
196}
197
198NS_IMETHODIMP
199nsLocalFile::AppendRelativeNativePath(const nsACString &fragment)
200{
201 return NS_ERROR_FAILURE;
202}
203
204NS_IMETHODIMP
205nsLocalFile::Normalize()
206{
207 return NS_ERROR_FAILURE;
208}
209
210void
211nsLocalFile::LocateNativeLeafName(nsACString::const_iterator &begin,
212 nsACString::const_iterator &end)
213{
214}
215
216NS_IMETHODIMP
217nsLocalFile::GetNativeLeafName(nsACString &aLeafName)
218{
219 return NS_ERROR_FAILURE;
220}
221
222NS_IMETHODIMP
223nsLocalFile::SetNativeLeafName(const nsACString &aLeafName)
224{
225 return NS_ERROR_FAILURE;
226}
227
228NS_IMETHODIMP
229nsLocalFile::GetNativePath(nsACString &_retval)
230{
231 return NS_ERROR_FAILURE;
232}
233
234nsresult
235nsLocalFile::GetNativeTargetPathName(nsIFile *newParent,
236 const nsACString &newName,
237 nsACString &_retval)
238{
239 return NS_ERROR_FAILURE;
240}
241
242nsresult
243nsLocalFile::CopyDirectoryTo(nsIFile *newParent)
244{
245 return NS_ERROR_FAILURE;
246}
247
248NS_IMETHODIMP
249nsLocalFile::CopyToNative(nsIFile *newParent, const nsACString &newName)
250{
251 return NS_ERROR_FAILURE;
252}
253
254NS_IMETHODIMP
255nsLocalFile::CopyToFollowingLinksNative(nsIFile *newParent, const nsACString &newName)
256{
257 return NS_ERROR_FAILURE;
258}
259
260NS_IMETHODIMP
261nsLocalFile::MoveToNative(nsIFile *newParent, const nsACString &newName)
262{
263 return NS_ERROR_FAILURE;
264}
265
266NS_IMETHODIMP
267nsLocalFile::Remove(PRBool recursive)
268{
269 return NS_ERROR_FAILURE;
270}
271
272NS_IMETHODIMP
273nsLocalFile::GetLastModifiedTime(PRInt64 *aLastModTime)
274{
275 return NS_ERROR_FAILURE;
276}
277
278NS_IMETHODIMP
279nsLocalFile::SetLastModifiedTime(PRInt64 aLastModTime)
280{
281 return NS_ERROR_FAILURE;
282}
283
284NS_IMETHODIMP
285nsLocalFile::GetLastModifiedTimeOfLink(PRInt64 *aLastModTimeOfLink)
286{
287 return NS_ERROR_FAILURE;
288}
289
290/*
291 * utime(2) may or may not dereference symlinks, joy.
292 */
293NS_IMETHODIMP
294nsLocalFile::SetLastModifiedTimeOfLink(PRInt64 aLastModTimeOfLink)
295{
296 return NS_ERROR_FAILURE;
297}
298
299NS_IMETHODIMP
300nsLocalFile::GetPermissions(PRUint32 *aPermissions)
301{
302 return NS_ERROR_FAILURE;
303}
304
305NS_IMETHODIMP
306nsLocalFile::GetPermissionsOfLink(PRUint32 *aPermissionsOfLink)
307{
308 return NS_ERROR_FAILURE;
309}
310
311NS_IMETHODIMP
312nsLocalFile::SetPermissions(PRUint32 aPermissions)
313{
314 return NS_ERROR_FAILURE;
315}
316
317NS_IMETHODIMP
318nsLocalFile::SetPermissionsOfLink(PRUint32 aPermissions)
319{
320 return NS_ERROR_FAILURE;
321}
322
323NS_IMETHODIMP
324nsLocalFile::GetFileSize(PRInt64 *aFileSize)
325{
326 return NS_ERROR_FAILURE;
327}
328
329NS_IMETHODIMP
330nsLocalFile::SetFileSize(PRInt64 aFileSize)
331{
332 return NS_ERROR_FAILURE;
333}
334
335NS_IMETHODIMP
336nsLocalFile::GetFileSizeOfLink(PRInt64 *aFileSize)
337{
338 return NS_ERROR_FAILURE;
339}
340
341NS_IMETHODIMP
342nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
343{
344 return NS_ERROR_FAILURE;
345}
346
347NS_IMETHODIMP
348nsLocalFile::GetParent(nsIFile **aParent)
349{
350 return NS_ERROR_FAILURE;
351}
352
353NS_IMETHODIMP
354nsLocalFile::Exists(PRBool *_retval)
355{
356 return NS_ERROR_FAILURE;
357}
358
359NS_IMETHODIMP
360nsLocalFile::IsWritable(PRBool *_retval)
361{
362 return NS_ERROR_FAILURE;
363}
364
365NS_IMETHODIMP
366nsLocalFile::IsReadable(PRBool *_retval)
367{
368 return NS_ERROR_FAILURE;
369}
370
371NS_IMETHODIMP
372nsLocalFile::IsExecutable(PRBool *_retval)
373{
374 return NS_ERROR_FAILURE;
375}
376
377NS_IMETHODIMP
378nsLocalFile::IsDirectory(PRBool *_retval)
379{
380 return NS_ERROR_FAILURE;
381}
382
383NS_IMETHODIMP
384nsLocalFile::IsFile(PRBool *_retval)
385{
386 return NS_ERROR_FAILURE;
387}
388
389NS_IMETHODIMP
390nsLocalFile::IsHidden(PRBool *_retval)
391{
392 return NS_ERROR_FAILURE;
393}
394
395NS_IMETHODIMP
396nsLocalFile::IsSymlink(PRBool *_retval)
397{
398 return NS_ERROR_FAILURE;
399}
400
401NS_IMETHODIMP
402nsLocalFile::IsSpecial(PRBool *_retval)
403{
404 return NS_ERROR_FAILURE;
405}
406
407NS_IMETHODIMP
408nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval)
409{
410 return NS_ERROR_FAILURE;
411}
412
413NS_IMETHODIMP
414nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval)
415{
416 return NS_ERROR_FAILURE;
417}
418
419NS_IMETHODIMP
420nsLocalFile::GetNativeTarget(nsACString &_retval)
421{
422 return NS_ERROR_FAILURE;
423}
424
425/* attribute PRBool followLinks; */
426NS_IMETHODIMP
427nsLocalFile::GetFollowLinks(PRBool *aFollowLinks)
428{
429 return NS_ERROR_FAILURE;
430}
431
432NS_IMETHODIMP
433nsLocalFile::SetFollowLinks(PRBool aFollowLinks)
434{
435 return NS_ERROR_FAILURE;
436}
437
438NS_IMETHODIMP
439nsLocalFile::GetDirectoryEntries(nsISimpleEnumerator **entries)
440{
441 return NS_ERROR_FAILURE;
442}
443
444NS_IMETHODIMP
445nsLocalFile::Load(PRLibrary **_retval)
446{
447 return NS_ERROR_FAILURE;
448}
449
450NS_IMETHODIMP
451nsLocalFile::GetPersistentDescriptor(nsACString &aPersistentDescriptor)
452{
453 return NS_ERROR_FAILURE;
454}
455
456NS_IMETHODIMP
457nsLocalFile::SetPersistentDescriptor(const nsACString &aPersistentDescriptor)
458{
459 return NS_ERROR_FAILURE;
460}
461
462NS_IMETHODIMP
463nsLocalFile::Reveal()
464{
465 return NS_ERROR_FAILURE;
466}
467
468NS_IMETHODIMP
469nsLocalFile::Launch()
470{
471 return NS_ERROR_FAILURE;
472}
473
474nsresult
475NS_NewNativeLocalFile(const nsACString &path, PRBool followSymlinks, nsILocalFile **result)
476{
477 return NS_ERROR_FAILURE;
478}
479
480// Unicode interface Wrapper
481nsresult
482nsLocalFile::InitWithPath(const nsAString &filePath)
483{
484 return NS_ERROR_FAILURE;
485}
486nsresult
487nsLocalFile::Append(const nsAString &node)
488{
489 return NS_ERROR_FAILURE;
490}
491nsresult
492nsLocalFile::AppendRelativePath(const nsAString &node)
493{
494 return NS_ERROR_FAILURE;
495}
496nsresult
497nsLocalFile::GetLeafName(nsAString &aLeafName)
498{
499 return NS_ERROR_FAILURE;
500}
501nsresult
502nsLocalFile::SetLeafName(const nsAString &aLeafName)
503{
504 return NS_ERROR_FAILURE;
505}
506nsresult
507nsLocalFile::GetPath(nsAString &_retval)
508{
509 return NS_ERROR_FAILURE;
510}
511nsresult
512nsLocalFile::CopyTo(nsIFile *newParentDir, const nsAString &newName)
513{
514 return NS_ERROR_FAILURE;
515}
516nsresult
517nsLocalFile::CopyToFollowingLinks(nsIFile *newParentDir, const nsAString &newName)
518{
519 return NS_ERROR_FAILURE;
520}
521nsresult
522nsLocalFile::MoveTo(nsIFile *newParentDir, const nsAString &newName)
523{
524 return NS_ERROR_FAILURE;
525}
526nsresult
527nsLocalFile::GetTarget(nsAString &_retval)
528{
529 return NS_ERROR_FAILURE;
530}
531nsresult
532NS_NewLocalFile(const nsAString &path, PRBool followLinks, nsILocalFile* *result)
533{
534 return NS_ERROR_FAILURE;
535}
536
537//-----------------------------------------------------------------------------
538// global init/shutdown
539//-----------------------------------------------------------------------------
540
541void
542nsLocalFile::GlobalInit()
543{
544}
545
546void
547nsLocalFile::GlobalShutdown()
548{
549}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette