예제 #1
0
파일: TypeMapper.cs 프로젝트: m039/SharpCpp
        public string ValueOf(YType type)
        {
            string include;

            if (type == YType.Int)
            {
                include = _includeFinder.FindInclude("int32_t");
                if (include != null)
                {
                    _includes.Add(include);
                    return("int32_t");
                }

                return("int");
            }
            else if (type == YType.Void)
            {
                return("void");
            }
            else if (type is YRefType)
            {
                var name = ((YRefType)type).Name;

                include = _includeFinder.FindInclude("shared_ptr");
                if (include != null)
                {
                    _includes.Add(include);

                    include = _includeFinder.FindInclude(name);
                    if (include != null)
                    {
                        _includes.Add(include);
                        return($"std::shared_ptr<{name}>");
                    }
                }

                throw new TException("Can't find include for referenced type");
            }

            throw new TException("Unsupported type");
        }
예제 #2
0
파일: YParameter.cs 프로젝트: m039/SharpCpp
 public YParameter(string name, YType type)
 {
     Name = name;
     Type = type;
 }
예제 #3
0
 public YFuncSignature(string name, YType returnType, YParameter[] @params)
 {
     Name       = name;
     ReturnType = returnType;
     Parameters = @params;
 }
예제 #4
0
파일: YMethod.cs 프로젝트: m039/SharpCpp
 public YMethod(string name, YType returnType, YParameter[] @params)
 {
     Signature = new YFuncSignature(name, returnType, @params);
 }
예제 #5
0
파일: YMethod.cs 프로젝트: m039/SharpCpp
 public YMethod(string name, YType type) : this(name, type, null)
 {
 }