Example #1
0
  public static void __hx_ctor(
      sys.io.Process __temp_me13, java.lang.String cmd, haxe.root.Array<java.lang.String> args) {
    java.lang.String[] pargs = new java.lang.String[((int) ((args.length + 1)))];
    pargs[0] = cmd;
    {
      int _g1 = 0;
      int _g = args.length;
      while ((_g1 < _g)) {
        int i = _g1++;
        pargs[(i + 1)] = args.__get(i);
      }
    }

    try {
      __temp_me13.proc = new java.lang.ProcessBuilder(((java.lang.String[]) (pargs))).start();
    } catch (java.lang.Throwable __temp_catchallException113) {
      java.lang.Object __temp_catchall114 = __temp_catchallException113;
      if ((__temp_catchall114 instanceof haxe.lang.HaxeException)) {
        __temp_catchall114 = ((haxe.lang.HaxeException) (__temp_catchallException113)).obj;
      }

      {
        java.lang.Object e = __temp_catchall114;
        throw haxe.lang.HaxeException.wrap(e);
      }
    }

    java.lang.Process p = __temp_me13.proc;
    __temp_me13.stderr =
        new sys.io._Process.ProcessInput(((java.io.InputStream) (p.getErrorStream())));
    __temp_me13.stdout =
        new sys.io._Process.ProcessInput(((java.io.InputStream) (p.getInputStream())));
    __temp_me13.stdin =
        new haxe.java.io.NativeOutput(((java.io.OutputStream) (p.getOutputStream())));
  }
Example #2
0
  public static java.lang.Object handleGetField(
      java.lang.String str, java.lang.String f, boolean throwErrors) {
    {
      java.lang.String __temp_svar48 = (f);
      int __temp_hash50 = __temp_svar48.hashCode();
      boolean __temp_executeDef49 = true;
      switch (__temp_hash50) {
        case -1106363674:
          {
            if (__temp_svar48.equals("length")) {
              __temp_executeDef49 = false;
              return str.length();
            }

            break;
          }

        case 530542161:
        case -891529231:
        case 109648666:
        case -467511597:
        case 1943291465:
        case 397153782:
        case -1361633751:
        case -1137582698:
        case -399551817:
          {
            if (((((__temp_hash50 == 530542161) && __temp_svar48.equals("substring")))
                || ((((__temp_hash50 == -891529231) && __temp_svar48.equals("substr")))
                    || ((((__temp_hash50 == 109648666) && __temp_svar48.equals("split")))
                        || ((((__temp_hash50 == -467511597) && __temp_svar48.equals("lastIndexOf")))
                            || ((((__temp_hash50 == 1943291465) && __temp_svar48.equals("indexOf")))
                                || ((((__temp_hash50 == 397153782)
                                        && __temp_svar48.equals("charCodeAt")))
                                    || ((((__temp_hash50 == -1361633751)
                                            && __temp_svar48.equals("charAt")))
                                        || ((((__temp_hash50 == -1137582698)
                                                && __temp_svar48.equals("toLowerCase")))
                                            || __temp_svar48.equals("toUpperCase")))))))))) {
              __temp_executeDef49 = false;
              return new haxe.lang.Closure(
                  ((java.lang.Object) (str)), haxe.lang.Runtime.toString(f));
            }

            break;
          }
      }

      if (__temp_executeDef49) {
        if (throwErrors) {
          throw haxe.lang.HaxeException.wrap((("Field not found: \'" + f) + "\' in String"));
        } else {
          return null;
        }

      } else {
        throw null;
      }
    }
  }
Example #3
0
  public int exitCode() {
    (((sys.io._Process.ProcessInput) (this.stdout))).bufferContents();
    (((sys.io._Process.ProcessInput) (this.stderr))).bufferContents();
    try {
      this.proc.waitFor();
    } catch (java.lang.Throwable __temp_catchallException108) {
      java.lang.Object __temp_catchall109 = __temp_catchallException108;
      if ((__temp_catchall109 instanceof haxe.lang.HaxeException)) {
        __temp_catchall109 = ((haxe.lang.HaxeException) (__temp_catchallException108)).obj;
      }

      {
        java.lang.Object e = __temp_catchall109;
        throw haxe.lang.HaxeException.wrap(e);
      }
    }

    return this.proc.exitValue();
  }
Example #4
0
  public static haxe.root.Date fromString(java.lang.String s, java.lang.Object isUtc) {
    boolean __temp_isUtc6 =
        (((isUtc == null)) ? (haxe.lang.Runtime.toBool(false)) : (haxe.lang.Runtime.toBool(isUtc)));
    int _g = s.length();
    switch (_g) {
      case 8:
        {
          haxe.root.Array<java.lang.String> k = haxe.lang.StringExt.split(s, ":");
          if (__temp_isUtc6) {
            return haxe.root.Date.fromUTC(
                0,
                0,
                1,
                haxe.root.Std.parseInt(k.__get(0)),
                haxe.root.Std.parseInt(k.__get(1)),
                haxe.root.Std.parseInt(k.__get(2)),
                null);
          } else {
            return new haxe.root.Date(
                ((int) (0)),
                ((int) (0)),
                ((int) (1)),
                ((java.lang.Object) (haxe.root.Std.parseInt(k.__get(0)))),
                ((java.lang.Object) (haxe.root.Std.parseInt(k.__get(1)))),
                ((java.lang.Object) (haxe.root.Std.parseInt(k.__get(2)))),
                ((java.lang.Object) (null)));
          }
        }

      case 10:
        {
          haxe.root.Array<java.lang.String> k = haxe.lang.StringExt.split(s, "-");
          if (__temp_isUtc6) {
            return haxe.root.Date.fromUTC(
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(0))))),
                (((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(1)))))
                    - ((int) (1))),
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(2))))),
                null,
                null,
                null,
                null);
          } else {
            return new haxe.root.Date(
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(0))))),
                ((int)
                    ((((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(1)))))
                        - ((int) (1))))),
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(k.__get(2))))),
                ((java.lang.Object) (null)),
                ((java.lang.Object) (null)),
                ((java.lang.Object) (null)),
                ((java.lang.Object) (null)));
          }
        }

      case 19:
        {
          haxe.root.Array<java.lang.String> k = haxe.lang.StringExt.split(s, " ");
          haxe.root.Array<java.lang.String> y = haxe.lang.StringExt.split(k.__get(0), "-");
          haxe.root.Array<java.lang.String> t = haxe.lang.StringExt.split(k.__get(1), ":");
          if (__temp_isUtc6) {
            return haxe.root.Date.fromUTC(
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(0))))),
                (((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(1)))))
                    - ((int) (1))),
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(2))))),
                haxe.root.Std.parseInt(t.__get(0)),
                haxe.root.Std.parseInt(t.__get(1)),
                haxe.root.Std.parseInt(t.__get(2)),
                null);
          } else {
            return new haxe.root.Date(
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(0))))),
                ((int)
                    ((((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(1)))))
                        - ((int) (1))))),
                ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(y.__get(2))))),
                ((java.lang.Object) (haxe.root.Std.parseInt(t.__get(0)))),
                ((java.lang.Object) (haxe.root.Std.parseInt(t.__get(1)))),
                ((java.lang.Object) (haxe.root.Std.parseInt(t.__get(2)))),
                ((java.lang.Object) (null)));
          }
        }

      default:
        {
          throw haxe.lang.HaxeException.wrap(("Invalid date format : " + s));
        }
    }
  }