public static GString operator +(GString s1, GString s2) { GString s = new GString(); s._str = s1._str + s2._str; return(s); }
public GString GetDateTime(GString Format) { GString test = new GString(this._time.Day); //DayInterface *d = GDayInstance::GetInstance(op); //g = g.Replace("%dddd", d->GetDay(this._tm->tm_wday)); //g = g.Replace("%ddd", d->GetTruncateDay(this._tm->tm_wday)); Format = Format.Replace("%dd", test.RightJustified(2, '0')); Format = Format.Replace("%d", test); //MonthInterface *m = GMonthInstance::GetInstance(op); test = new GString(this._time.Month); //Format = Format.Replace("%MMMM", m->GetMonth(this._tm->tm_mon)); //Format = Format.Replace("%MMM", m->GetTruncateMonth(this._tm->tm_mon)); Format = Format.Replace("%MM", test.RightJustified(2, '0')); Format = Format.Replace("%M", test); test = new GString(this._time.Year); Format = Format.Replace("%yyyy", test); Format = Format.Replace("%yy", test.Substr(2, 4)); test = new GString(this._time.Hour); Format = Format.Replace("%hh", test.RightJustified(2, '0')); Format = Format.Replace("%h", test); test = new GString(this._time.Minute); Format = Format.Replace("%mm", test.RightJustified(2, '0')); Format = Format.Replace("%m", test); test = new GString(this._time.Second); Format = Format.Replace("%ss", test.RightJustified(2, '0')); Format = Format.Replace("%s", test); return(Format); }
public static bool IsDirectory(GString Dir) { if (Directory.Exists(Dir.ToString())) { return(true); } return(false); }
public Boolean Compare(GString str) { if (str._str == this._str) { return(true); } return(false); }
public override Int32 Send(GString s) { if (this._init) { Byte [] Message = System.Text.Encoding.ASCII.GetBytes(s.ToString()); return (this._socket.Send (Message, 0, Message.Length, SocketFlags.None)); } return (0); }
public override Int32 Send(GString s) { if (this._init) { Byte [] Message = System.Text.Encoding.ASCII.GetBytes(s.ToString()); return(this._socket.Send(Message, 0, Message.Length, SocketFlags.None)); } return(0); }
Int32 Find(GString f, Int32 Position, CaseOption c) { if (c == G.GString.CaseOption.CASE_INSENSITIVE) { String temp = this._str; temp = temp.ToLower(); String fin = f._str.ToLower(); return(temp.IndexOf(fin, (Int32)Position)); } return(this._str.IndexOf(f._str, (Int32)Position)); }
public Boolean Contain(GString s, CaseOption op) { if (op == CaseOption.CASE_SENSITIVE) { return(this._str.Contains(s._str)); } String news = this._str.ToLower(); s = s._str.ToLower(); return(this._str.Contains(s._str)); }
public static Boolean Rename(GString f1, GString f2) { Boolean test = true; try { Directory.Move(f1.ToString(), f2.ToString()); } catch { test = false; } return (test); }
public static bool Touch(GString FileName) { Boolean test = true; try { File.Create(FileName); } catch { test = false; } return (test); }
public static Boolean Rmdir(GString Dir, bool Recursif) { Boolean test = true; try { Directory.Delete(Dir.ToString(), Recursif); } catch { test = false; } return (test); }
public static bool Touch(GString FileName) { Boolean test = true; try { File.Create(FileName); } catch { test = false; } return(test); }
public bool Mkpath(GString Path) { bool test = true; try { Directory.CreateDirectory(System.IO.Path.Combine(this._directory.ToString(), Path.ToString())); } catch { test = false; } return(test); }
public bool Cd(GString Dir) { bool test = true; try { Directory.SetCurrentDirectory(Dir.ToString()); this._directory = Directory.GetCurrentDirectory(); } catch { test = false; } return (test); }
public static Boolean Rename(GString f1, GString f2) { Boolean test = true; try { Directory.Move(f1.ToString(), f2.ToString()); } catch { test = false; } return(test); }
public static Boolean Rmdir(GString Dir, bool Recursif) { Boolean test = true; try { Directory.Delete(Dir.ToString(), Recursif); } catch { test = false; } return(test); }
public override Boolean Equals(object obj) { if (obj == null || this.GetType() != obj.GetType()) { return(false); } GString t = (GString)obj; if (this._str == t._str) { return(true); } return(false); }
public bool Cd(GString Dir) { bool test = true; try { Directory.SetCurrentDirectory(Dir.ToString()); this._directory = Directory.GetCurrentDirectory(); } catch { test = false; } return(test); }
public Boolean Rmdir(bool Recursif) { Boolean test = true; try { Directory.Delete(this._directory.ToString(), Recursif); this._directory = Directory.GetCurrentDirectory(); } catch { test = false; } return(test); }
public static bool Run(GString ProccessName) { Boolean test = true; try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = ProccessName; proc.Start() ; proc.Close(); } catch { test = false; } return (test); }
public static bool Run(GString ProccessName) { Boolean test = true; try { System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = ProccessName; proc.Start(); proc.Close(); } catch { test = false; } return(test); }
public static Boolean Kill(GString ProcessName) { Boolean test = true; try { System.Diagnostics.Process[] prc = Process.GetProcessesByName(ProcessName); UInt32 i = 0; while (i < prc.Length) { prc[i].Kill(); ++i; } } catch { test = false; } return (test); }
public static Boolean Kill(GString ProcessName) { Boolean test = true; try { System.Diagnostics.Process[] prc = Process.GetProcessesByName(ProcessName); UInt32 i = 0; while (i < prc.Length) { prc[i].Kill(); ++i; } } catch { test = false; } return(test); }
public GStringList Split(GString f, SplitOption splitop, CaseOption caseop) { GStringList vect = new GStringList(); if (this.Find(f, caseop) == -1) { vect.PushBack(this); return(vect); } int pos = 0, pos1 = 0, pos2 = 0; while (true) { pos1 = pos; pos = this.Find(f, pos, caseop); if (pos == -1) { break; } pos2 = pos; GString ne = this.Substr(pos1, pos2); if ((splitop == GString.SplitOption.SKIP_EMPTY_PARTS && ne.Size != 0) || splitop == G.GString.SplitOption.KEEP_EMPTY_PARTS) { vect.PushBack(ne); } pos += f.Size; } if (pos1 != 0) { GString ne = new GString(this.Substr(pos1, this.Size)); if ((splitop == G.GString.SplitOption.SKIP_EMPTY_PARTS && ne.Size != 0) || splitop == G.GString.SplitOption.KEEP_EMPTY_PARTS) { vect.PushBack(ne); } } return(vect); }
public GStringList Split(GString f) { return(this.Split(f, G.GString.SplitOption.SKIP_EMPTY_PARTS, G.GString.CaseOption.CASE_SENSITIVE)); }
public GString Insert(Int32 StartIndex, GString str) { return(this._str.Insert(StartIndex, str._str)); }
public GString Remove(GString Str) { return (this.Replace(Str, "")); }
public Boolean StartWith(GString str) { return(this._str.StartsWith(str._str)); }
public GString Replace(GString Find, GString Rep) { return (new GString(this._str.Replace(Find._str.ToString(), Rep._str))); }
public GString(GString g) { this._str = g._str; }
Int32 Find(GString f, Int32 Position, CaseOption c) { if (c == G.GString.CaseOption.CASE_INSENSITIVE) { String temp = this._str; temp = temp.ToLower(); String fin = f._str.ToLower(); return (temp.IndexOf(fin, (Int32)Position)); } return (this._str.IndexOf(f._str, (Int32)Position)); }
public bool Rmpath(GString Path) { return (true); }
public GDirectory() { this._directory = Directory.GetCurrentDirectory(); }
public Boolean Rmdir(bool Recursif) { Boolean test = true; try { Directory.Delete(this._directory.ToString(), Recursif); this._directory = Directory.GetCurrentDirectory(); } catch { test = false; } return (test); }
public Boolean Compare(GString str) { if (str._str == this._str) return (true); return (false); }
public static void Open(GString Drive) { mciSendString("open " + Drive.ToString() + ":\\ type cdaudio alias cdaudio", "", 0, 0); mciSendString("Set cdaudio door open wait", "", 0, 0); mciSendString("close cdaudio", "", 0, 0); }
public GString Insert(Int32 StartIndex, GString str) { return (this._str.Insert(StartIndex, str._str)); }
public Boolean StartWith(GString str) { return (this._str.StartsWith(str._str)); }
public static Int32 Send(GISocket Socket, GString ToSend) { return (Socket.Send(ToSend)); }
public GStringList Split(GString f) { return (this.Split(f, G.GString.SplitOption.SKIP_EMPTY_PARTS, G.GString.CaseOption.CASE_SENSITIVE)); }
public GString Replace(GString Find, GString Rep) { return(new GString(this._str.Replace(Find._str.ToString(), Rep._str))); }
/*public static GFileInfos[] Ls(GString Directory) { GFileInfos[] list; String[] files; files = Directory.GetFileSystemEntries(Directory); int filecount = files.GetUpperBound(0) + 1; int i = 0; while (i < filecount) { list[i] = files[i]; ++i; } return (list); }*/ public bool Mkdir(GString Dir) { bool test = true; try { Directory.CreateDirectory(System.IO.Path.Combine(this._directory.ToString(), Dir.ToString())); } catch { test = false; } return (test); }
public Boolean EndWith(GString str) { return(this._str.EndsWith(str._str)); }
public static Int32 Send(GISocket Socket, GString ToSend) { return(Socket.Send(ToSend)); }
public GString Remove(GString Str) { return(this.Replace(Str, "")); }
public Boolean EndWith(GString str) { return (this._str.EndsWith(str._str)); }
public GString Replace(GString Find, GString Rep, CaseOption op) { return (this._str.Replace(Find._str, Rep._str)); }
public GStringList Split(GString f, SplitOption splitop , CaseOption caseop) { GStringList vect = new GStringList(); if (this.Find(f, caseop) == -1) { vect.PushBack(this); return (vect); } int pos = 0, pos1 = 0, pos2 = 0; while (true) { pos1 = pos; pos = this.Find(f, pos, caseop); if (pos == -1) break; pos2 = pos; GString ne = this.Substr(pos1, pos2); if ((splitop == GString.SplitOption.SKIP_EMPTY_PARTS && ne.Size != 0) || splitop == G.GString.SplitOption.KEEP_EMPTY_PARTS) vect.PushBack(ne); pos += f.Size; } if (pos1 != 0) { GString ne = new GString (this.Substr(pos1, this.Size)); if ((splitop == G.GString.SplitOption.SKIP_EMPTY_PARTS && ne.Size != 0) || splitop == G.GString.SplitOption.KEEP_EMPTY_PARTS) vect.PushBack(ne); } return (vect); }
Int32 Find(GString f) { return(this._str.IndexOf(f._str)); }
public abstract void Initialize(GString Ip, Int32 Port);
public GStringList Explode(GString f, SplitOption splitop, CaseOption caseop) { return(this.Split(f, splitop, caseop)); }
public GVolumeInformations(GString Volume) { this._path = Volume; }
public GStringList Explode(GString f, SplitOption splitop, CaseOption caseop) { return (this.Split(f, splitop, caseop)); }
public GString Replace(GString Find, GString Rep, CaseOption op) { return(this._str.Replace(Find._str, Rep._str)); }
public abstract Int32 Send(GString Message);
Int32 Find(GString f) { return (this._str.IndexOf(f._str)); }
public Boolean Contain(GString s, CaseOption op) { if (op == CaseOption.CASE_SENSITIVE) return (this._str.Contains(s._str)); String news = this._str.ToLower(); s = s._str.ToLower(); return (this._str.Contains(s._str)); }