PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/beagle/beagled/Lucene.Net/Util/Constants.cs

https://github.com/joeshaw/beagle
C# | 74 lines | 19 code | 7 blank | 48 comment | 0 complexity | c734165ab02e7ea3a341d1a99abe31de MD5 | raw file
Possible License(s): LGPL-2.0, GPL-2.0
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. using System;
  18. namespace Lucene.Net.Util
  19. {
  20. /// <summary> Licensed to the Apache Software Foundation (ASF) under one or more
  21. /// contributor license agreements. See the NOTICE file distributed with
  22. /// this work for additional information regarding copyright ownership.
  23. /// The ASF licenses this file to You under the Apache License, Version 2.0
  24. /// (the "License"); you may not use this file except in compliance with
  25. /// the License. You may obtain a copy of the License at
  26. ///
  27. /// http://www.apache.org/licenses/LICENSE-2.0
  28. ///
  29. /// Unless required by applicable law or agreed to in writing, software
  30. /// distributed under the License is distributed on an "AS IS" BASIS,
  31. /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  32. /// See the License for the specific language governing permissions and
  33. /// limitations under the License.
  34. /// </summary>
  35. /// <summary> Some useful constants.
  36. ///
  37. /// </summary>
  38. /// <author> Doug Cutting
  39. /// </author>
  40. /// <version> $Id: Constants.java 472959 2006-11-09 16:21:50Z yonik $
  41. ///
  42. /// </version>
  43. public sealed class Constants
  44. {
  45. private Constants()
  46. {
  47. } // can't construct
  48. /// <summary>Lucene.Net Runtime version</summary>
  49. public static readonly string DOTNET_VERSION = System.Reflection.Assembly.GetAssembly(typeof(Lucene.Net.Index.IndexReader)).ImageRuntimeVersion.Substring(1);
  50. /// <summary>True iff Lucene.Net Runtime version is 1.0</summary>
  51. public static readonly bool DOTNET_VERSION_1_0 = DOTNET_VERSION.StartsWith("1.0.");
  52. /// <summary>True iff Lucene.Net Runtime version is 1.1</summary>
  53. public static readonly bool DOTNET_VERSION_1_1 = DOTNET_VERSION.StartsWith("1.1.");
  54. /// <summary>True iff Lucene.Net Runtime version is 2.0</summary>
  55. public static readonly bool DOTNET_VERSION_2_0 = DOTNET_VERSION.StartsWith("2.0.");
  56. /// <summary>True iff Lucene.Net Runtime version is 3.0</summary>
  57. public static readonly bool DOTNET_VERSION_3_0 = DOTNET_VERSION.StartsWith("3.0.");
  58. /// <summary>The value of <tt>System.getProperty("os.name")<tt>. *</summary>
  59. public static readonly System.String OS_NAME = System.Environment.GetEnvironmentVariable("OS");
  60. /// <summary>True iff running on Linux. </summary>
  61. public static readonly bool LINUX = OS_NAME.StartsWith("Linux");
  62. /// <summary>True iff running on Windows. </summary>
  63. public static readonly bool WINDOWS = OS_NAME.StartsWith("Windows");
  64. /// <summary>True iff running on SunOS. </summary>
  65. public static readonly bool SUN_OS = OS_NAME.StartsWith("SunOS");
  66. }
  67. }