Class: GeneratorCppBase

Inherits:
GeneratorBase show all
Defined in:
lib/metarecord/generator_base.rb

Instance Method Summary collapse

Methods inherited from GeneratorBase

#_append, _use_by_files, _use_by_models, #get_classname, #get_pluralized_name, #get_singular_name, #get_type, #get_value, #has_many, #has_one, #id_type, #indent, is_file_based?, #make_block, #null_id, #order_by, prepare, #property, #ptr_type, #reset, #resource_name, #should_generate_for, #should_generate_from_manifest, #should_skip_on_client?, sourcefile_to_destfile, #unindent, use, #visibility

Instance Method Details

#nativeTypeNameFor(type) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/metarecord/generator_base.rb', line 191

def nativeTypeNameFor type
  if type.class == Class
    case type.name
    when 'String'    then 'std::string'
    when 'ByteArray' then 'std::string'
    when 'Hash'      then 'DataTree'
    when 'DateTime'  then 'std::time_t'
    when 'Integer'   then 'int'
    when 'Float'     then 'float'
    when 'Boolean'   then 'bool'
    else type
    end
  else
    type
  end
end