/usr/share/GNUstep/Documentation/Developer/Base/Reference/NSFormatter.html is in gnustep-base-doc 1.24.7-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>NSFormatter class reference</title>
</head>
<body>
<font face="serif">
<a href="Base.html">Up</a>
<br />
<h1><a name="title$NSFormatter">NSFormatter class reference</a></h1>
<h3>Authors</h3>
<dl>
<dt>Richard Frith-Macdonald (<a href="mailto:richard@brainstorm.co.uk"><code>richard@brainstorm.co.uk</code></a>)</dt>
<dd>
</dd>
</dl>
<p><b>Version:</b> 37003</p>
<p><b>Date:</b> 2013-08-22 16:44:54 +0100 (Thu, 22 Aug 2013)</p>
<p><b>Copyright:</b> (C) 1998 Free Software Foundation, Inc.</p>
<div>
</div>
<h1><a name="001000000000">
Software documentation for the NSFormatter class
</a></h1>
<h2><a name="class$NSFormatter">NSFormatter</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>Foundation/NSFormatter.h</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>Conforms to:</b></dt>
<dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCopying)">NSCopying</a></dd>
<dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCoding)">NSCoding</a></dd>
</dl>
</blockquote>
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
This abstract class defines the interface for classes
that support conversion between strings and objects of
various types. GNUstep provides two concrete
implementations of this class:
<a rel="gsdoc" href="NSDateFormatter.html#class$NSDateFormatter">NSDateFormatter</a>
and
<a rel="gsdoc" href="NSNumberFormatter.html#class$NSNumberFormatter">NSNumberFormatter</a>
. Others may be implemented for specialized
applications.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-attributedStringForObjectValue$withDefaultAttributes$">-attributedStringForObjectValue:withDefaultAttributes:</a></li>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-editingStringForObjectValue$">-editingStringForObjectValue:</a></li>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-getObjectValue$forString$errorDescription$">-getObjectValue:forString:errorDescription:</a></li>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-isPartialStringValid$newEditingString$errorDescription$">-isPartialStringValid:newEditingString:errorDescription:</a></li>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-isPartialStringValid$proposedSelectedRange$originalString$originalSelectedRange$errorDescription$">-isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:</a></li>
<li><a rel="gsdoc" href="NSFormatter.html#method$NSFormatter-stringForObjectValue$">-stringForObjectValue:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$NSFormatter-attributedStringForObjectValue$withDefaultAttributes$">attributedStringForObjectValue: withDefaultAttributes: </a></h3>
- (<a rel="gsdoc" href="NSAttributedString.html#class$NSAttributedString">NSAttributedString</a>*) <b>attributedStringForObjectValue:</b> (id)anObject<b> withDefaultAttributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attr;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
This method calls
<a rel="gsdoc" href="#method$NSFormatter-stringForObjectValue$">
[-stringForObjectValue:]
</a>
then marks up the string with attributes if it should
be displayed specially. For example, in an application
you may want to display out-of-range dates or numbers
in italics. This is an optional method and may return
<code>nil</code> to indicate that an attributed
string is not provided.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFormatter-editingStringForObjectValue$">editingStringForObjectValue: </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>editingStringForObjectValue:</b> (id)anObject;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
For use in applications where user interactively edits
a string. If the version of the string for editing
purposes should look different from the string
displayed (returned by
<a rel="gsdoc" href="#method$NSFormatter-stringForObjectValue$">
[-stringForObjectValue:]
</a>
or
<a rel="gsdoc" href="#method$NSFormatter-attributedStringForObjectValue$withDefaultAttributes$">-attributedStringForObjectValue:withDefaultAttributes:</a>
), return that here. For example, the edited string may contain formatting codes or similar that are not displayed in the final string. The default implementation simply returns <a rel="gsdoc" href="#method$NSFormatter-stringForObjectValue$">-stringForObjectValue:</a>
.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFormatter-getObjectValue$forString$errorDescription$">getObjectValue: forString: errorDescription: </a></h3>
- (BOOL) <b>getObjectValue:</b> (id*)anObject<b> forString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)string<b> errorDescription:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Primary method for converting a <var>string</var>
to an object through parsing. <var>anObject</var> and
<var>error</var> are output parameters; you should
allocate memory for one pointer each for the
variables passed into these methods. The returned
object will have been created through
<code>alloc-init</code>. If there is a problem with
conversion, a constant-string description of
what went wrong is returned through <var>error</var>,
and <code>NO</code> is returned, otherwise
<code>YES</code>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFormatter-isPartialStringValid$newEditingString$errorDescription$">isPartialStringValid: newEditingString: errorDescription: </a></h3>
- (BOOL) <b>isPartialStringValid:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)partialString<b> newEditingString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>**)newString<b> errorDescription:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Checks whether <var>partialString</var>
<em>could</em>, if it were completed, be parsed into a
valid object. <var>newString</var> and
<var>error</var> are output parameters; you should
allocate memory for one pointer each for the
variables passed into these methods. This method
is set up to be called after every keystroke during user
editing. If it returns <code>NO</code>, it
optionally returns <var>newString</var> to
replace what the user was editing; if it doesn't,
the editor should delete the last character the user
typed.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFormatter-isPartialStringValid$proposedSelectedRange$originalString$originalSelectedRange$errorDescription$">isPartialStringValid: proposedSelectedRange: originalString: originalSelectedRange: errorDescription: </a></h3>
- (BOOL) <b>isPartialStringValid:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>**)partialStringPtr<b> proposedSelectedRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>*)proposedSelRangePtr<b> originalString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)origString<b> originalSelectedRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)originalSelRangePtr<b> errorDescription:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>**)error;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
<div class="desc">
Checks whether a change to a string leaves it a
valid string that, if it were completed, could be
parsed into a valid object. <var>origString</var>
contains the string before the proposed change,
and origSelRange contains the range that is updated in
the proposed change. <var>partialStringPtr</var>
contains the new string to validate and
<var>proposedSelRangePtr</var> holds the selection
range that will be used if the string is accepted or
replaced. Basically, this method returns
<code>YES</code> if <var>partialStringPtr</var> is
valid, otherwise <code>NO</code> and may replace
<var>partialStringPtr</var> and proposedSelectedRange
with improved values, and may report the reason in
<var>error</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$NSFormatter-stringForObjectValue$">stringForObjectValue: </a></h3>
- (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>stringForObjectValue:</b> (id)anObject;<br />
<div class="availability">
<b>Availability:</b> MacOS-X 10.0.0</div>
<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Primary method for converting an object to a string
through formatting. Object will be converted to
string according to the formatter's implementation
and init parameters. There is no default handling if
the class of <var>anObject</var> is not what the
formatter expects, and usually <code>nil</code>
will be returned in this case.
</div>
<hr width="25%" align="left" />
</div>
<br />
<a href="Base.html">Up</a>
</font>
</body>
</html>
|