Back to index

lightning-sunbird  0.9+nobinonly
nsLocalFileOS2.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Mozilla Communicator client code, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998-2000
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Rich Walsh <dragtext@e-vertise.com>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK *****
00039  *
00040  * This Original Code has been modified by IBM Corporation. Modifications made by IBM
00041  * described herein are Copyright (c) International Business Machines Corporation, 2000.
00042  * Modifications to Mozilla code or documentation identified per MPL Section 3.3
00043  *
00044  * Date             Modified by     Description of modification
00045  * 05/26/2000       IBM Corp.      Make more like Windows.
00046  */
00047 
00048 #ifndef _nsLocalFileOS2_H_
00049 #define _nsLocalFileOS2_H_
00050 
00051 #include "nscore.h"
00052 #include "nsError.h"
00053 #include "nsString.h"
00054 #include "nsCRT.h"
00055 #include "nsIFile.h"
00056 #include "nsIFactory.h"
00057 #include "nsILocalFileOS2.h"
00058 
00059 #define INCL_DOSFILEMGR
00060 #define INCL_DOSERRORS
00061 #define INCL_DOSPROCESS
00062 #define INCL_DOSSESMGR
00063 #define INCL_DOSMODULEMGR
00064 #define INCL_DOSNLS
00065 #define INCL_DOSMISC
00066 #define INCL_WINCOUNTRY
00067 #define INCL_WINWORKPLACE
00068 
00069 #include <os2.h>
00070 
00071 class TypeEaEnumerator;
00072 
00073 class NS_COM nsLocalFile : public nsILocalFileOS2
00074 {
00075 public:
00076     NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
00077 
00078     nsLocalFile();
00079 
00080     static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
00081 
00082     // nsISupports interface
00083     NS_DECL_ISUPPORTS
00084 
00085     // nsIFile interface
00086     NS_DECL_NSIFILE
00087 
00088     // nsILocalFile interface
00089     NS_DECL_NSILOCALFILE
00090 
00091     // nsILocalFileOS2 interface
00092     NS_DECL_NSILOCALFILEOS2
00093 
00094 public:
00095     static void GlobalInit();
00096     static void GlobalShutdown();
00097 
00098 private:
00099     nsLocalFile(const nsLocalFile& other);
00100     ~nsLocalFile() {}
00101 
00102     // cached information can only be used when this is PR_FALSE
00103     PRPackedBool mDirty;
00104 
00105     // this string will always be in native format!
00106     nsCString mWorkingPath;
00107 
00108     PRFileInfo64  mFileInfo64;
00109 
00110     void MakeDirty() { mDirty = PR_TRUE; }
00111 
00112     nsresult Stat();
00113 
00114     nsresult CopyMove(nsIFile *newParentDir, const nsACString &newName, PRBool move);
00115     nsresult CopySingleFile(nsIFile *source, nsIFile* dest, const nsACString &newName, PRBool move);
00116 
00117     nsresult SetModDate(PRInt64 aLastModifiedTime);
00118     nsresult AppendNativeInternal(const nsAFlatCString &node, PRBool multipleComponents);
00119 
00120     nsresult GetEA(const char *eaName, PFEA2LIST pfea2list);
00121     friend class TypeEaEnumerator;
00122 };
00123 
00124 #endif