1998-08-17 04:44:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1998-08-17 04:44:45 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1998-08-17 04:44:45 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1998-08-17 04:44:45 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1998-08-17 04:44:45 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsFolderSpec_h__
|
|
|
|
#define nsFolderSpec_h__
|
|
|
|
|
|
|
|
#include "prtypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
PR_BEGIN_EXTERN_C
|
|
|
|
|
|
|
|
struct nsFolderSpec {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/* Public Methods */
|
|
|
|
|
|
|
|
/* Constructor
|
|
|
|
*/
|
|
|
|
nsFolderSpec(char* inFolderID , char* inVRPath, char* inPackageName);
|
|
|
|
~nsFolderSpec();
|
1998-10-21 00:55:30 +04:00
|
|
|
|
|
|
|
/*
|
1998-08-17 04:44:45 +04:00
|
|
|
* GetDirectoryPath
|
|
|
|
* returns full path to the directory in the standard URL form
|
|
|
|
*/
|
1998-10-21 00:55:30 +04:00
|
|
|
char* GetDirectoryPath(void);
|
1998-08-17 04:44:45 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns full path to a file. Makes sure that the full path is bellow
|
|
|
|
* this directory (security measure
|
|
|
|
* @param relativePath relative path
|
|
|
|
* @return full path to a file
|
|
|
|
*/
|
|
|
|
char* MakeFullPath(char* relativePath, char* *errorMsg);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* IsJavaCapable
|
|
|
|
* returns true if folder is on the Java classpath
|
|
|
|
*/
|
|
|
|
PRBool IsJavaCapable() { return NativeIsJavaDir(); }
|
|
|
|
|
|
|
|
char* toString();
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
/* Private Fields */
|
|
|
|
char* urlPath; // Full path to the directory. Used to cache results from GetDirectoryPath
|
|
|
|
char* folderID; // Unique string specifying a folder
|
|
|
|
char* versionRegistryPath; // Version registry path of the package
|
|
|
|
char* userPackageName; // Name of the package presented to the user
|
|
|
|
|
|
|
|
|
|
|
|
/* Private Methods */
|
|
|
|
|
1998-10-21 00:55:30 +04:00
|
|
|
/*
|
|
|
|
* SetDirectoryPath
|
|
|
|
* sets full path to the directory in the standard URL form
|
|
|
|
*/
|
|
|
|
|
|
|
|
char* SetDirectoryPath(char* *errorMsg);
|
|
|
|
|
1998-08-17 04:44:45 +04:00
|
|
|
/* PickDefaultDirectory
|
|
|
|
* asks the user for the default directory for the package
|
|
|
|
* stores the choice
|
|
|
|
*/
|
|
|
|
char* PickDefaultDirectory(char* *errorMsg);
|
|
|
|
|
|
|
|
|
|
|
|
/* Private Native Methods */
|
|
|
|
|
|
|
|
/* NativeGetDirectoryPath
|
|
|
|
* gets a platform-specific directory path
|
|
|
|
* stores it in urlPath
|
|
|
|
*/
|
|
|
|
int NativeGetDirectoryPath();
|
|
|
|
|
|
|
|
/* GetNativePath
|
|
|
|
* returns a native equivalent of a XP directory path
|
|
|
|
*/
|
|
|
|
char* GetNativePath(char* Path);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NativePickDefaultDirectory
|
|
|
|
* Platform-specific implementation of GetDirectoryPath
|
|
|
|
*/
|
1998-08-22 03:46:11 +04:00
|
|
|
char* NativePickDefaultDirectory(void);
|
1998-08-17 04:44:45 +04:00
|
|
|
|
|
|
|
PRBool NativeIsJavaDir();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
PR_END_EXTERN_C
|
|
|
|
|
|
|
|
#endif /* nsFolderSpec_h__ */
|