1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
|
<html>
<head>
<title>Camstream: CamStream API documentation</title>
<link rel="stylesheet" href="../../tech.css" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>CFTPClient Class Reference</h1>A low-level, asynchronous FTP client based on RFC 959.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="_f_t_p_client_8h-source.html">FTPClient.h</a>></code>
<p>
<a href="class_c_f_t_p_client-members.html">List of all members.</a><h2>Public Types</h2>
<ul>
<li>enum <a class="el" href="class_c_f_t_p_client.html#w28">Commands</a> { <br>
<a class="el" href="class_c_f_t_p_client.html#w28w0">cmdNop</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w1">cmdLogin</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w2">cmdLogout</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w3">cmdSetType</a>,
<br>
<a class="el" href="class_c_f_t_p_client.html#w28w4">cmdChangeDir</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w5">cmdListDir</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w6">cmdUpload</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w7">cmdDownload</a>,
<br>
<a class="el" href="class_c_f_t_p_client.html#w28w8">cmdRename</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w9">cmdPassive</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w10">cmdDeleteLocalFile</a>,
<a class="el" href="class_c_f_t_p_client.html#w28w11">cmdDestroy</a>
<br>
}
<li>enum <a class="el" href="class_c_f_t_p_client.html#w29">States</a> { <br>
<a class="el" href="class_c_f_t_p_client.html#w29w12">stNOC</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w13">stDNSBusy</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w14">stConnecting</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w15">stConnected</a>,
<br>
<a class="el" href="class_c_f_t_p_client.html#w29w16">stLogin</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w17">stAuthenticate</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w18">stIdle</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w19">stSendingPort</a>,
<br>
<a class="el" href="class_c_f_t_p_client.html#w29w20">stWaitData</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w21">stTransfer</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w22">stClosingData</a>,
<a class="el" href="class_c_f_t_p_client.html#w29w23">stFailed</a>,
<br>
<a class="el" href="class_c_f_t_p_client.html#w29w24">stUnknown</a>
<br>
}
<li>enum <a class="el" href="class_c_f_t_p_client.html#w30">TransferMethods</a> { <a class="el" href="class_c_f_t_p_client.html#w30w25">tmUnknown</a>,
<a class="el" href="class_c_f_t_p_client.html#w30w26">tmAscii</a>,
<a class="el" href="class_c_f_t_p_client.html#w30w27">tmBinary</a>
}
</ul>
<h2>Signals</h2>
<ul>
<li>void <a class="el" href="class_c_f_t_p_client.html#l0">StateChange</a> (int command, int new_state, int result, const QString &server_msg)
<li>void <a class="el" href="class_c_f_t_p_client.html#l1">LoggedIn</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#l2">LoginFailed</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#l3">ControlPortClosed</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#l4">TimeOut</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#l5">ListDirEntry</a> (const QString &filename)
<li>void <a class="el" href="class_c_f_t_p_client.html#l6">Progress</a> (int offset)
</ul>
<h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="class_c_f_t_p_client.html#a0">CFTPClient</a> (QObject *parent=0, const char *name=0)
<li><a class="el" href="class_c_f_t_p_client.html#a1">~CFTPClient</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a2">SetLogging</a> (bool log)
<li>int <a class="el" href="class_c_f_t_p_client.html#a3">GetCommand</a> () const
<li>int <a class="el" href="class_c_f_t_p_client.html#a4">GetState</a> () const
<li>void <a class="el" href="class_c_f_t_p_client.html#a5">SetPassive</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a6">SetActive</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a7">Connect</a> (const QString &user, const QString &pass, const QString &server, int port=21)
<li>void <a class="el" href="class_c_f_t_p_client.html#a8">Upload</a> (const QString &local_file, const QString &remote_file=QString::null)
<li>void <a class="el" href="class_c_f_t_p_client.html#a9">SetTypeAscii</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a10">SetTypeBinary</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a11">ChangeDir</a> (const QString &new_dir)
<li>void <a class="el" href="class_c_f_t_p_client.html#a12">ListDir</a> ()
<li>void <a class="el" href="class_c_f_t_p_client.html#a13">Rename</a> (const QString &from, const QString &to)
<li>void <a class="el" href="class_c_f_t_p_client.html#a14">Logout</a> ()
<li>QString <a class="el" href="class_c_f_t_p_client.html#a15">GetErrorString</a> (int result) const
</ul>
<h2>Static Public Attributes</h2>
<ul>
<li>const char * <a class="el" href="class_c_f_t_p_client.html#s0">CommandStr</a> []
<li>const char * <a class="el" href="class_c_f_t_p_client.html#s1">StateStr</a> []
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A low-level, asynchronous FTP client based on RFC 959.
<p>
This class implements an FTP client. It allows the usual things done through FTP (uploading, downloading, dir-listing, etc), but at a very basic level.<p>
It may be a bit difficult to use, because it is so low level. It isn't as simple as "open ftp server, do dir-listing, upload file, close". All these functions are there, but they are asynchronuous. That is, they return immediately and don't wait for the end result. Nor can you queue commands: only one command can be executed at a time. This means you will have to do the high-level protocol stuff in your own class. On the other hand, it allows you to accurately follow the progress of your commands. Think of it as a wrapper around the FTP protocol itself, with some helper functions for the data transfers.<p>
With this class you have to make a distinction between 'commands' and 'state'. A command is just that: the user demands a certain action, and the class executes it. A string is sent to the FTP server to perform the command; if a data stream is needed that is opened as well.<p>
A command will cause various changes in the class that can be tracked through the ref StateChange signal. For example, uploading a file will cause the following states: SendingPort, WaitData, Transfer, ClosingData, Idle (or Failed). It reflects the various steps necessary by the FTP protocol to perform an actual filetransfer. It is up to the calling class to interpret these responses (most aren't really interesting to the user anyway).<p>
All commands will end in either "Idle" (== success) or "Failed" state. "Failed" indicates something went wrong; the <b>result</b> code from StateChange contains the numeric FTP response code that explains the error. "Idle", which also doubles as "Success", indicates completion of the command without error.<p>
Note that it is possible for a state to be set multiple times in a row. If, for example, Login was succesful and was followed by a "Change Dir" that also succeeds, StateChange will be emitted twice with state "Idle". This is okay; 2 commands were issued, so you get two <a class="el" href="class_c_f_t_p_client.html#l0">StateChange(Idle)</a> (possibly intermingled with other StateChange()s).<p>
Most commands listed below show a short state transition diagram, so you know what StateChange()s to expect.
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="w28" doxytag="CFTPClient::Commands" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="class_c_f_t_p_client.html#w28">CFTPClient::Commands</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="w28w0" doxytag="cmdNop" ></a>cmdNop</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w1" doxytag="cmdLogin" ></a>cmdLogin</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w2" doxytag="cmdLogout" ></a>cmdLogout</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w3" doxytag="cmdSetType" ></a>cmdSetType</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w4" doxytag="cmdChangeDir" ></a>cmdChangeDir</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w5" doxytag="cmdListDir" ></a>cmdListDir</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w6" doxytag="cmdUpload" ></a>cmdUpload</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w7" doxytag="cmdDownload" ></a>cmdDownload</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w8" doxytag="cmdRename" ></a>cmdRename</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w9" doxytag="cmdPassive" ></a>cmdPassive</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w10" doxytag="cmdDeleteLocalFile" ></a>cmdDeleteLocalFile</em> </td><td>
For destructive uploads. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w28w11" doxytag="cmdDestroy" ></a>cmdDestroy</em> </td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="w29" doxytag="CFTPClient::States" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="class_c_f_t_p_client.html#w29">CFTPClient::States</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="w29w12" doxytag="stNOC" ></a>stNOC</em> </td><td>
Not connected. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w13" doxytag="stDNSBusy" ></a>stDNSBusy</em> </td><td>
Looking up hostname... </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w14" doxytag="stConnecting" ></a>stConnecting</em> </td><td>
Busy connecting to server. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w15" doxytag="stConnected" ></a>stConnected</em> </td><td>
Server reached; awaiting response from FTP daemon. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w16" doxytag="stLogin" ></a>stLogin</em> </td><td>
Sending username. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w17" doxytag="stAuthenticate" ></a>stAuthenticate</em> </td><td>
Sending password. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w18" doxytag="stIdle" ></a>stIdle</em> </td><td>
Connected OK, but not doing anything. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w19" doxytag="stSendingPort" ></a>stSendingPort</em> </td><td>
Sending PORT command to remote end. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w20" doxytag="stWaitData" ></a>stWaitData</em> </td><td>
Waiting for data connection. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w21" doxytag="stTransfer" ></a>stTransfer</em> </td><td>
Transfering data. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w22" doxytag="stClosingData" ></a>stClosingData</em> </td><td>
Waiting for 226. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w23" doxytag="stFailed" ></a>stFailed</em> </td><td>
Failed status; can happen at every command. </td></tr>
<tr><td valign=top><em><a class="anchor" name="w29w24" doxytag="stUnknown" ></a>stUnknown</em> </td><td>
Unkown or unexpected result code. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="w30" doxytag="CFTPClient::TransferMethods" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum <a class="el" href="class_c_f_t_p_client.html#w30">CFTPClient::TransferMethods</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a class="anchor" name="w30w25" doxytag="tmUnknown" ></a>tmUnknown</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w30w26" doxytag="tmAscii" ></a>tmAscii</em> </td><td>
</td></tr>
<tr><td valign=top><em><a class="anchor" name="w30w27" doxytag="tmBinary" ></a>tmBinary</em> </td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="CFTPClient::CFTPClient" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> CFTPClient::CFTPClient </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">QObject * </td>
<td class="mdname" nowrap> <em>parent</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>name</em> = <code>0</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="CFTPClient::~CFTPClient" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> CFTPClient::~<a class="el" href="class_c_f_t_p_client.html">CFTPClient</a> </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a11" doxytag="CFTPClient::ChangeDir" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::ChangeDir </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const QString & </td>
<td class="mdname1" valign="top" nowrap> <em>new_dir</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Change to remote directory on server.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="CFTPClient::Connect" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::Connect </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const QString & </td>
<td class="mdname" nowrap> <em>user</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const QString & </td>
<td class="mdname" nowrap> <em>pass</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const QString & </td>
<td class="mdname" nowrap> <em>server</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>port</em> = <code>21</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Initiate connection to FTP server.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>user</em> </td><td>The username </td></tr>
<tr><td></td><td valign=top><em>pass</em> </td><td>The password </td></tr>
<tr><td></td><td valign=top><em>server</em> </td><td>The server name </td></tr>
<tr><td></td><td valign=top><em>port</em> </td><td>Port number on the server</td></tr>
</table>
</dl>
This function initiates a connection to the server. Since Qt provides asynchronuous DNS lookups, we don't even block here. However, that means we are not connected yet when this function returns. </td>
</tr>
</table>
<a class="anchor" name="l3" doxytag="CFTPClient::ControlPortClosed" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::ControlPortClosed </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Emitted when the control connection was closed (either by us or the remote party).
<p>
</td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="CFTPClient::GetCommand" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int CFTPClient::GetCommand </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a15" doxytag="CFTPClient::GetErrorString" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> QString CFTPClient::GetErrorString </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>result</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a4" doxytag="CFTPClient::GetState" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int CFTPClient::GetState </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a12" doxytag="CFTPClient::ListDir" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::ListDir </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
List contents of remote directory.
<p>
This command will retrieve the list of filenames of the directory on the remote server. The found files are emitted one by one through <a class="el" href="class_c_f_t_p_client.html#l5">ListDirEntry</a>(const QString &filename).<p>
Note: make sure you set the transfer type to ASCII first. </td>
</tr>
</table>
<a class="anchor" name="l5" doxytag="CFTPClient::ListDirEntry" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::ListDirEntry </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const QString & </td>
<td class="mdname1" valign="top" nowrap> <em>filename</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="l1" doxytag="CFTPClient::LoggedIn" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::LoggedIn </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Emitted when login was succesfull.
<p>
</td>
</tr>
</table>
<a class="anchor" name="l2" doxytag="CFTPClient::LoginFailed" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::LoginFailed </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Emitted when login failed.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a14" doxytag="CFTPClient::Logout" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::Logout </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="l6" doxytag="CFTPClient::Progress" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::Progress </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>offset</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Emitted every now and then to report on progress. Reports total amount of bytes transfered so far.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a13" doxytag="CFTPClient::Rename" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::Rename </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const QString & </td>
<td class="mdname" nowrap> <em>from</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const QString & </td>
<td class="mdname" nowrap> <em>to</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Rename a file on the server.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>from</em> </td><td>The existing filename </td></tr>
<tr><td></td><td valign=top><em>to</em> </td><td>The new filename</td></tr>
</table>
</dl>
This command will instruct the FTP server to rename a file on the remote filesystem. A rename across directories (effectively moving the file) may be possible. A rename across filesystems most likely is not. </td>
</tr>
</table>
<a class="anchor" name="a6" doxytag="CFTPClient::SetActive" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::SetActive </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Turns off passive mode; see <a class="el" href="class_c_f_t_p_client.html#a5">SetPassive</a>.
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="CFTPClient::SetLogging" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::SetLogging </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">bool </td>
<td class="mdname1" valign="top" nowrap> <em>log</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a5" doxytag="CFTPClient::SetPassive" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::SetPassive </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Set transfer mode to passive.
<p>
Usually FTP transfers (both up- and downloads) are initiated by the server, after the command has been sent by the client. However, this does not always work (firewalls, braindead FTP implementations, etc) and the client has to do the work; this is called 'passive mode', and this function turns this mode on.<p>
Note: this function does not trigger a state change. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="CFTPClient::SetTypeAscii" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::SetTypeAscii </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a10" doxytag="CFTPClient::SetTypeBinary" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::SetTypeBinary </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="l0" doxytag="CFTPClient::StateChange" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::StateChange </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>command</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>new_state</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname" nowrap> <em>result</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const QString & </td>
<td class="mdname" nowrap> <em>server_msg</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
This signal is emitted whenever the internal state machine changes. The result is the numeric FTP result code, if known. There are however a few extra 'result' codes defined, for situations that do not apply to FTP servers:<p>
800 Local file not found (upload) 810 Server name not resolved 811 Failed to connect to server </td>
</tr>
</table>
<a class="anchor" name="l4" doxytag="CFTPClient::TimeOut" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::TimeOut </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [signal]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="CFTPClient::Upload" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void CFTPClient::Upload </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const QString & </td>
<td class="mdname" nowrap> <em>local_file</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>const QString & </td>
<td class="mdname" nowrap> <em>remote_file</em> = <code>QString::null</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Upload file to remote site.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>local_file</em> </td><td>The filename on the local machine </td></tr>
<tr><td></td><td valign=top><em>remote_file</em> </td><td>The filename on the remote machine; if not present, the same as local_file </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="s0" doxytag="CFTPClient::CommandStr" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const char * <a class="el" href="class_c_f_t_p_client.html#s0">CFTPClient::CommandStr</a><code> [static]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Initial value:</b><pre class="fragment"><div>
{
<span class="stringliteral">"Nop"</span>,
<span class="stringliteral">"Login"</span>,
<span class="stringliteral">"Logout"</span>,
<span class="stringliteral">"SetType"</span>,
<span class="stringliteral">"ChangeDir"</span>,
<span class="stringliteral">"ListDir"</span>,
<span class="stringliteral">"Upload"</span>,
<span class="stringliteral">"Download"</span>,
<span class="stringliteral">"Rename"</span>,
<span class="stringliteral">"Passive"</span>,
<span class="stringliteral">"DeleteLocalFile"</span>,
<span class="stringliteral">"Destroy"</span>,
}
</div></pre> </td>
</tr>
</table>
<a class="anchor" name="s1" doxytag="CFTPClient::StateStr" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const char * <a class="el" href="class_c_f_t_p_client.html#s1">CFTPClient::StateStr</a><code> [static]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<b>Initial value:</b><pre class="fragment"><div>
{
<span class="stringliteral">"NOC"</span>,
<span class="stringliteral">"Resolving servername"</span>,
<span class="stringliteral">"Connecting"</span>,
<span class="stringliteral">"Connected"</span>,
<span class="stringliteral">"Login"</span>,
<span class="stringliteral">"Authenticate"</span>,
<span class="stringliteral">"Idle"</span>,
<span class="stringliteral">"SendingPort"</span>,
<span class="stringliteral">"WaitData"</span>,
<span class="stringliteral">"Transfer"</span>,
<span class="stringliteral">"ClosingData"</span>,
<span class="stringliteral">"Failed"</span>,
<span class="stringliteral">"Unknown"</span>,
}
</div></pre> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_f_t_p_client_8h-source.html">FTPClient.h</a><li><a class="el" href="_f_t_p_client_8cc.html">FTPClient.cc</a><li><a class="el" href="_f_t_p_client_8moc_8cpp.html">FTPClient.moc.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Wed Dec 13 23:38:47 2006 for CamStream by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
</body>
</html>
|