public static bool GetArgument (string option, PString8* buf) { int argumentIndex; int argumentLen; Diagnostics.Assert (option != null, "CommandLine.GetArgument(): argument `option' is null"); Diagnostics.Assert (buf != null, "CommandLine.GetArgument(): argument `buf' is null"); if (commandLine == null) return false; argumentIndex = IndexOfArgument (option); if (argumentIndex < 0) return false; argumentLen = GetArgumentLength (argumentIndex); buf->Concat (commandLine, argumentIndex, argumentLen); return true; }
/// <summary> /// Compares <paramref name="count" /> characters of the /// string against <paramref name="str" />. /// </summary> public int Compare (PString8* str, int count) { return ByteString.Compare (Pointer, str->Pointer, count); }
/// <summary> /// Compares the string against <paramref name="str" />. /// </summary> public int Compare (PString8* str) { return Compare (str, 0); }
/// <summary> /// Concatenates from <paramref name="str" /> the /// characters at indices <paramref name="offset" /> to /// <paramref name="offset" /> + <paramref name="len" />. /// </summary> public int Concat (PString8* str, int offset, int len) { return Concat (str->Pointer, str->Length, offset, len); }
/// <summary> /// Concatenates <paramref name="str" />. /// </summary> public int Concat (PString8* str) { return Concat (str, 0, 0); }
public unsafe static int ToInt32 (PString8 *str) { return ToInt32 (str->Pointer, 0, str->Length, str->Length); }
public unsafe void ToString (PString8 *str) { if (str == null) throw new ArgumentNullException ("str"); if (DayOfWeekString != null) { str->Concat (DayOfWeekString); str->Concat (" "); } if (MonthString != null) { // January 1, 2008 str->Concat (MonthString); str->Concat (" "); str->Concat (Day); str->Concat (", "); str->Concat (Year); } else { // 2008/1/1 str->Concat (Year); str->Concat ("/"); str->Concat (Month); str->Concat ("/"); str->Concat (Day); } str->Concat (" "); str->Concat (Hour); str->Concat (":"); if (Minute < 10) str->Concat ("0"); str->Concat (Minute); str->Concat (":"); if (Second < 10) str->Concat ("0"); str->Concat (Second); str->Concat ("."); str->Concat (Millisecond); if (CurrentTimezone != 0) { str->Concat (" "); if (TimezoneString != null) str->Concat (TimezoneString); else { str->Concat ("UTC"); if (CurrentTimezone < 0) str->Concat ("+"); str->Concat (CurrentTimezone); } } else { str->Concat (" UTC"); } }
public int IndexOf (int from, PString8* substr) { return IndexOf (from, substr, 0, 0); }
public int IndexOf (PString8* substr) { return IndexOf (0, substr, 0, 0); }
public int IndexOf (int from, PString8* substr, int offset, int count) { return IndexOf (from, substr->Pointer, substr->Length, offset, count); }
public int IndexOf (int from, PString8* substr, int count) { return IndexOf (from, substr, 0, count); }
/// <summary> /// Writes <paramref name="len" /> characters of the string /// <paramref name="message" /> to the screen, starting with /// the character at index <paramref name="offset" />. /// </summary> public unsafe static void WriteSubstring (PString8* message, int offset, int len) { for (int i = offset; i < message->Length && i < offset + len; ++i) WriteChar (message->GetChar (i)); }
public unsafe static void WriteLine (PString8* message, int value) { Write (message); Write (value); WriteLine (); }
public unsafe static void Write (PString8* str) { Write (str->Pointer, str->Length); }
/// <summary> /// Gets the address of a builtin keymap included in the kernel /// via the keymap archive resource in SharpOS.Kernel.dll. The /// archive is generated by the SharpOS keymap compiler. /// </summary> /// <param name="name">The name.</param> /// <param name="nameLen">The name len.</param> /// <returns></returns> public static void* GetBuiltinKeyMap (PString8* name) { return GetBuiltinKeyMap (name->Pointer, name->Length); }
/// <summary> /// Compares <paramref name="count" /> characters of the /// string against <paramref name="str" />. /// </summary> public int Compare (int from, PString8* str, int offset, int count) { return ByteString.Compare (Pointer, from, str->Pointer, offset, count); }
/// <summary> /// Sets the current keymap to a built-in one specified by /// <paramref name="name" />. /// </summary> public static void SetKeyMap (PString8* name) { SetKeyMap (name->Pointer, name->Length); }
public unsafe static int ToInt32 (PString8 *str, int offset, int length) { return ToInt32 (str->Pointer, offset, length, str->Length); }