Пример #1
0
        /// <summary>
        /// 문서 생성 기능 중 sates.core.info 의 작성을 담당한다.
        /// </summary>
        public virtual void w03_info(System.IO.StreamWriter wr, string infoname, sates.core.doc doc)
        {
            var info_var = doc.get_info(infoname);

            if (null != info_var)
            {
                sates.output.custom.custom_info_writer writer =
                    sates.output.custom.custom_info_writer_manager.get_writer(infoname);
                if (null == writer)
                {
                    if (sates.core.INFO_TYPE.MULTI_LINE_STRING == info_var.info_type)
                    {
                        info_var.get(out Queue <string> strs);
                        wr.Write("    @");
                        wr.WriteLine(infoname);
                        wr.WriteLine();
                        foreach (var str in strs)
                        {
                            wr.Write("    ");
                            var tmp = str.Trim();
                            if (tmp.Length > 0)
                            {
                                _resolve_string_with_namespace(str, out string newval);
                                wr.Write(newval);
                                wr.WriteLine("\\n");
                            }
                            else
                            {
                                wr.WriteLine();
                                wr.WriteLine();
                            }
                        }
                        wr.WriteLine();
                    }
                    else if (sates.core.INFO_TYPE.DOUBLE == info_var.info_type)
                    {
                        info_var.get(out double val);
                        wr.Write("    @");
                        wr.WriteLine(infoname);
                        wr.Write("    ");
                        wr.WriteLine(val.ToString());
                        wr.WriteLine();
                    }
                    else if (sates.core.INFO_TYPE.LONG == info_var.info_type)
                    {
                        info_var.get(out long val);
                        wr.Write("    @");
                        wr.WriteLine(infoname);
                        wr.Write("    ");
                        wr.WriteLine(val.ToString());
                        wr.WriteLine();
                    }
                }
                else
                {
                    writer.write(wr, info_var);
                }
            }
        }
Пример #2
0
 public static void add(doc doc)
 {
     if (!docs.ContainsKey(doc.uniq_id))
     {
         docs.Add(doc.uniq_id, doc);
     }
     else
     {
         throw new Exception("doc's unique id is NOT unique");
     }
 }
Пример #3
0
 /// <summary>
 /// 문서 생성 기능 중 group (doxygen 의 addtogroup tag) 를 close 하는 코드를 작성한다.
 /// </summary>
 public override void w99_ground_end(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     if (null != doc.category_info)
     {
         foreach (var cat in doc.category_info)
         {
             wr.WriteLine("    /** @} */");
         }
     }
     wr.WriteLine("");
     wr.WriteLine("}");
 }
Пример #4
0
 /// <summary>
 /// 문서 생성 기능 중 namespace 작성을 담당한다.
 /// </summary>
 public override void w01_namespace(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     if (null != doc.category_info)
     {
         namespace_count = 0;
         foreach (var cat in doc.category_info)
         {
             wr.WriteLine("namespace " + cat + " {");
             ++namespace_count;
         }
     }
     wr.WriteLine("");
 }
Пример #5
0
 /// <summary>
 /// 문서 생성 group (doxygen 의 addtogroup 태그) 작성을 담당한다.
 /// </summary>
 public virtual void w02_group_begin(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     if (null != doc.category_info)
     {
         foreach (var cat in doc.category_info)
         {
             wr.Write("    /** \\addtogroup ");
             wr.WriteLine(cat);
             wr.WriteLine("    *  @{");
             wr.WriteLine("    */");
         }
     }
     wr.WriteLine("");
 }
Пример #6
0
        public static void create(string uniq_id, string doc_type, Queue <string> category_info = null)
        {
            doc_list.remove(uniq_id);
            doc doc_instance = null;

            if (doc_type == "spec")
            {
                doc_instance = new doc_spec(uniq_id, doc_type);
            }
            else
            {
                doc_instance = new doc(uniq_id, doc_type);
            }
            doc_instance.category_info = category_info;
            doc_list.add(doc_instance);
        }
Пример #7
0
        public override void cross_ref_gen1()
        {
            resolve_help("parent_spec");
            resolve_help("child_spec");
            var tcase = this.get_info("test_case");

            if (null != tcase)
            {
                tcase.get(out Queue <string> name_list);
                foreach (var name in name_list)
                {
                    doc item = (doc)(doc_list.get(name));
                    if (null != item)
                    {
                        no_duplicate_add(ref test_cases, item);
                    }
                }
            }
        }
Пример #8
0
 protected void no_duplicate_add(ref List <doc> list, doc item)
 {
     if (null != item)
     {
         bool is_found = false;
         foreach (var v in list)
         {
             if (v.uniq_id == item.uniq_id)
             {
                 is_found = true;
                 break;
             }
         }
         if (!is_found)
         {
             list.Add(item);
         }
     }
 }
Пример #9
0
 /// <summary>
 /// 문서 생성 기능 중 namespace 작성을 담당한다.
 /// </summary>
 public override void w01_namespace(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     wr.Write("namespace ");
     if (null != doc.category_info)
     {
         int loop_count = 0;
         foreach (var cat in doc.category_info)
         {
             if (loop_count > 0)
             {
                 wr.Write(".");
             }
             wr.Write(cat);
             loop_count++;
         }
     }
     wr.WriteLine("");
     wr.WriteLine("{");
 }
Пример #10
0
 /// <summary>
 /// 문서 생성 기능 중 namespace 작성을 담당한다.
 /// </summary>
 public virtual void w01_namespace(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     throw new NotImplementedException(System.Reflection.MethodBase.GetCurrentMethod().Name);
 }
Пример #11
0
 /// <summary>
 /// 문서 생성 기능 중 클래스 작성을 담당한다.
 /// </summary>
 public virtual void w04_class(System.IO.StreamWriter wr, sates.core.doc doc)
 {
     wr.Write("    class ");
     wr.Write(doc.uniq_id);
     wr.WriteLine("{}");
 }