mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 06:30:28 +03:00
Renamed std.encoding.Exception to EncodingException
This commit is contained in:
parent
02232cabd1
commit
ab4da381b0
1 changed files with 22 additions and 22 deletions
|
@ -1840,7 +1840,7 @@ body
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Convert a string from one encoding to another. (See also transcode() above).
|
||||
*
|
||||
* The input to this function MUST be validly encoded.
|
||||
|
@ -1878,9 +1878,9 @@ body
|
|||
//=============================================================================
|
||||
|
||||
/** The base class for exceptions thrown by this module */
|
||||
class Exception : object.Exception { this(string msg) { super(msg); } }
|
||||
class EncodingException : Exception { this(string msg) { super(msg); } }
|
||||
|
||||
class UnrecognizedEncodingException : Exception
|
||||
class UnrecognizedEncodingException : EncodingException
|
||||
{
|
||||
private this(string msg) { super(msg); }
|
||||
}
|
||||
|
@ -1909,7 +1909,7 @@ abstract class EncodingScheme
|
|||
{
|
||||
auto scheme = cast(EncodingScheme)Object.factory(className);
|
||||
if (scheme is null)
|
||||
throw new Exception("Unable to create class "~className);
|
||||
throw new EncodingException("Unable to create class "~className);
|
||||
foreach(encodingName;scheme.names())
|
||||
{
|
||||
supported[tolower(encodingName)] = className;
|
||||
|
@ -1932,10 +1932,10 @@ abstract class EncodingScheme
|
|||
{
|
||||
auto p = std.string.tolower(encodingName) in supported;
|
||||
if (p is null)
|
||||
throw new Exception("Unrecognized Encoding: "~encodingName);
|
||||
throw new EncodingException("Unrecognized Encoding: "~encodingName);
|
||||
string className = *p;
|
||||
auto scheme = cast(EncodingScheme)Object.factory(className);
|
||||
if (scheme is null) throw new Exception("Unable to create class "~className);
|
||||
if (scheme is null) throw new EncodingException("Unable to create class "~className);
|
||||
return scheme;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue