Browse Source

Extract the TranslationUnit class into its own file.

pull/1/head
triton 12 years ago
parent
commit
d56050803d
  1. 53
      src/Bridge/Library.cs
  2. 57
      src/Bridge/TranslationUnit.cs

53
src/Bridge/Library.cs

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace Cxxi
{
@ -17,57 +15,6 @@ namespace Cxxi @@ -17,57 +15,6 @@ namespace Cxxi
Unavailable
}
/// <summary>
/// Represents a parsed C++ unit.
/// </summary>
[DebuggerDisplay("File = {FileName}, Ignored = {Ignore}")]
public class TranslationUnit : Namespace
{
public TranslationUnit(string file)
{
Macros = new List<MacroDefinition>();
FilePath = file;
}
/// Contains the macros present in the unit.
public List<MacroDefinition> Macros;
// Whether the unit should be generated.
public override bool IsGenerated
{
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Generation); }
}
// Whether the unit should be processed.
public override bool IsProcessed
{
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Processing); }
}
public bool IsSystemHeader { get; set; }
/// Contains the path to the file.
public string FilePath;
/// Contains the name of the file.
public string FileName
{
get { return Path.GetFileName(FilePath); }
}
/// Contains the name of the module.
public string FileNameWithoutExtension
{
get { return Path.GetFileNameWithoutExtension(FileName); }
}
/// Contains the include path.
public string IncludePath;
/// Type references object.
public object TypeReferences;
}
/// <summary>
/// A library contains all the modules.
/// </summary>

57
src/Bridge/TranslationUnit.cs

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace Cxxi
{
/// <summary>
/// Represents a parsed C++ unit.
/// </summary>
[DebuggerDisplay("File = {FileName}, Ignored = {Ignore}")]
public class TranslationUnit : Namespace
{
public TranslationUnit(string file)
{
Macros = new List<MacroDefinition>();
FilePath = file;
}
/// Contains the macros present in the unit.
public List<MacroDefinition> Macros;
// Whether the unit should be generated.
public override bool IsGenerated
{
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Generation); }
}
// Whether the unit should be processed.
public override bool IsProcessed
{
get { return !IgnoreFlags.HasFlag(IgnoreFlags.Processing); }
}
public bool IsSystemHeader { get; set; }
/// Contains the path to the file.
public string FilePath;
/// Contains the name of the file.
public string FileName
{
get { return Path.GetFileName(FilePath); }
}
/// Contains the name of the module.
public string FileNameWithoutExtension
{
get { return Path.GetFileNameWithoutExtension(FileName); }
}
/// Contains the include path.
public string IncludePath;
/// Type references object.
public object TypeReferences;
}
}
Loading…
Cancel
Save