//------------------------------------------------------------ // CMapBase.AppendMap (2) // /// <summary></summary> /// <param name="mapLine"></param> /// <param name="proc"></param> //------------------------------------------------------------ protected void AppendMap(int mapLine, PREPROC proc) { MAPABLE <PREPROC> data = new MAPABLE <PREPROC>(); data.proc.CopyFrom(proc); data.mapLine = mapLine; this.mapList.Add(data); IsSorted = false; }
//------------------------------------------------------------ // CMapBase.AppendMap (1) // /// <summary></summary> /// <param name="data"></param> //------------------------------------------------------------ protected void AppendMap(MAPABLE <PREPROC> data) { if (data == null) { return; } this.mapList.Add(data); IsSorted = false; }
//------------------------------------------------------------ // CWarningMap.AddWarning // /// <summary> /// <para>Adds a #pragma warning to the end of the list.</para> /// <para>ASSERTs if a warning for the given line already exists.</para> /// </summary> //------------------------------------------------------------ internal void AddWarning(int srcLine, bool isDisable, List <int> WarningList) { MAPABLE <PPWARNING> map = new MAPABLE <PPWARNING>(); map.mapLine = srcLine; map.proc.isDisable = isDisable; map.proc.WarningList = WarningList; this.AppendMap(map); }
//------------------------------------------------------------ // CMapBase.Copy (4) // /// <summary> /// Copy PREPROC instance from oldMap to this. /// </summary> //------------------------------------------------------------ internal void Copy(CMapBase <PREPROC> oldMap) { foreach (MAPABLE <PREPROC> elm in oldMap.mapList) { MAPABLE <PREPROC> newElm = new MAPABLE <PREPROC>(); newElm.CopyFrom(elm); this.mapList.Add(newElm); } SortList(); }
//------------------------------------------------------------ // CMapBase.Copy (1) // /// <summary> /// Copy PREPROC instance from oldMap to this. /// </summary> //------------------------------------------------------------ internal void Copy(CMapBase <PREPROC> oldMap, int startLine, int endLine, int delta) { if (startLine > endLine) { return; } foreach (MAPABLE <PREPROC> elm in oldMap.mapList) { if (elm.mapLine >= startLine && elm.mapLine <= endLine) { MAPABLE <PREPROC> newElm = new MAPABLE <PREPROC>(); newElm.CopyFrom(elm); this.mapList.Add(newElm); } } SortList(); }
//------------------------------------------------------------ // MAPABLE.CopyFrom //------------------------------------------------------------ internal void CopyFrom(MAPABLE <PREPROC> src) { this.mapLine = src.mapLine; this.proc.CopyFrom(src.proc); }
public int Compare(MAPABLE <PREPROC> m1, MAPABLE <PREPROC> m2) { return(m1.mapLine - m2.mapLine); }