|
static IEnumerable< string > | WrappedLines (string self, params int[] widths) |
|
static IEnumerable< string > | WrappedLines (string self, IEnumerable< int > widths) |
|
Definition at line 164 of file Options.cs.
static IEnumerable<string> Ntp.Common.IO.StringCoda.CreateWrappedLinesIterator |
( |
string |
self, |
|
|
IEnumerable< int > |
widths |
|
) |
| |
|
inlinestaticprivate |
Definition at line 179 of file Options.cs.
References c.
181 if (
string.IsNullOrEmpty(
self))
183 yield
return string.Empty;
186 using (var ewidths = widths.GetEnumerator())
189 var width =
GetNextWidth(ewidths,
int.MaxValue, ref hw);
194 var
c =
self[end - 1];
195 if (
char.IsWhiteSpace(c))
197 var needContinuation = end !=
self.Length && !
IsEolChar(c);
198 var continuation =
"";
199 if (needContinuation)
204 var line =
self.Substring(start, end - start) + continuation;
207 if (
char.IsWhiteSpace(c))
210 }
while (start <
self.Length);
static int GetLineEnd(int start, int length, string description)
static int GetNextWidth(IEnumerator< int > ewidths, int curWidth, ref bool?eValid)
static bool IsEolChar(char c)
static int Ntp.Common.IO.StringCoda.GetLineEnd |
( |
int |
start, |
|
|
int |
length, |
|
|
string |
description |
|
) |
| |
|
inlinestaticprivate |
Definition at line 214 of file Options.cs.
216 var end = Math.Min(start + length, description.Length);
218 for (var i = start; i < end; ++i)
220 if (description[i] ==
'\n')
225 if (sep == -1 || end == description.Length)
static bool IsEolChar(char c)
static int Ntp.Common.IO.StringCoda.GetNextWidth |
( |
IEnumerator< int > |
ewidths, |
|
|
int |
curWidth, |
|
|
ref bool? |
eValid |
|
) |
| |
|
inlinestaticprivate |
Definition at line 230 of file Options.cs.
References if().
232 if (eValid.HasValue && !eValid.Value)
235 curWidth = (eValid = ewidths.MoveNext()).Value ? ewidths.Current : curWidth;
237 const string minWidth =
".-";
238 if (curWidth < minWidth.Length)
239 throw new ArgumentOutOfRangeException(nameof(curWidth),
240 $
"Element must be >= {minWidth.Length}, was {curWidth}.");
if(typeof jQuery=== 'undefined')
static bool Ntp.Common.IO.StringCoda.IsEolChar |
( |
char |
c | ) |
|
|
inlinestaticprivate |
Definition at line 245 of file Options.cs.
247 return !
char.IsLetterOrDigit(
c);
static IEnumerable<string> Ntp.Common.IO.StringCoda.WrappedLines |
( |
string |
self, |
|
|
params int[] |
widths |
|
) |
| |
|
inlinestatic |
static IEnumerable<string> Ntp.Common.IO.StringCoda.WrappedLines |
( |
string |
self, |
|
|
IEnumerable< int > |
widths |
|
) |
| |
|
inlinestatic |
Definition at line 172 of file Options.cs.
175 throw new ArgumentNullException(nameof(widths));
static IEnumerable< string > CreateWrappedLinesIterator(string self, IEnumerable< int > widths)
The documentation for this class was generated from the following file: