 |
Changeset 3346
- Timestamp:
- 03/13/08 04:34:07
(9 months ago)
- Author:
- lmartin92
- Message:
Minor updates to FtpFolder?. Fixed some code and some comments and some constructors. Minor updates to FtpClient?. Fixed up some comments for code developed into it.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3345 |
r3346 |
|
| 40 | 40 | *******************************************************************************/ |
|---|
| 41 | 41 | |
|---|
| 42 | | class FtpFolder : VfsFolder //finished |
|---|
| | 42 | class FtpFolder : VfsFolder |
|---|
| 43 | 43 | { |
|---|
| 44 | 44 | char[] _name, |
|---|
| … | … | |
| 279 | 279 | { |
|---|
| 280 | 280 | _primaryFolders = fols; |
|---|
| | 281 | foreach(folder; fols) |
|---|
| | 282 | { |
|---|
| | 283 | _primaryFolders ~= new FtpFolder(folder); |
|---|
| | 284 | } |
|---|
| 281 | 285 | populateFolders(false); |
|---|
| 282 | 286 | } |
|---|
| … | … | |
| 284 | 288 | package this(FtpFolder fol, bool flat) |
|---|
| 285 | 289 | { |
|---|
| 286 | | _ftpFol = new FtpFolder(fol); |
|---|
| 287 | | _primaryFolders ~= fol; |
|---|
| | 290 | _primaryFolders ~= new FtpFolder(fol); |
|---|
| 288 | 291 | _flat = flat; |
|---|
| 289 | 292 | populateFolders(false); |
|---|
| … | … | |
| 331 | 334 | else |
|---|
| 332 | 335 | _foldersPopulated = true; |
|---|
| | 336 | for(int i = 0; i < _folders.length; i++) |
|---|
| | 337 | { |
|---|
| | 338 | for(int j = 0; j < _folders.length; j++) |
|---|
| | 339 | { |
|---|
| | 340 | if(_folders[i] == _folders[j]) |
|---|
| | 341 | { |
|---|
| | 342 | FtpFolder[] temp = _folders.dup; |
|---|
| | 343 | _folders[0..j] = temp[0..j].dup; |
|---|
| | 344 | _folders[j..$] = temp[j..$].dup; |
|---|
| | 345 | } |
|---|
| | 346 | } |
|---|
| | 347 | } |
|---|
| 333 | 348 | } |
|---|
| 334 | 349 | |
|---|
| … | … | |
| 585 | 600 | istream.read(dest); |
|---|
| 586 | 601 | os.write(dest); |
|---|
| 587 | | return new FtpFile(this, _toString); |
|---|
| | 602 | return new FtpFile(_folder, _toString); |
|---|
| 588 | 603 | } |
|---|
| 589 | 604 | |
|---|
| … | … | |
| 598 | 613 | copy(source); |
|---|
| 599 | 614 | source.remove(); |
|---|
| 600 | | return new FtpFile(this, _toString); |
|---|
| | 615 | return new FtpFile(_folder, _toString); |
|---|
| 601 | 616 | } |
|---|
| 602 | 617 | |
|---|
| … | … | |
| 656 | 671 | ***********************************************************************/ |
|---|
| 657 | 672 | |
|---|
| 658 | | //cant work until I make new FtpClient |
|---|
| 659 | 673 | InputStream input () |
|---|
| 660 | 674 | { |
|---|
| … | … | |
| 670 | 684 | ***********************************************************************/ |
|---|
| 671 | 685 | |
|---|
| 672 | | //cant work until I make new FtpClient |
|---|
| 673 | 686 | OutputStream output () |
|---|
| 674 | 687 | { |
|---|
| r3137 |
r3346 |
|
| 40 | 40 | private import Ascii = tango.text.Ascii; |
|---|
| 41 | 41 | |
|---|
| 42 | | private import tango.text.Regex : Regex; |
|---|
| | 42 | private import Regex = tango.text.Regex; |
|---|
| 43 | 43 | |
|---|
| 44 | 44 | private import Integer = tango.text.convert.Integer; |
|---|
| … | … | |
| 801 | 801 | |
|---|
| 802 | 802 | // Try to pull out the (possibly not parenthesized) address. |
|---|
| 803 | | auto r = Regex(`\([^0-9][^0-9][^0-9](\d+)[^0-9]\)`).search(response.message); |
|---|
| | 803 | auto r = Regex.search(response.message, `\([^0-9][^0-9][^0-9](\d+)[^0-9]\)`); |
|---|
| 804 | 804 | if (r is null) |
|---|
| 805 | 805 | throw new FTPException("CLIENT: Unable to parse address", "501"); |
|---|
| … | … | |
| 819 | 819 | |
|---|
| 820 | 820 | // Try to pull out the (possibly not parenthesized) address. |
|---|
| 821 | | auto r = Regex(`(\d+),\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)(,\s*(\d+))?`).search(response.message); |
|---|
| | 821 | auto r = Regex.search(response.message, `(\d+),\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d+)(,\s*(\d+))?`); |
|---|
| 822 | 822 | if (r is null) |
|---|
| 823 | 823 | throw new FTPException("CLIENT: Unable to parse address", "501"); |
|---|
| … | … | |
| 1343 | 1343 | |
|---|
| 1344 | 1344 | // The order is 1 MM, 2 DD, 3 YY, 4 HH, 5 MM, 6 P |
|---|
| 1345 | | auto r = Regex(`(\d\d)-(\d\d)-(\d\d)\s+(\d\d):(\d\d)(A|P)M`).search(line); |
|---|
| | 1345 | auto r = Regex.search(line, `(\d\d)-(\d\d)-(\d\d)\s+(\d\d):(\d\d)(A|P)M`); |
|---|
| 1346 | 1346 | if (r is null) |
|---|
| 1347 | 1347 | return info; |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic