Пример #1
0
 public StringInt(string name)
 {
     type        = matchType.named;
     this.number = -1;
     named       = name;
 }
Пример #2
0
        // Check switches and apply to global triggers.
        public static void checkSwitches(string[] args)
        {
            // Check for switches
            foreach (string arg in args)
            {
                if (arg == "/dir") create_dir = true;
                if (arg == "/truncate") truncate = true;
                if (arg == "/fullpath") full_path_output = true;
                if (arg == "/recursive") recursive_search = true;
                if (arg == "/overwrite") overwrite = true;
                if (arg == "/matchfilename") match = matchType.name;
                if (arg == "/force") force = true;
                if (arg == "/halt") halt = true;
                if (arg == "/dryrun") dryrun = true;
                if (arg == "/movelog") log_move = true;
                if (arg == "/movehashes") hash_move = true;
                if (arg == "/buildhashes") build_hashes = true;

                if (arg.StartsWith("/regexclude:"))
                {
                    rgx = true;
                    int i = arg.IndexOf(":");
                    rgx_patttern = arg.Substring(i + 1, arg.Length - i - 1);

                }
                if (arg.StartsWith("/purgesize:"))
                {
                    int i = arg.IndexOf(":");
                    string buffer = arg.Substring(i + 1, arg.Length - i - 1);
                    int size = 0;
                    if(Int32.TryParse(buffer, out size))
                    {
                        purge_size = size;
                    }
                }
                if (arg.StartsWith("/purgebacklog:"))
                {
                    int i = arg.IndexOf(":");
                    string buffer = arg.Substring(i + 1, arg.Length - i - 1);
                    int size = 0;
                    if (Int32.TryParse(buffer, out size))
                    {
                        purge_keep = size;
                    }
                }
                if (arg.StartsWith("/logsize:"))
                {
                    int i = arg.IndexOf(":");
                    string buffer = arg.Substring(i + 1, arg.Length - i - 1);
                    int size = 0;
                    if (Int32.TryParse(buffer, out size))
                    {
                        log_size = size;
                    }
                }
                if (arg.StartsWith("/logpath:"))
                {
                    int i = arg.IndexOf(":");
                    log_path = arg.Substring(i + 1, arg.Length - i - 1);
                }

            }
        }
Пример #3
0
 public StringInt(int number)
 {
     type        = matchType.numbered;
     this.number = number;
     named       = string.Empty;
 }
Пример #4
0
        public RegexSubstitute(Instruction instr)
        {
            PrimaryBlockPops =
                instr == Instruction.ReplaceRegexFirstPop ||
                instr == Instruction.ReplaceRegexAllPop ||
                instr == Instruction.ReplaceCsSubstrFirstPop ||
                instr == Instruction.ReplaceCsSubstrAllPop ||
                instr == Instruction.ReplaceCiSubstrFirstPop ||
                instr == Instruction.ReplaceCiSubstrAllPop;

            _firstMatchOnly =
                instr == Instruction.ReplaceRegexFirstPop ||
                instr == Instruction.ReplaceRegexFirstNoPop ||
                instr == Instruction.ReplaceCsSubstrFirstPop ||
                instr == Instruction.ReplaceCsSubstrFirstNoPop ||
                instr == Instruction.ReplaceCiSubstrFirstPop ||
                instr == Instruction.ReplaceCiSubstrFirstNoPop;

            _matchType =
                instr == Instruction.ReplaceRegexFirstPop ||
                instr == Instruction.ReplaceRegexFirstNoPop ||
                instr == Instruction.ReplaceRegexAllPop ||
                instr == Instruction.ReplaceRegexAllNoPop ? matchType.Regex :
                instr == Instruction.ReplaceCsSubstrFirstPop ||
                instr == Instruction.ReplaceCsSubstrFirstNoPop ||
                instr == Instruction.ReplaceCsSubstrAllPop ||
                instr == Instruction.ReplaceCsSubstrAllNoPop ? matchType.CaseSensitiveSubstring : matchType.CaseInsensitiveSubstring;
        }