| Modifier and Type | Field and Description |
|---|---|
| public boolean | appending
Whether this file is opened in appending mode ('a') |
| public boolean | binary
Whether this file is opened in binary mode ('b') |
| public boolean | invalid
Set true when any invalid symbol or combination is discovered |
| public String | message
Error message describing the way in which the mode is invalid, or null if no problem has been found. |
| public final String | originalModeString
Original string supplied as the mode |
| public boolean | other
Whether the mode contained some other symbol from the allowed ones |
| public boolean | reading
Whether this file is opened for reading ('r') |
| public boolean | text
Whether this file is opened in text mode ('t') |
| public boolean | universal
Whether this file is opened in universal newlines mode ('U') |
| public boolean | updating
Whether this file is opened for updating ('+') |
| public boolean | writing
Whether this file is opened for writing ('w') |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkValid()
Call |
| public String | Returns: "r", "w", or "a" with optional "+".The mode string we need when constructing a |
| public String | Returns: "", or "U".The mode string that a text file should claim to have, when initialised with the present mode. |
| public String | |
| public void | |
| public void |
| appending | back to summary |
|---|---|
| public boolean appending Whether this file is opened in appending mode ('a') | |
| binary | back to summary |
|---|---|
| public boolean binary Whether this file is opened in binary mode ('b') | |
| invalid | back to summary |
|---|---|
| public boolean invalid Set true when any invalid symbol or combination is discovered | |
| message | back to summary |
|---|---|
| public String message Error message describing the way in which the mode is invalid, or null if no problem has been
found. This field may be set by the constructor (in the case of duplicate or unrecognised
mode letters), by the | |
| originalModeString | back to summary |
|---|---|
| public final String originalModeString Original string supplied as the mode | |
| other | back to summary |
|---|---|
| public boolean other Whether the mode contained some other symbol from the allowed ones | |
| reading | back to summary |
|---|---|
| public boolean reading Whether this file is opened for reading ('r') | |
| text | back to summary |
|---|---|
| public boolean text Whether this file is opened in text mode ('t') | |
| universal | back to summary |
|---|---|
| public boolean universal Whether this file is opened in universal newlines mode ('U') | |
| updating | back to summary |
|---|---|
| public boolean updating Whether this file is opened for updating ('+') | |
| writing | back to summary |
|---|---|
| public boolean writing Whether this file is opened for writing ('w') | |
| OpenMode | back to summary |
|---|---|
| public OpenMode(String mode) Decode the given string to an OpenMode object, checking for duplicate or unrecognised mode
letters. Valid letters are those in "rwa+btU". Errors in the mode string do not raise an
exception, they simply generate an appropriate error message in | |
| checkValid | back to summary |
|---|---|
| public void checkValid() throws PyException Call
| |
| forFileIO | back to summary |
|---|---|
| public String forFileIO() The mode string we need when constructing a
| |
| text | back to summary |
|---|---|
| public String text() The mode string that a text file should claim to have, when initialised with the present mode. Note that this only contains text-based attributes. Since mode 't' has no effect, except to produce an error if specified with 'b', we don't reproduce it.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| validate | back to summary |
|---|---|
| public void validate() Adjust and validate the flags decoded from the mode string. The method affects the flags
where the presence of one flag implies another, then if the The invalid combinations enforced here are those for the "raw" (ie non-text) file types:
validate(String, String, String) for additional checks relevant to text
files.
| |
| validate | back to summary |
|---|---|
| public void validate(String encoding, String errors, String newline) Perform additional validation of the flags relevant to text files. If | |