C# Class DanbooruDownloader3.Helper

显示文件 Open project: Nandaka/DanbooruDownloader

Public Properties

Property Type Description
ColorArtist Color
ColorBlacklisted Color
ColorCharacter Color
ColorCircle Color
ColorCopyright Color
ColorDeleted Color
ColorFaults Color
ColorGeneral Color
ColorUnknown Color

Public Methods

Method Description
CheckBlacklistedTag ( DanbooruPost post, DanbooruDownloader3.Entity.DanbooruPostDaoOption option ) : bool
DecodeEncodedNonAsciiCharacters ( string value ) : string

Decode JSON Encoded Unicode Character to C# string. http://stackoverflow.com/questions/1615559/converting-unicode-strings-to-escaped-ascii-string

DumpRawData ( string data, DanbooruProvider provider, string query ) : bool
DumpRawData ( string data, string filename ) : bool
FixUrl ( string url, bool useHttps = false, string hostname = null ) : string
FormatByteSize ( long size ) : string
GeneratePasswordHash ( string password, string salt ) : string

Generate hashed password+salt using SHA1

IsTagsXmlExist ( ) : bool
MakeFilename ( DanbooruDownloader3.Entity.DanbooruFilenameFormat format, DanbooruPost post ) : string

For constructing TAGS_FILENAME.

PadUserAgent ( string originalUserAgent ) : string

Pad user agent with current date/time.

ParseCookie ( string cookiesStr, string url ) : List
ParseTags ( string p, DanbooruProvider provider ) : List
RemoveAuthInfo ( string url ) : string

Replace password_hash param with '*'

RemoveControlCharacters ( string inString ) : string

Remove control char from unicode string http://stackoverflow.com/a/6799681

SanitizeFilename ( string input, bool allowPathSeparator = false ) : string

Sanitize the TAGS_FILENAME.

Shutdown ( ) : void
WriteTextFile ( string content, string filename = null ) : void
getFileExtensions ( string url ) : string
shortSpeedStr ( long speed ) : string

http://stackoverflow.com/a/14488941

Private Methods

Method Description
FilterTags ( DanbooruPost post, List groupedTags, DanbooruTagType tagType, int tagLimit, string tagReplacement, string missingTagReplacement, bool isReplaceMode, bool isReplaceUnderScore ) : string

Return string from tag filtered by tag type. Replace the returned string with tagReplacement if tag count over tagLimit. Replace the returned string with missingTagReplacement if tag count is 0.

ReadTagsFromTextFile ( string filename ) : List
RemoveIgnoredTags ( DanbooruDownloader3.Entity.DanbooruFilenameFormat format, List groupedTags ) : List
WriteTagFile ( DanbooruPost post, string filename ) : void

Method Details

CheckBlacklistedTag() public static method

public static CheckBlacklistedTag ( DanbooruPost post, DanbooruDownloader3.Entity.DanbooruPostDaoOption option ) : bool
post DanbooruDownloader3.Entity.DanbooruPost
option DanbooruDownloader3.Entity.DanbooruPostDaoOption
return bool

DecodeEncodedNonAsciiCharacters() public static method

Decode JSON Encoded Unicode Character to C# string. http://stackoverflow.com/questions/1615559/converting-unicode-strings-to-escaped-ascii-string
public static DecodeEncodedNonAsciiCharacters ( string value ) : string
value string
return string

DumpRawData() public static method

public static DumpRawData ( string data, DanbooruProvider provider, string query ) : bool
data string
provider DanbooruDownloader3.Entity.DanbooruProvider
query string
return bool

DumpRawData() public static method

public static DumpRawData ( string data, string filename ) : bool
data string
filename string
return bool

FixUrl() public static method

public static FixUrl ( string url, bool useHttps = false, string hostname = null ) : string
url string
useHttps bool
hostname string
return string

FormatByteSize() public static method

public static FormatByteSize ( long size ) : string
size long
return string

GeneratePasswordHash() public static method

Generate hashed password+salt using SHA1
public static GeneratePasswordHash ( string password, string salt ) : string
password string
salt string
return string

IsTagsXmlExist() public static method

public static IsTagsXmlExist ( ) : bool
return bool

MakeFilename() public static method

For constructing TAGS_FILENAME.
public static MakeFilename ( DanbooruDownloader3.Entity.DanbooruFilenameFormat format, DanbooruPost post ) : string
format DanbooruDownloader3.Entity.DanbooruFilenameFormat
post DanbooruDownloader3.Entity.DanbooruPost
return string

PadUserAgent() public static method

Pad user agent with current date/time.
public static PadUserAgent ( string originalUserAgent ) : string
originalUserAgent string
return string

ParseCookie() public static method

public static ParseCookie ( string cookiesStr, string url ) : List
cookiesStr string
url string
return List

ParseTags() public static method

public static ParseTags ( string p, DanbooruProvider provider ) : List
p string
provider DanbooruDownloader3.Entity.DanbooruProvider
return List

RemoveAuthInfo() public static method

Replace password_hash param with '*'
public static RemoveAuthInfo ( string url ) : string
url string
return string

RemoveControlCharacters() public static method

Remove control char from unicode string http://stackoverflow.com/a/6799681
public static RemoveControlCharacters ( string inString ) : string
inString string
return string

SanitizeFilename() public static method

Sanitize the TAGS_FILENAME.
public static SanitizeFilename ( string input, bool allowPathSeparator = false ) : string
input string
allowPathSeparator bool
return string

Shutdown() public static method

public static Shutdown ( ) : void
return void

WriteTextFile() public static method

public static WriteTextFile ( string content, string filename = null ) : void
content string
filename string
return void

getFileExtensions() public static method

public static getFileExtensions ( string url ) : string
url string
return string

shortSpeedStr() public static method

http://stackoverflow.com/a/14488941
public static shortSpeedStr ( long speed ) : string
speed long
return string

Property Details

ColorArtist public_oe static_oe property

public static Color ColorArtist
return Color

ColorBlacklisted public_oe static_oe property

public static Color ColorBlacklisted
return Color

ColorCharacter public_oe static_oe property

public static Color ColorCharacter
return Color

ColorCircle public_oe static_oe property

public static Color ColorCircle
return Color

ColorCopyright public_oe static_oe property

public static Color ColorCopyright
return Color

ColorDeleted public_oe static_oe property

public static Color ColorDeleted
return Color

ColorFaults public_oe static_oe property

public static Color ColorFaults
return Color

ColorGeneral public_oe static_oe property

public static Color ColorGeneral
return Color

ColorUnknown public_oe static_oe property

public static Color ColorUnknown
return Color