standardexceptions
本頁內容尚未翻譯。
cpp.StandardException
Section titled “cpp.StandardException”record StandardExceptionA standard exception class: its name (after std::), its base’s (none for std::exception), and what()’s fixed
text (none for a class that keeps its message, and one derived from it).
cpp.StandardException.of
Section titled “cpp.StandardException.of”def StandardException.of (name : String) (base : Option String) (fixed : Option String) : StandardExceptionA standard exception class from its parts.
cpp.StandardExceptions.all
Section titled “cpp.StandardExceptions.all”def StandardExceptions.all : List StandardExceptionThe standard exception classes, each after its base, as libc++ defines them.
cpp.StandardExceptions.className
Section titled “cpp.StandardExceptions.className”def StandardExceptions.className (x : String) : StringA standard exception’s class name.
cpp.StandardExceptions.classType
Section titled “cpp.StandardExceptions.classType”def StandardExceptions.classType (x : String) : TypeSyntaxA standard exception’s class as a written type.
cpp.StandardExceptions.isClass
Section titled “cpp.StandardExceptions.isClass”def StandardExceptions.isClass (x : String) : BoolWhether a name is a standard exception class’s.
cpp.StandardExceptions.message
Section titled “cpp.StandardExceptions.message”def StandardExceptions.message : StringThe member that keeps a message.
cpp.StandardExceptions.copyName
Section titled “cpp.StandardExceptions.copyName”def StandardExceptions.copyName : StringThe function that copies a message into a block of its own (new[]), what a message is kept in.
cpp.StandardExceptions.copyFunction
Section titled “cpp.StandardExceptions.copyFunction”def StandardExceptions.copyFunction : Itemchar *#copyMessage(const char *text): a block of strlen(text) + 1 characters (new[]) with the text and its null
copied.
cpp.StandardExceptions.keeper
Section titled “cpp.StandardExceptions.keeper”def StandardExceptions.keeper (fuel : Nat) (x : String) : StringThe class that keeps the message an exception class (derived from it) is constructed with: logic_error or runtime_error (fuel bounds the depth).
cpp.StandardExceptions.keeping
Section titled “cpp.StandardExceptions.keeping”def StandardExceptions.keeping (x : String) (what : Expr -> Member) : List MemberThe members of the class (named x) that keeps a message, as libc++ keeps it (a copy of its own, not a std::string):
the message’s block, a copy constructor and a copy assignment that copy it, a destructor that releases it, and what()
that gives it.
cpp.StandardExceptions.classOf
Section titled “cpp.StandardExceptions.classOf”def StandardExceptions.classOf (strings : Bool) (e : StandardException) : ItemA standard exception’s class. One with a fixed text has a default constructor and that what(); one that keeps
its message is constructed from a C string (and from a std::string, in a program that has them): the keeper (logic_error,
runtime_error) copies it, a class derived from one gives it to its base and inherits the keeper’s what().
cpp.Item.usesString
Section titled “cpp.Item.usesString”def Item.usesString (items : List Item) : BoolWhether a program’s items use std::string (the syntax’s string type, or the library’s class).
cpp.StandardExceptions.used
Section titled “cpp.StandardExceptions.used”def StandardExceptions.used (e : Expr) : List StringThe standard exceptions an expression uses: one it constructs, std::out_of_range for a call of at or substr
(std::vector’s and std::string’s throw it), std::bad_cast for a dynamic_cast to a reference (it throws one where it
fails), std::bad_typeid for typeid of an expression.
cpp.StandardExceptions.typeNames
Section titled “cpp.StandardExceptions.typeNames”def StandardExceptions.typeNames (t : TypeSyntax) : List StringThe standard exception a written type names, if any.
cpp.StandardExceptions.derived
Section titled “cpp.StandardExceptions.derived”def StandardExceptions.derived (it : Item) : List StringThe standard exceptions a class derives from directly.
cpp.StandardExceptions.mentioned
Section titled “cpp.StandardExceptions.mentioned”def StandardExceptions.mentioned (items : List Item) : List StringThe standard exceptions a program’s items use: by type, as a base, or by an expression (one pass over them).
cpp.StandardExceptions.baseOf
Section titled “cpp.StandardExceptions.baseOf”def StandardExceptions.baseOf (x : String) : List StringA standard exception’s base (none for std::exception, or a name that is not one).
cpp.StandardExceptions.withBases
Section titled “cpp.StandardExceptions.withBases”def StandardExceptions.withBases (fuel : Nat) (names : List String) : List StringThe names with their bases, and theirs (fuel bounds the depth).
cpp.StandardExceptions.needed
Section titled “cpp.StandardExceptions.needed”def StandardExceptions.needed (items : List Item) : List StandardExceptionThe standard exception classes a program needs: those it uses and their bases, each after its base.
cpp.StandardExceptions.rewrite
Section titled “cpp.StandardExceptions.rewrite”def StandardExceptions.rewrite (t : TypeSyntax) : TypeSyntaxA written type with a standard exception’s replaced by its class.
cpp.StandardExceptions.prepare
Section titled “cpp.StandardExceptions.prepare”def StandardExceptions.prepare (p : Program) : ProgramA program with the standard exception classes it needs before its items.