File: JavaDirectory.h

package info (click to toggle)
guavac 1.2-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,728 kB
  • ctags: 2,387
  • sloc: cpp: 20,367; yacc: 1,664; makefile: 504; lex: 348; ansic: 286; sh: 263
file content (47 lines) | stat: -rw-r--r-- 1,350 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 1996  David Engberg  All rights reserved
// $Id: JavaDirectory.h,v 1.2 1996/07/12 20:43:40 geppetto Exp $
#ifndef _JavaDirectory_h
#define _JavaDirectory_h
#pragma interface

#include "unicode_string.h"
#include "FilePath.h"
extern "C" {
  #include "zextract.h"
}
class CJavaClassFile;

//
//  Class name : CJavaDirectory
//  Description : This class represents a conceptual directory which may hold
//    Java class files.  Since Java can use archived class files found in
//    a compressed ("zip") file, this entity may or may not correspond to
//    an actual directory on disk.
//
class CJavaDirectory {
public:
  CJavaDirectory(const string& baseDirectory);
  CJavaDirectory(const CJavaDirectory& source);
  CJavaDirectory(const CJavaDirectory& base, const string& relativePath);
  ~CJavaDirectory();
  CJavaDirectory& operator=(const CJavaDirectory& source);
  bool operator==(const CJavaDirectory& other) const;
  bool operator<(const CJavaDirectory& other) const;

  bool IsValid() const { return fIsValid; }
  bool InZipFile() const { return fZipFile != 0; }
  string GetRealDirectory() const;
  string GetPackage() const;

  CJavaClassFile* LoadClassFile(const unicode_string& className) const;

  CJavaDirectory();
private:

  CFilePath fBasePath;
  string fRelativePath;
  ZipFile* fZipFile;
  bool fIsValid;
};

#endif