beagle r4532 - in trunk/beagle: . BeagleClient Util beagled



Author: kkubasik
Date: Sat Feb 23 20:59:27 2008
New Revision: 4532
URL: http://svn.gnome.org/viewvc/beagle?rev=4532&view=rev

Log:
* beagle/Util/SystemInformation.cs, beagle/Util/StringFu.cs,
  beagle/beagled/Filter.cs, beagle/BeagleClient/Snippet.cs,
  beagle/BeagleClient/Property.cs, beagle/BeagleClient/Hit.cs,
  beagle/BeagleClient/Query.cs: Taking existing desciptive comments,
  cleaning them up, and putting them in the proper monodoc tags. This
  allows Monodevelop to display some useful inline documentation. 

Modified:
   trunk/beagle/BeagleClient/Hit.cs
   trunk/beagle/BeagleClient/Property.cs
   trunk/beagle/BeagleClient/Query.cs
   trunk/beagle/BeagleClient/Snippet.cs
   trunk/beagle/ChangeLog
   trunk/beagle/Util/StringFu.cs
   trunk/beagle/Util/SystemInformation.cs
   trunk/beagle/beagled/Filter.cs

Modified: trunk/beagle/BeagleClient/Hit.cs
==============================================================================
--- trunk/beagle/BeagleClient/Hit.cs	(original)
+++ trunk/beagle/BeagleClient/Hit.cs	Sat Feb 23 20:59:27 2008
@@ -93,6 +93,7 @@
 			set { parent_uri = value; }
 		}
 
+		
 		[XmlAttribute ("ParentUri")]
 		public string EscapedParentUri {
 			get {
@@ -110,25 +111,34 @@
 			}
 		}
 
-		// File, WebHistory, MailMessage, IMLog, etc.
+		/// <value>
+		/// File, WebHistory, MailMessage, IMLog, etc.
+		/// </value>
 		[XmlIgnore]
 		public string Type {
 			get { return GetFirstProperty ("beagle:HitType"); }
 		}
 
-		// If applicable otherwise can be null.
+		/// <value>
+		/// If applicable otherwise can be null.
+		/// </value>
 		[XmlIgnore]
 		public string MimeType {
 			get { return GetFirstProperty ("beagle:MimeType"); }
 		}
 	
-		// IndexUser, IndexSystem, Google, Addressbook, iFolder, etc.
+		
+		/// <value>
+		/// IndexUser, IndexSystem, Google, Addressbook, iFolder, etc.
+		/// </value>
 		[XmlIgnore]
 		public string Source {
 			get { return GetFirstProperty ("beagle:Source"); }
 		}
 
-		// document, archive, image etc.
+		/// <summary>
+		/// document, archive, image etc.
+		/// </summary>
 		[XmlIgnore]
 		public string FileType {
 			get { return GetFirstProperty ("beagle:FileType"); }

Modified: trunk/beagle/BeagleClient/Property.cs
==============================================================================
--- trunk/beagle/BeagleClient/Property.cs	(original)
+++ trunk/beagle/BeagleClient/Property.cs	Sat Feb 23 20:59:27 2008
@@ -40,7 +40,9 @@
 		Date     = 3
 	}
 
-	/* IEnumerable class to serialize properties with non-private namespace. */
+	/// <summary>
+	///  IEnumerable class to serialize properties with non-private namespace.
+	/// </summary>
 	public class PropertyList : IEnumerable {
 		private ArrayList property_list;
 		
@@ -143,34 +145,45 @@
 			set { this.value = StringFu.CleanupInvalidXmlCharacters (value); }
 		}
 
-		// If IsSearched is true, this property will can be matched by a
-		// general match-any-propety query.
-		// You can always query against the specific property, even if
-		// IsSearched is false.
+		
+		/// <value>
+		/// If IsSearched is true, this property will can be matched by a
+		/// general match-any-propety query.
+		/// You can always query against the specific property, even if
+		/// IsSearched is false.
+		/// </value>
 		[XmlAttribute]
 		public bool IsSearched {
 			get { return is_searched; }
 			set { is_searched = value; }
 		}
 
-		// When IsMutable is true, the property is stored in the secondary
-		// index so that it can more efficiently be changed later on.
+		
+		/// <value>
+		///  When IsMutable is true, the property is stored in the secondary
+		/// index so that it can more efficiently be changed later on.
+		/// </value>
 		[XmlAttribute]
 		public bool IsMutable {
 			get { return is_mutable; }
 			set { is_mutable = value; }
 		}
 
-		// When IsStored is false, the property will be stored as an
-		// "unstored lucene field".
+		/// <value>
+		///  When IsStored is false, the property will be stored as an
+		///  "unstored lucene field".
+		/// </value>
 		[XmlAttribute]
 		public bool IsStored {
 			get { return is_stored; }
 			set { is_stored = value; }
 		}
 
-		// When true, this property is persisted across documents being
-		// readded, for instance if a file is touched on disk.
+		
+		/// <value>
+		/// When true, this property is persisted across documents being
+		/// readded, for instance if a file is touched on disk.
+		/// </value>
 		[XmlAttribute]
 		public bool IsPersistent {
 			get { return is_persistent; }
@@ -305,8 +318,19 @@
 			return String.Format ("{0}={1}", Key, Value);
 		}
 
-		// Standard properties for files
-		// Used by FileSystem backend and filters which produce file child-indexables
+		/// <summary>
+		/// Standard properties for files
+		/// Used by FileSystem backend and filters which produce file child-indexables
+		/// </summary>
+		/// <param name="name">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="mutable">
+		/// A <see cref="System.Boolean"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="IEnumerable"/>
+		/// </returns>
 		public static IEnumerable StandardFileProperties (string name, bool mutable)
 		{
 			StringBuilder sb;

Modified: trunk/beagle/BeagleClient/Query.cs
==============================================================================
--- trunk/beagle/BeagleClient/Query.cs	(original)
+++ trunk/beagle/BeagleClient/Query.cs	Sat Feb 23 20:59:27 2008
@@ -151,8 +151,13 @@
 				parts.Add (part);
 		}
 
-		// This is a human-entered query string that will be parsed in
-		// the daemon.
+		/// <summary>
+		/// This is a human-entered query string that will be parsed in
+		/// the daemon.
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
 		public void AddText (string str)
 		{
 			QueryPart_Human part = new QueryPart_Human ();

Modified: trunk/beagle/BeagleClient/Snippet.cs
==============================================================================
--- trunk/beagle/BeagleClient/Snippet.cs	(original)
+++ trunk/beagle/BeagleClient/Snippet.cs	Sat Feb 23 20:59:27 2008
@@ -103,16 +103,22 @@
 	[System.Xml.Serialization.XmlRoot("SnippetLine", Namespace="", IsNullable=false)]
 	[System.Xml.Serialization.XmlType("SnippetLine", Namespace="")]
 	public class SnippetLine {
-		// Line number of the snippet
+		/// <value>
+		/// Line number of the snippet
+		/// </value>
 		[XmlAttribute]
 		public ulong Line;
 
-		// List of fragments
+		/// <value>
+		/// List of fragments
+		/// </value>
 		[XmlElement (ElementName="Fragment", Type=typeof(Fragment))]
 		[XmlArrayItem (ElementName="Fragment", Type=typeof (Fragment))]
 		public ArrayList Fragments;
 
-		// Number of fragments
+		/// <value>
+		/// Number of fragments
+		/// </value>
 		[XmlIgnore]
 		public int Count {
 			get {

Modified: trunk/beagle/Util/StringFu.cs
==============================================================================
--- trunk/beagle/Util/StringFu.cs	(original)
+++ trunk/beagle/Util/StringFu.cs	Sat Feb 23 20:59:27 2008
@@ -47,8 +47,16 @@
 		public static DateTime MinValueUtc = new DateTime (0, DateTimeKind.Utc);
 		public static DateTime MaxValueUtc = new DateTime (DateTime.MaxValue.Ticks, DateTimeKind.Utc);
 
-		// We use this instead of DateTime.ToUniversalTime() because
-		// we want to assume DateTimeKind.Unspecified dates are UTC
+		/// <summary>
+		/// We use this instead of DateTime.ToUniversalTime() because
+		/// we want to assume DateTimeKind.Unspecified dates are UTC
+		/// </summary>
+		/// <param name="dt">
+		/// A <see cref="DateTime"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="DateTime"/>
+		/// </returns>
 		static private DateTime ToUniversalTime (DateTime dt)
 		{
 			switch (dt.Kind) {
@@ -227,12 +235,20 @@
 			return String.Format (Catalog.GetString ("{0:0.0} MB"), len/(double)oneMb);
 		}
 
-		// Here we:
-		// (1) Replace non-alphanumeric characters with spaces
-		// (2) Inject whitespace between lowercase-to-uppercase
-		//     transitions (so "FooBar" becomes "Foo Bar")
-		//     and transitions between letters and numbers
-		//     (so "cvs2svn" becomes "cvs 2 svn")
+		/// <summary>
+		///  Here we:
+		/// (1) Replace non-alphanumeric characters with spaces
+		/// (2) Inject whitespace between lowercase-to-uppercase
+		///     transitions (so "FooBar" becomes "Foo Bar")
+		///     and transitions between letters and numbers
+		///     (so "cvs2svn" becomes "cvs 2 svn")
+		/// </summary>
+		/// <param name="line">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string FuzzyDivide (string line)
 		{
 			// Allocate a space slightly bigger than the
@@ -282,8 +298,19 @@
 			return FuzzyDivide (url.Substring (protocol_index + 3));
 		}
 		
-		// Match strings against patterns that are allowed to contain
-		// glob-style * and ? wildcards.
+		/// <summary>
+		/// 	 Match strings against patterns that are allowed to contain
+		///	 glob-style * and ? wildcards.
+		/// </summary>
+		/// <param name="pattern">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		static public bool GlobMatch (string pattern, string str)
 		{
 			if (pattern == null || str == null)
@@ -300,9 +327,26 @@
 		
 		private const char WILDCARD_STRING = '*';
 		
-		// Copied from beagled/Lucene.Net/Search/WildcardTermEnum.cs
-		// Simple string matching algorithm with wildcards
-		// '*' matches 0 or more characters
+		/// <summary>
+		/// Copied from beagled/Lucene.Net/Search/WildcardTermEnum.cs
+		/// Simple string matching algorithm with wildcards
+		/// '*' matches 0 or more characters
+		/// </summary>
+		/// <param name="pattern">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="patternIdx">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="text">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="stringIdx">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		private static bool WildcardEquals(System.String pattern, int patternIdx, System.String text, int stringIdx)
 		{
 			int p = patternIdx;
@@ -436,7 +480,15 @@
 			return builder.ToString ();
 		}
 
-		// Translate all %xx codes into real characters
+		/// <summary>
+		/// Translate all %xx codes into real characters
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string HexUnescape (string str)
 		{
 			ArrayList bytes = new ArrayList ();
@@ -605,7 +657,21 @@
 			return new string (char_array);
 		}
 		
-		// Words of less than min_word_length characters are not counted
+		/// <summary>
+		/// Words of less than min_word_length characters are not counted
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="max_words">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="min_word_length">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Int32"/>
+		/// </returns>
 		static public int CountWords (string str, int max_words, int min_word_length)
 		{
 			if (str == null)
@@ -645,7 +711,15 @@
 			return CountWords (str, -1);
 		}
 
-		// Strip trailing slashes and make sure we only have 1 leading slash
+		/// <summary>
+		/// Strip trailing slashes and make sure we only have 1 leading slash
+		/// </summary>
+		/// <param name="path">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string SanitizePath (string path)
 		{
 			if (path.StartsWith ("//")) {
@@ -662,12 +736,20 @@
 			return path;
 		}
 
-		// This method will translate an email address like
-		// "john doe+spamtrap foo com" to "john doe spamtrap foo"
-		//
-		// FIXME: Maybe we should only do the username part?  Ie,
-		// "john doe spamtrap"?  That way searching for "foo" won't
-		// turn up *everything*
+		/// <summary>
+		/// This method will translate an email address like
+		/// "john doe+spamtrap foo com" to "john doe spamtrap foo"
+		///
+		/// FIXME: Maybe we should only do the username part?  Ie,
+		/// "john doe spamtrap"?  That way searching for "foo" won't
+		/// turn up *everything*
+		/// </summary>
+		/// <param name="email">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string SanitizeEmail (string email)
 		{
 			char[] replace_array = { '@', '.', '-', '_', '+' };
@@ -691,10 +773,17 @@
 			return email;
 		}
 
-		/**
-		 * expands environment variables in a string e.g.
-		 * folders=$HOME/.kde/share/...
-		 */
+		
+		/// <summary>
+		/// expands environment variables in a string e.g.
+		/// folders=$HOME/.kde/share/...
+		/// </summary>
+		/// <param name="path">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		public static string ExpandEnvVariables (string path)
 		{
 			int dollar_pos = path.IndexOf ('$');

Modified: trunk/beagle/Util/SystemInformation.cs
==============================================================================
--- trunk/beagle/Util/SystemInformation.cs	(original)
+++ trunk/beagle/Util/SystemInformation.cs	Sat Feb 23 20:59:27 2008
@@ -114,12 +114,16 @@
 		[DllImport ("libbeagleglue.so")]
 		extern static unsafe int screensaver_glue_init ();
 
-		/*
-		 * BeagleDaemon needs to monitor screensaver status
-		 * for faster scheduling when user is idle.
-		 * IndexHelper does not need to monitor screensaver status.
-		 * XssInit is only called from the BeagleDaemon.
-		 */
+		/// <summary>
+		/// BeagleDaemon needs to monitor screensaver status
+		/// for faster scheduling when user is idle.
+		/// IndexHelper does not need to monitor screensaver status.
+		/// XssInit is only called from the BeagleDaemon.
+		///
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public static bool XssInit ()
 		{
 			int has_xss = screensaver_glue_init ();
@@ -174,8 +178,10 @@
 			}
 		}
 
-		// returns number of seconds since input was received
-		// from the user on any input device
+		/// <value>
+		///  returns number of seconds since input was received
+		/// from the user on any input device
+		/// </value>
 		public static double InputIdleTime {
 			get {
 				CheckScreenSaver ();

Modified: trunk/beagle/beagled/Filter.cs
==============================================================================
--- trunk/beagle/beagled/Filter.cs	(original)
+++ trunk/beagle/beagled/Filter.cs	Sat Feb 23 20:59:27 2008
@@ -128,8 +128,13 @@
 			set { this_extension = value; }
 		}
 
-		// Filter may set the filetype to document, source, music etc.
-		// Use lower case for file_type
+		/// <summary>
+		///  Filter may set the filetype to document, source, music etc.
+		/// Use lower case for file_type
+		/// </summary>
+		/// <param name="file_type">
+		/// A <see cref="System.String"/>
+		/// </param>
 		protected void SetFileType (string file_type)
 		{
 			this_file_type = file_type;
@@ -144,12 +149,14 @@
 			set { indexable = value; }
 		}
 		
-		// Filters which deal with big files, and that don't need
-		// to read in whole files may want to set this to false
-		// to avoid wasting cycles in disk wait.
+		
 
 		private bool preload = true;
-
+		/// <value>
+		///  Filters which deal with big files, and that don't need
+		/// to read in whole files may want to set this to false
+		/// to avoid wasting cycles in disk wait.
+		/// </value>
 		protected bool PreLoad {
 			get { return preload; }
 			set { preload = value; }
@@ -227,9 +234,11 @@
 		const string WHITESPACE = " ";
 		const string NEWLINE = "\n";
 
-		/* Append text to the textpool. If IsHot is true, then also add to the hottext pool.
-		 * Handles null str.
-		 */
+		
+		/// <summary>
+		///  Append text to the textpool. If IsHot is true, then also add to the hottext pool.
+		///  Handles null str.
+		/// </summary>
 		public bool AppendText (string str)
 		{
 			if (Debug)
@@ -293,7 +302,15 @@
 			*/
 		}
 
-		// Add a word followed by a whitespace. word may not be whitespace or newline.
+		/// <summary>
+		/// Add a word followed by a whitespace. word may not be whitespace or newline.
+		/// </summary>
+		/// <param name="word">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendWord (string word)
 		{
 			if (Debug)
@@ -302,7 +319,15 @@
 			return AppendWords (word, false);
 		}
 
-		// Add a line followed by a newline.
+		/// <summary>
+		/// Add a line followed by a newline.
+		/// </summary>
+		/// <param name="line">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendLine (string line)
 		{
 			if (Debug)
@@ -343,7 +368,21 @@
 			return UpdateCharsAdded (words.Length + 1);
 		}
 
-		// Does not check for structural breaks
+		/// <summary>
+		/// Does not check for structural breaks
+		/// </summary>
+		/// <param name="buffer">
+		/// A <see cref="System.Char"/>
+		/// </param>
+		/// <param name="index">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="count">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendChars (char[] buffer, int index, int count)
 		{
 			if (Debug)
@@ -357,9 +396,14 @@
 			return UpdateCharsAdded (count);
 		}
 
-		/*
-		 * Adds whitespace to the textpool.
-		 */
+		
+		 
+		/// <summary>
+		/// Adds whitespace to the textpool.
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendWhiteSpace ()
 		{
 			if (Debug)
@@ -378,9 +422,14 @@
 			return UpdateCharsAdded (1);
 		}
 
-		/*
-		 * Creates a new paragraph. Mainly useful for storing cached contents.
-		 */
+		
+		
+		/// <summary>
+		/// Creates a new paragraph. Mainly useful for storing cached contents.
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendStructuralBreak ()
 		{
 			if (Debug)
@@ -602,8 +651,19 @@
 			return Open (new FileInfo (tempFile));
 		}
 
-		// This will throw an exception; callers should catch it and appropriately
-		// display the error message showing the filename etc.
+		/// <summary>
+		/// This will throw an exception; callers should catch it and appropriately
+		/// display the error message showing the filename etc.
+		/// </summary>
+		/// <param name="stream">
+		/// A <see cref="Stream"/>
+		/// </param>
+		/// <param name="store_tempfile">
+		/// A <see cref="System.Boolean"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool Open (Stream stream, bool store_tempfile)
 		{
 			if (store_tempfile)
@@ -842,8 +902,16 @@
 			get { return generated_indexables.Count > 0; }
 		}
 
-		// Good filters should replace this by an IEnumerable that does not require generating
-		// all the indexables beforehand
+		/// <summary>
+		/// Good filters should replace this by an IEnumerable that does not require generating
+		/// all the indexables beforehand
+		/// </summary>
+		/// <param name="indexable">
+		/// A <see cref="Indexable"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public virtual bool GenerateNextIndexable (out Indexable indexable)
 		{
 			indexable = null;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]