Ignore:
Timestamp:
Feb 22, 2015, 11:05:49 PM (9 years ago)
Author:
chronos
Message:
  • Remove: Trailing spaces from end of lines from all files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/FileStream.php

    r553 r815  
    77  private $Handle;
    88  private $FileName;
    9    
     9
    1010  function __construct()
    1111  {
    1212    $this->Handle = false;
    13   } 
    14    
    15   function __destruct() 
     13  }
     14
     15  function __destruct()
    1616  {
    1717    if($this->Handle)
    1818      fclose($this->Handle);
    1919  }
    20    
     20
    2121  public function OpenFile($FileName)
    2222  {
     
    2424    $this->CloseFile();
    2525    $this->Handle = fopen($FileName, 'rb');
    26     if(!$this->Handle) die(str_replace('%s', $FileName, FILE_NOT_FOUND)); 
     26    if(!$this->Handle) die(str_replace('%s', $FileName, FILE_NOT_FOUND));
    2727  }
    2828
     
    3232    $this->CloseFile();
    3333    $this->Handle = fopen($FileName, 'wb+');
    34     if(!$this->Handle) die(str_replace('%s', $FileName, FILE_NOT_FOUND)); 
     34    if(!$this->Handle) die(str_replace('%s', $FileName, FILE_NOT_FOUND));
    3535  }
    36  
     36
    3737  public function CloseFile()
    3838  {
    3939    if($this->Handle)
    40       fclose($this->Handle);   
     40      fclose($this->Handle);
    4141  }
    42    
     42
    4343  public function ReadBlock($Count)
    4444  {
    4545    return(fread($this->Handle, $Count));
    4646  }
    47  
     47
    4848  public function ReadByte()
    4949  {
    5050    return(fread($this->Handle, 1));
    51   } 
    52    
     51  }
     52
    5353  public function ReadUint()
    5454  {
     
    5656    return($val[1]);
    5757  }
    58    
     58
    5959  public function ReadInt()
    6060  {
    6161    $val = unpack('I*', fread($this->Handle, 4));
    6262    return($val[1]);
    63   } 
    64    
     63  }
     64
    6565  public function ReadFloat()
    6666  {
     
    6868    return($val[1]);
    6969  }
    70    
     70
    7171  public function ReadChar()
    7272  {
     
    7777  {
    7878    return(fgets($this->Handle));
    79   }   
     79  }
    8080
    8181  public function ReadTextLine()
    8282  {
    8383    return(fgets($this->Handle));
    84   }   
    85    
     84  }
     85
    8686  public function WriteBlock($Value, $Count)
    8787  {
    8888    fwrite($this->Handle, $Value, $Count);
    89   }       
    90    
     89  }
     90
    9191  public function WriteByte($Value)
    9292  {
    9393    fwrite($this->Handle, pack('C*', $Value), 1);
    94   } 
    95    
     94  }
     95
    9696  public function WriteUint($Value)
    9797  {
    9898    fwrite($this->Handle, pack('V*', $Value), 4);
    9999  }
    100    
     100
    101101  public function WriteInt($Value)
    102102  {
    103103    fwrite($this->Handle, pack('I*', $Value), 4);
    104   } 
    105    
     104  }
     105
    106106  public function WriteFloat($Value)
    107107  {
    108108    fwrite($this->Handle, pack('f*', $Value), 4);
    109109  }
    110    
     110
    111111  public function WriteChar($Value)
    112112  {
    113113    fwrite($this->Handle, $Value, 1);
    114   }   
    115  
     114  }
     115
    116116  public function WriteString($Value)
    117117  {
     
    128128    fseek($this->Handle, $Position, SEEK_SET);
    129129  }
    130  
     130
    131131  public function GetPosition()
    132132  {
    133133    return(ftell($this->Handle));
    134134  }
    135  
     135
    136136  public function GetSize()
    137137  {
Note: See TracChangeset for help on using the changeset viewer.