summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/oprocess.h
Unidiff
Diffstat (limited to 'libopie2/opiecore/oprocess.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/oprocess.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h
index eb56b03..e23f98c 100644
--- a/libopie2/opiecore/oprocess.h
+++ b/libopie2/opiecore/oprocess.h
@@ -80,50 +80,50 @@ class OProcessPrivate;
80 *Since this signal is @em not emitted from within a UN*X 80 *Since this signal is @em not emitted from within a UN*X
81 *signal handler, arbitrary function calls can be made. 81 *signal handler, arbitrary function calls can be made.
82 * 82 *
83 *Be aware: When the OProcess objects gets destructed, the child 83 *Be aware: When the OProcess objects gets destructed, the child
84 *process will be killed if it is still running! 84 *process will be killed if it is still running!
85 *This means in particular, that you cannot use a OProcess on the stack 85 *This means in particular, that you cannot use a OProcess on the stack
86 *with OProcess::NotifyOnExit. 86 *with OProcess::NotifyOnExit.
87 * 87 *
88 *@li OProcess::Block -- The child process starts and the parent process 88 *@li OProcess::Block -- The child process starts and the parent process
89 *is suspended until the child process exits. (@em Really not recommended 89 *is suspended until the child process exits. (@em Really not recommended
90 *for programs with a GUI.) 90 *for programs with a GUI.)
91 * 91 *
92 *OProcess also provides several functions for determining the exit status 92 *OProcess also provides several functions for determining the exit status
93 *and the pid of the child process it represents. 93 *and the pid of the child process it represents.
94 * 94 *
95 *Furthermore it is possible to supply command-line arguments to the process 95 *Furthermore it is possible to supply command-line arguments to the process
96 *in a clean fashion (no null -- terminated stringlists and such...) 96 *in a clean fashion (no null -- terminated stringlists and such...)
97 * 97 *
98 *A small usage example: 98 *A small usage example:
99 *<pre> 99 *<pre>
100 *OProcess *proc = new OProcess; 100 *OProcess *proc = new OProcess;
101 * 101 *
102 **proc << "my_executable"; 102 **proc << "my_executable";
103 **proc << "These" << "are" << "the" << "command" << "line" << "args"; 103 **proc << "These" << "are" << "the" << "command" << "line" << "args";
104 *QApplication::connect(proc, SIGNAL(processExited(OProcess *)), 104 *QApplication::connect(proc, SIGNAL(processExited(Opie::Core::OProcess *)),
105 * pointer_to_my_object, SLOT(my_objects_slot(OProcess *))); 105 * pointer_to_my_object, SLOT(my_objects_slot(Opie::Core::OProcess *)));
106 *proc->start(); 106 *proc->start();
107 *</pre> 107 *</pre>
108 * 108 *
109 *This will start "my_executable" with the commandline arguments "These"... 109 *This will start "my_executable" with the commandline arguments "These"...
110 * 110 *
111 *When the child process exits, the respective Qt signal will be emitted. 111 *When the child process exits, the respective Qt signal will be emitted.
112 * 112 *
113 *@sect Communication with the child process 113 *@sect Communication with the child process
114 * 114 *
115 *OProcess supports communication with the child process through 115 *OProcess supports communication with the child process through
116 *stdin/stdout/stderr. 116 *stdin/stdout/stderr.
117 * 117 *
118 *The following functions are provided for getting data from the child 118 *The following functions are provided for getting data from the child
119 *process or sending data to the child's stdin (For more information, 119 *process or sending data to the child's stdin (For more information,
120 *have a look at the documentation of each function): 120 *have a look at the documentation of each function):
121 * 121 *
122 *@li bool @ref writeStdin(char *buffer, int buflen); 122 *@li bool @ref writeStdin(char *buffer, int buflen);
123 *@li -- Transmit data to the child process's stdin. 123 *@li -- Transmit data to the child process's stdin.
124 * 124 *
125 *@li bool @ref closeStdin(); 125 *@li bool @ref closeStdin();
126 *@li -- Closes the child process's stdin (which causes it to see an feof(stdin)). 126 *@li -- Closes the child process's stdin (which causes it to see an feof(stdin)).
127 *Returns false if you try to close stdin for a process that has been started 127 *Returns false if you try to close stdin for a process that has been started
128 *without a communication channel to stdin. 128 *without a communication channel to stdin.
129 * 129 *
@@ -459,106 +459,106 @@ public:
459 */ 459 */
460 static QString quote( const QString &arg ); 460 static QString quote( const QString &arg );
461 461
462 /** 462 /**
463 * Detaches OProcess from child process. All communication is closed. 463 * Detaches OProcess from child process. All communication is closed.
464 * No exit notification is emitted any more for the child process. 464 * No exit notification is emitted any more for the child process.
465 * Deleting the OProcess will no longer kill the child process. 465 * Deleting the OProcess will no longer kill the child process.
466 * Note that the current process remains the parent process of the 466 * Note that the current process remains the parent process of the
467 * child process. 467 * child process.
468 */ 468 */
469 void detach(); 469 void detach();
470 470
471 /** 471 /**
472 * @return the PID of @a process, or -1 if the process is not running 472 * @return the PID of @a process, or -1 if the process is not running
473 */ 473 */
474 static int processPID( const QString& process ); 474 static int processPID( const QString& process );
475 475
476signals: 476signals:
477 477
478 /** 478 /**
479 * Emitted after the process has terminated when 479 * Emitted after the process has terminated when
480 * the process was run in the @p NotifyOnExit (==default option to 480 * the process was run in the @p NotifyOnExit (==default option to
481 * @ref start()) or the @ref Block mode. 481 * @ref start()) or the @ref Block mode.
482 **/ 482 **/
483 void processExited( OProcess *proc ); 483 void processExited( Opie::Core::OProcess *proc );
484 484
485 485
486 /** 486 /**
487 * Emitted, when output from the child process has 487 * Emitted, when output from the child process has
488 * been received on stdout. 488 * been received on stdout.
489 * 489 *
490 * To actually get 490 * To actually get
491 * these signals, the respective communication link (stdout/stderr) 491 * these signals, the respective communication link (stdout/stderr)
492 * has to be turned on in @ref start(). 492 * has to be turned on in @ref start().
493 * 493 *
494 * @param buffer The data received. 494 * @param buffer The data received.
495 * @param buflen The number of bytes that are available. 495 * @param buflen The number of bytes that are available.
496 * 496 *
497 * You should copy the information contained in @p buffer to your private 497 * You should copy the information contained in @p buffer to your private
498 * data structures before returning from this slot. 498 * data structures before returning from this slot.
499 **/ 499 **/
500 void receivedStdout( OProcess *proc, char *buffer, int buflen ); 500 void receivedStdout( Opie::Core::OProcess *proc, char *buffer, int buflen );
501 501
502 /** 502 /**
503 * Emitted when output from the child process has 503 * Emitted when output from the child process has
504 * been received on stdout. 504 * been received on stdout.
505 * 505 *
506 * To actually get these signals, the respective communications link 506 * To actually get these signals, the respective communications link
507 * (stdout/stderr) has to be turned on in @ref start() and the 507 * (stdout/stderr) has to be turned on in @ref start() and the
508 * @p NoRead flag should have been passed. 508 * @p NoRead flag should have been passed.
509 * 509 *
510 * You will need to explicitly call resume() after your call to start() 510 * You will need to explicitly call resume() after your call to start()
511 * to begin processing data from the child process's stdout. This is 511 * to begin processing data from the child process's stdout. This is
512 * to ensure that this signal is not emitted when no one is connected 512 * to ensure that this signal is not emitted when no one is connected
513 * to it, otherwise this signal will not be emitted. 513 * to it, otherwise this signal will not be emitted.
514 * 514 *
515 * The data still has to be read from file descriptor @p fd. 515 * The data still has to be read from file descriptor @p fd.
516 **/ 516 **/
517 void receivedStdout( int fd, int &len ); 517 void receivedStdout( int fd, int &len );
518 518
519 519
520 /** 520 /**
521 * Emitted, when output from the child process has 521 * Emitted, when output from the child process has
522 * been received on stderr. 522 * been received on stderr.
523 * To actually get 523 * To actually get
524 * these signals, the respective communication link (stdout/stderr) 524 * these signals, the respective communication link (stdout/stderr)
525 * has to be turned on in @ref start(). 525 * has to be turned on in @ref start().
526 * 526 *
527 * @param buffer The data received. 527 * @param buffer The data received.
528 * @param buflen The number of bytes that are available. 528 * @param buflen The number of bytes that are available.
529 * 529 *
530 * You should copy the information contained in @p buffer to your private 530 * You should copy the information contained in @p buffer to your private
531 * data structures before returning from this slot. 531 * data structures before returning from this slot.
532 */ 532 */
533 void receivedStderr( OProcess *proc, char *buffer, int buflen ); 533 void receivedStderr( Opie::Core::OProcess *proc, char *buffer, int buflen );
534 534
535 /** 535 /**
536 * Emitted after all the data that has been 536 * Emitted after all the data that has been
537 * specified by a prior call to @ref writeStdin() has actually been 537 * specified by a prior call to @ref writeStdin() has actually been
538 * written to the child process. 538 * written to the child process.
539 **/ 539 **/
540 void wroteStdin( OProcess *proc ); 540 void wroteStdin( Opie::Core::OProcess *proc );
541 541
542protected slots: 542protected slots:
543 543
544 /** 544 /**
545 * This slot gets activated when data from the child's stdout arrives. 545 * This slot gets activated when data from the child's stdout arrives.
546 * It usually calls "childOutput" 546 * It usually calls "childOutput"
547 */ 547 */
548 void slotChildOutput( int fdno ); 548 void slotChildOutput( int fdno );
549 549
550 /** 550 /**
551 * This slot gets activated when data from the child's stderr arrives. 551 * This slot gets activated when data from the child's stderr arrives.
552 * It usually calls "childError" 552 * It usually calls "childError"
553 */ 553 */
554 void slotChildError( int fdno ); 554 void slotChildError( int fdno );
555 /* 555 /*
556 Slot functions for capturing stdout and stderr of the child 556 Slot functions for capturing stdout and stderr of the child
557 */ 557 */
558 558
559 /** 559 /**
560 * Called when another bulk of data can be sent to the child's 560 * Called when another bulk of data can be sent to the child's
561 * stdin. If there is no more data to be sent to stdin currently 561 * stdin. If there is no more data to be sent to stdin currently
562 * available, this function must disable the QSocketNotifier "innot". 562 * available, this function must disable the QSocketNotifier "innot".
563 */ 563 */
564 void slotSendData( int dummy ); 564 void slotSendData( int dummy );