Examples of OpenFile


Examples of de.chris_soft.fyllgen.menu.file.OpenFile

    // Familiendatei �ffnen.
    MenuItem openFile = new MenuItem(submenu, SWT.PUSH);
    openFile.setText("�&ffnen\tCtrl + O");
    openFile.setAccelerator(SWT.CONTROL + 'O');
    openFile.addListener(SWT.Selection, new OpenFile());

    new MenuItem(submenu, SWT.SEPARATOR);

    // Familiendatei speichern.
    MenuItem saveInKnownFile = new MenuItem(submenu, SWT.PUSH);
View Full Code Here

Examples of hidb2.gui.action.OpenFile

    drillDownAdapter.addNavigationActions(manager);
    }

  private void makeActions()
    {
    openAction = new OpenFile(_viewer);

    doubleClickAction = new OpenFile(_viewer);

    openIconAction = new OpenIcon(this);
    viewIconAction = new ViewIcon(this);
    addAsFolderAction = new AddAsFolder(this);
    addAsCardAction = new AddAsCard(this);
View Full Code Here

Examples of org.jruby.util.io.OpenFile

    protected void initSocket(Ruby runtime, ChannelDescriptor descriptor) {
        // make sure descriptor is registered
        registerDescriptor(descriptor);
       
        // continue with normal initialization
        openFile = new OpenFile();
       
        try {
            openFile.setMainStream(ChannelStream.fdopen(runtime, descriptor, new ModeFlags(ModeFlags.RDONLY)));
            openFile.setPipeStream(ChannelStream.fdopen(runtime, descriptor, new ModeFlags(ModeFlags.WRONLY)));
            openFile.getPipeStream().setSync(true);
View Full Code Here

Examples of org.jruby.util.io.OpenFile

    public IRubyObject recv(IRubyObject[] args) {
        return recv(getRuntime().getCurrentContext(), args);
    }
    @JRubyMethod(rest = true)
    public IRubyObject recv(ThreadContext context, IRubyObject[] args) {
        OpenFile openFile = getOpenFileChecked();
        try {
            return RubyString.newString(context.getRuntime(), openFile.getMainStream().read(RubyNumeric.fix2int(args[0])));
        } catch (BadDescriptorException e) {
            throw context.getRuntime().newErrnoEBADFError();
        } catch (EOFException e) {
            // recv returns nil on EOF
            return context.getRuntime().getNil();
View Full Code Here

Examples of org.jruby.util.io.OpenFile

       
        return this;
    }
   
    private void sysopenInternal(String path, ModeFlags modes, int perm) throws InvalidValueException {
        openFile = new OpenFile();
       
        openFile.setPath(path);
        openFile.setMode(modes.getOpenFileFlags());
       
        ChannelDescriptor descriptor = sysopen(path, modes, perm);
View Full Code Here

Examples of org.jruby.util.io.OpenFile

       
        registerDescriptor(descriptor);
    }
   
    private void openInternal(String path, String modeString) throws InvalidValueException {
        openFile = new OpenFile();

        openFile.setMode(getIOModes(getRuntime(), modeString).getOpenFileFlags());
        openFile.setPath(path);
        openFile.setMainStream(fopen(path, modeString));
       
View Full Code Here

Examples of org.jruby.util.io.OpenFile

     */
    @JRubyMethod(name = "ungetc", required = 1)
    public IRubyObject ungetc(IRubyObject number) {
        int ch = RubyNumeric.fix2int(number);
       
        OpenFile myOpenFile = getOpenFileChecked();
       
        if (!myOpenFile.isReadBuffered()) {
            throw getRuntime().newIOError("unread stream");
        }
       
        try {
            myOpenFile.checkReadable(getRuntime());
            myOpenFile.setReadBuffered();

            if (myOpenFile.getMainStream().ungetc(ch) == -1 && ch != -1) {
                throw getRuntime().newIOError("ungetc failed");
            }
        } catch (PipeException ex) {
            throw getRuntime().newErrnoEPIPEError();
        } catch (InvalidValueException ex) {
View Full Code Here

Examples of org.jruby.util.io.OpenFile

               
                buffer = str.getByteList();
                buffer.length(0);
            }
           
            OpenFile myOpenFile = getOpenFileChecked();
           
            myOpenFile.checkReadable(getRuntime());
           
            if (myOpenFile.getMainStream().readDataBuffered()) {
                throw getRuntime().newIOError("sysread for buffered IO");
            }
           
            // TODO: Ruby locks the string here
           
            context.getThread().beforeBlockingCall();
            myOpenFile.checkClosed(getRuntime());
           
            // TODO: Ruby re-checks that the buffer string hasn't been modified
           
            int bytesRead = myOpenFile.getMainStream().getDescriptor().read(len, str.getByteList());
           
            // TODO: Ruby unlocks the string here
           
            // TODO: Ruby truncates string to specific size here, but our bytelist should handle this already?
           
View Full Code Here

Examples of org.jruby.util.io.OpenFile

    }
   
    @JRubyMethod(name = "read")
    public IRubyObject read(ThreadContext context) {
        Ruby runtime = context.getRuntime();
        OpenFile myOpenFile = getOpenFileChecked();
       
        try {
            myOpenFile.checkReadable(runtime);
            myOpenFile.setReadBuffered();

            return readAll(getRuntime().getNil());
        } catch (PipeException ex) {
            throw getRuntime().newErrnoEPIPEError();
        } catch (InvalidValueException ex) {
View Full Code Here

Examples of org.jruby.util.io.OpenFile

    public IRubyObject read(ThreadContext context, IRubyObject arg0) {
        if (arg0.isNil()) {
            return read(context);
        }
       
        OpenFile myOpenFile = getOpenFileChecked();
       
        int length = RubyNumeric.num2int(arg0);
       
        if (length < 0) {
            throw getRuntime().newArgumentError("negative length " + length + " given");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.