Ignore:
Timestamp:
05/26/15 16:13:47 (9 years ago)
Author:
rlacroix
Message:

Add the infrastructure to request fields from the server.

This will be used to read input files so add a new file attribute mode to define whether data is written or read from a file.

Currently the data is not actually read and random data is transfered for those fields in read mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c_attr/icfile_attr.cpp

    r591 r598  
    139139 
    140140 
     141  void cxios_set_file_mode(file_Ptr file_hdl, const char * mode, int mode_size) 
     142  { 
     143    std::string mode_str; 
     144    if (!cstr2string(mode, mode_size, mode_str)) return; 
     145    CTimer::get("XIOS").resume(); 
     146    file_hdl->mode.fromString(mode_str); 
     147    CTimer::get("XIOS").suspend(); 
     148  } 
     149 
     150  void cxios_get_file_mode(file_Ptr file_hdl, char * mode, int mode_size) 
     151  { 
     152    CTimer::get("XIOS").resume(); 
     153    if (!string_copy(file_hdl->mode.getInheritedStringValue(), mode, mode_size)) 
     154      ERROR("void cxios_get_file_mode(file_Ptr file_hdl, char * mode, int mode_size)", << "Input string is too short"); 
     155    CTimer::get("XIOS").suspend(); 
     156  } 
     157 
     158  bool cxios_is_defined_file_mode(file_Ptr file_hdl) 
     159  { 
     160     CTimer::get("XIOS").resume(); 
     161     bool isDefined = file_hdl->mode.hasInheritedValue(); 
     162     CTimer::get("XIOS").suspend(); 
     163     return isDefined; 
     164  } 
     165 
     166 
    141167  void cxios_set_file_name(file_Ptr file_hdl, const char * name, int name_size) 
    142168  { 
Note: See TracChangeset for help on using the changeset viewer.