Beispiel #1
0
        public static GString operator +(GString s1, GString s2)
        {
            GString s = new GString();

            s._str = s1._str + s2._str;
            return(s);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public static bool IsDirectory(GString Dir)
 {
     if (Directory.Exists(Dir.ToString()))
     {
         return(true);
     }
     return(false);
 }
Beispiel #4
0
 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);
 }
Beispiel #7
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));
 }
Beispiel #8
0
        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);
 }
Beispiel #10
0
 public static bool Touch(GString FileName)
 {
     Boolean test = true;
     try
     {
         File.Create(FileName);
     }
     catch
     {
         test = false;
     }
     return (test);
 }
Beispiel #11
0
 public static Boolean Rmdir(GString Dir, bool Recursif)
 {
     Boolean test = true;
     try
     {
         Directory.Delete(Dir.ToString(), Recursif);
     }
     catch
     {
         test = false;
     }
     return (test);
 }
Beispiel #12
0
        public static bool Touch(GString FileName)
        {
            Boolean test = true;

            try
            {
                File.Create(FileName);
            }
            catch
            {
                test = false;
            }
            return(test);
        }
Beispiel #13
0
        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);
        }
Beispiel #14
0
 public bool Cd(GString Dir)
 {
     bool test = true;
     try
     {
         Directory.SetCurrentDirectory(Dir.ToString());
         this._directory = Directory.GetCurrentDirectory();
     }
     catch
     {
         test = false;
     }
     return (test);
 }
Beispiel #15
0
        public static Boolean  Rename(GString f1, GString f2)
        {
            Boolean test = true;

            try
            {
                Directory.Move(f1.ToString(), f2.ToString());
            }
            catch
            {
                test = false;
            }
            return(test);
        }
Beispiel #16
0
        public static Boolean  Rmdir(GString Dir, bool Recursif)
        {
            Boolean test = true;

            try
            {
                Directory.Delete(Dir.ToString(), Recursif);
            }
            catch
            {
                test = false;
            }
            return(test);
        }
Beispiel #17
0
        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);
        }
Beispiel #18
0
        public bool         Cd(GString Dir)
        {
            bool test = true;

            try
            {
                Directory.SetCurrentDirectory(Dir.ToString());
                this._directory = Directory.GetCurrentDirectory();
            }
            catch
            {
                test = false;
            }
            return(test);
        }
Beispiel #19
0
        public Boolean      Rmdir(bool Recursif)
        {
            Boolean test = true;

            try
            {
                Directory.Delete(this._directory.ToString(), Recursif);
                this._directory = Directory.GetCurrentDirectory();
            }
            catch
            {
                test = false;
            }
            return(test);
        }
Beispiel #20
0
 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);
 }
Beispiel #21
0
        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);
        }
Beispiel #22
0
 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);
 }
Beispiel #23
0
        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);
        }
Beispiel #24
0
        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);
        }
Beispiel #25
0
 public GStringList Split(GString f)
 {
     return(this.Split(f, G.GString.SplitOption.SKIP_EMPTY_PARTS, G.GString.CaseOption.CASE_SENSITIVE));
 }
Beispiel #26
0
 public GString  Insert(Int32 StartIndex, GString str)
 {
     return(this._str.Insert(StartIndex, str._str));
 }
Beispiel #27
0
 public GString Remove(GString Str)
 {
     return (this.Replace(Str, ""));
 }
Beispiel #28
0
 public Boolean      StartWith(GString str)
 {
     return(this._str.StartsWith(str._str));
 }
Beispiel #29
0
 public GString Replace(GString Find, GString Rep)
 {
     return (new GString(this._str.Replace(Find._str.ToString(), Rep._str)));
 }
Beispiel #30
0
 public GString(GString g)
 {
     this._str = g._str;
 }
Beispiel #31
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));
 }
Beispiel #32
0
 public bool Rmpath(GString Path)
 {
     return (true);
 }
Beispiel #33
0
 public GDirectory()
 {
     this._directory = Directory.GetCurrentDirectory();
 }
Beispiel #34
0
 public Boolean Rmdir(bool Recursif)
 {
     Boolean test = true;
     try
     {
         Directory.Delete(this._directory.ToString(), Recursif);
         this._directory = Directory.GetCurrentDirectory();
     }
     catch
     {
         test = false;
     }
     return (test);
 }
Beispiel #35
0
 public Boolean Compare(GString str)
 {
     if (str._str == this._str)
         return (true);
     return (false);
 }
Beispiel #36
0
 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);
 }
Beispiel #37
0
 public GString Insert(Int32 StartIndex, GString str)
 {
     return (this._str.Insert(StartIndex, str._str));
 }
Beispiel #38
0
 public Boolean StartWith(GString str)
 {
     return (this._str.StartsWith(str._str));
 }
Beispiel #39
0
 public static Int32 Send(GISocket Socket, GString ToSend)
 {
     return (Socket.Send(ToSend));
 }
Beispiel #40
0
 public GStringList Split(GString f)
 {
     return (this.Split(f, G.GString.SplitOption.SKIP_EMPTY_PARTS, G.GString.CaseOption.CASE_SENSITIVE));
 }
Beispiel #41
0
 public GString Replace(GString Find, GString Rep)
 {
     return(new GString(this._str.Replace(Find._str.ToString(), Rep._str)));
 }
Beispiel #42
0
 /*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);
 }
Beispiel #43
0
 public Boolean      EndWith(GString str)
 {
     return(this._str.EndsWith(str._str));
 }
Beispiel #44
0
 public static Int32        Send(GISocket Socket, GString ToSend)
 {
     return(Socket.Send(ToSend));
 }
Beispiel #45
0
 public GString Remove(GString Str)
 {
     return(this.Replace(Str, ""));
 }
Beispiel #46
0
 public Boolean EndWith(GString str)
 {
     return (this._str.EndsWith(str._str));
 }
Beispiel #47
0
 public GString Replace(GString Find, GString Rep, CaseOption op)
 {
     return (this._str.Replace(Find._str, Rep._str));
 }
Beispiel #48
0
 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);
 }
Beispiel #49
0
 Int32 Find(GString f)
 {
     return(this._str.IndexOf(f._str));
 }
Beispiel #50
0
 public abstract void    Initialize(GString Ip, Int32 Port);
Beispiel #51
0
 public GStringList Explode(GString f, SplitOption splitop, CaseOption caseop)
 {
     return(this.Split(f, splitop, caseop));
 }
 public GVolumeInformations(GString Volume)
 {
     this._path = Volume;
 }
Beispiel #53
0
 public GString(GString g)
 {
     this._str = g._str;
 }
 public abstract void Initialize(GString Ip, Int32 Port);
Beispiel #55
0
 public GStringList Explode(GString f, SplitOption splitop, CaseOption caseop)
 {
     return (this.Split(f, splitop, caseop));
 }
Beispiel #56
0
 public GString Replace(GString Find, GString Rep, CaseOption op)
 {
     return(this._str.Replace(Find._str, Rep._str));
 }
Beispiel #57
0
 public abstract Int32 Send(GString Message);
Beispiel #58
0
 Int32 Find(GString f)
 {
     return (this._str.IndexOf(f._str));
 }
Beispiel #59
0
 public abstract Int32       Send(GString Message);
Beispiel #60
0
 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));
 }