Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
UrlDir Class Reference

Classes

class  ConfigDirectory
 
class  ConfigFileType
 
class  UrlConfig
 
class  UrlFile
 
class  UrlIdentifier
 

Public Types

enum  DirectoryType : int { DirectoryType.Parts = 1, DirectoryType.Internals = 2, DirectoryType.GameData = 3 }
 
enum  FileType : int {
  FileType.Unknown = 0, FileType.Config = 1, FileType.Texture = 2, FileType.Model = 3,
  FileType.Audio = 4, FileType.Assembly = 5, FileType.AssetBundle = 6
}
 

Public Member Functions

bool ConfigExists (string url)
 
UrlDir CreateDirectory (string urlDir)
 
bool DirectoryExists (string url)
 
bool FileExists (string url)
 
UrlConfig GetConfig (string url)
 
IEnumerable< UrlConfigGetConfigs (string typeName, bool recursive=true)
 Enumerates through all configs of a given type name More...
 
IEnumerable< UrlConfigGetConfigs (string typeName, string name, bool recursive=true)
 Enumerates through all configs of a given type name and name name More...
 
UrlDir GetDirectory (string url)
 
UrlFile GetFile (string url)
 
IEnumerable< UrlFileGetFiles (FileType type)
 Enumerates through files of a given type More...
 
 UrlDir (ConfigDirectory[] dirConfig, ConfigFileType[] fileConfig)
 

Static Public Member Functions

static string CreateApplicationPath (string relativePath)
 Returns a filepath string that points to the game's root folder (regardless of platform) More...
 
static string PathCombine (string a, string b)
 
static string StripExtension (string filename, string extension)
 Strips an extension, sans point, from a file name More...
 

Public Attributes

const string configExtension = "cfg"
 

Properties

IEnumerable< UrlFileAllConfigFiles [get]
 Enumerates all config files recursively More...
 
IEnumerable< UrlConfigAllConfigs [get]
 Enumerates through all configs More...
 
IEnumerable< UrlDirAllDirectories [get]
 Enumerates all directories recursively More...
 
IEnumerable< UrlFileAllFiles [get]
 Enumerates all files WHICH ARE NOT CONFIGS recursively More...
 
static string ApplicationRootPath [get]
 Returns a filepath string that points to the game's root folder (regardless of platform) More...
 
List< UrlDirchildren [get]
 
List< UrlFilefiles [get]
 
string name [get]
 
UrlDir parent [get]
 
string path [get]
 
UrlDir root [get]
 
DirectoryType type [get]
 
string url [get]
 

Member Enumeration Documentation

Enumerator
Parts 
Internals 
GameData 
enum UrlDir.FileType : int
Enumerator
Unknown 
Config 
Texture 
Model 
Audio 
Assembly 
AssetBundle 

Constructor & Destructor Documentation

UrlDir.UrlDir ( ConfigDirectory[]  dirConfig,
ConfigFileType[]  fileConfig 
)
inline

Member Function Documentation

bool UrlDir.ConfigExists ( string  url)
inline
static string UrlDir.CreateApplicationPath ( string  relativePath)
inlinestatic

Returns a filepath string that points to the game's root folder (regardless of platform)

UrlDir UrlDir.CreateDirectory ( string  urlDir)
inline

< return if empty url

bool UrlDir.DirectoryExists ( string  url)
inline
bool UrlDir.FileExists ( string  url)
inline
UrlConfig UrlDir.GetConfig ( string  url)
inline

< return if empty url

IEnumerable<UrlConfig> UrlDir.GetConfigs ( string  typeName,
bool  recursive = true 
)
inline

Enumerates through all configs of a given type name

Parameters
typeName
Returns
IEnumerable<UrlConfig> UrlDir.GetConfigs ( string  typeName,
string  name,
bool  recursive = true 
)
inline

Enumerates through all configs of a given type name and name name

Parameters
typeName
Returns
UrlDir UrlDir.GetDirectory ( string  url)
inline

< return if empty url

UrlFile UrlDir.GetFile ( string  url)
inline

< return if empty url

IEnumerable<UrlFile> UrlDir.GetFiles ( FileType  type)
inline

Enumerates through files of a given type

Parameters
typeFileType bitmask
Returns
static string UrlDir.PathCombine ( string  a,
string  b 
)
inlinestatic
static string UrlDir.StripExtension ( string  filename,
string  extension 
)
inlinestatic

Strips an extension, sans point, from a file name

Parameters
filename
extension
Returns

Member Data Documentation

const string UrlDir.configExtension = "cfg"

Property Documentation

IEnumerable<UrlFile> UrlDir.AllConfigFiles
get

Enumerates all config files recursively

IEnumerable<UrlConfig> UrlDir.AllConfigs
get

Enumerates through all configs

IEnumerable<UrlDir> UrlDir.AllDirectories
get

Enumerates all directories recursively

IEnumerable<UrlFile> UrlDir.AllFiles
get

Enumerates all files WHICH ARE NOT CONFIGS recursively

string UrlDir.ApplicationRootPath
staticget

Returns a filepath string that points to the game's root folder (regardless of platform)

List<UrlDir> UrlDir.children
get
List<UrlFile> UrlDir.files
get
string UrlDir.name
get
UrlDir UrlDir.parent
get
string UrlDir.path
get
UrlDir UrlDir.root
get
DirectoryType UrlDir.type
get
string UrlDir.url
get

The documentation for this class was generated from the following file: