From a2441d1a90e18a8c8f8ff0a8b9a004db16aa6c15 Mon Sep 17 00:00:00 2001 From: John Luke Date: Mon, 16 Aug 2004 21:00:30 +0000 Subject: [PATCH] 2004-08-15 John Luke * monop.cs: add declared-only option * outline.cs: add limited attribute support (only for [Serializable] and [Flags]) svn path=/trunk/mcs/; revision=32401 --- mcs/tools/monop/ChangeLog | 6 ++++++ mcs/tools/monop/TODO | 6 ++---- mcs/tools/monop/monop.cs | 6 ++++++ mcs/tools/monop/outline.cs | 11 +++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mcs/tools/monop/ChangeLog b/mcs/tools/monop/ChangeLog index c236e2f0b36..277a8f0b5d4 100644 --- a/mcs/tools/monop/ChangeLog +++ b/mcs/tools/monop/ChangeLog @@ -1,3 +1,9 @@ +2004-08-15 John Luke + + * monop.cs: add declared-only option + * outline.cs: add limited attribute support (only for + [Serializable] and [Flags]) + 2004-08-13 John Luke * monop.cs: add MONO_PATH support diff --git a/mcs/tools/monop/TODO b/mcs/tools/monop/TODO index d7efa8986a4..b6229cca70c 100644 --- a/mcs/tools/monop/TODO +++ b/mcs/tools/monop/TODO @@ -2,8 +2,6 @@ TODO ---- * Support for params (show the params keyword) - * Handle interfaces: - * handle explicit vs. implicit impl - * attributes (Serializable, etc) - * add declared only / inherited option + * handle explicit vs. implicit interfaces * handle ~ based paths (ex -r:~/foo.dll) + * improve commandline handling diff --git a/mcs/tools/monop/monop.cs b/mcs/tools/monop/monop.cs index 5f6169ab809..f7e20996b97 100644 --- a/mcs/tools/monop/monop.cs +++ b/mcs/tools/monop/monop.cs @@ -177,6 +177,7 @@ class MonoP { PrintUsage (); Console.WriteLine (""); Console.WriteLine ("options:"); + Console.WriteLine ("\t--declared-only,-d\tOnly show members declared in the Type"); Console.WriteLine ("\t--help,-h\t\tShow this information"); Console.WriteLine ("\t--private,-p\t\tShow private members"); } @@ -216,6 +217,11 @@ class MonoP { i++; } + if (args [i] == "--declared-only" || args [i] == "-d") { + default_flags |= BindingFlags.DeclaredOnly; + i++; + } + if (args.Length < i + 1) { PrintUsage (); return; diff --git a/mcs/tools/monop/outline.cs b/mcs/tools/monop/outline.cs index dd3efd6220d..c65e7e39599 100644 --- a/mcs/tools/monop/outline.cs +++ b/mcs/tools/monop/outline.cs @@ -27,6 +27,7 @@ public class Outline { public void OutlineType (BindingFlags flags) { + OutlineAttributes (); o.Write (GetTypeVisibility (t)); o.Write (" "); o.Write (GetTypeKind (t)); @@ -133,6 +134,16 @@ public class Outline { o.Indent--; o.WriteLine ("}"); } + // FIXME: add other interesting attributes? + void OutlineAttributes () + { + if (t.IsSerializable) + o.WriteLine ("[Serializable]"); + + if (t.GetCustomAttributes (typeof (System.FlagsAttribute), true).Length > 0) + o.WriteLine ("[Flags]"); + } + void OutlineEvent (EventInfo ei) { MethodBase accessor = ei.GetAddMethod (); -- 2.25.1