Skip to content

Commit

Permalink
Update commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amironov73 committed Aug 30, 2018
1 parent 3f55875 commit 72a7d50
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 73 deletions.
1 change: 1 addition & 0 deletions Source/Classic/Libs/ManagedIrbis/ManagedIrbis.3.5.csproj
Expand Up @@ -906,6 +906,7 @@
<Compile Include="Source\Reservations\ReservationStatus.cs" />
<Compile Include="Source\Reservations\HistoryInfo.cs" />
<Compile Include="Source\Reservations\ReservationUtility.cs" />
<Compile Include="Source\Search\CommonSearches.cs" />
<Compile Include="Source\Search\FoundLine.cs" />
<Compile Include="Source\Search\Infrastructure\ComplexLevel.cs" />
<Compile Include="Source\Search\Infrastructure\ISearchTree.cs" />
Expand Down
1 change: 1 addition & 0 deletions Source/Classic/Libs/ManagedIrbis/ManagedIrbis.4.0.csproj
Expand Up @@ -900,6 +900,7 @@
<Compile Include="Source\Reservations\ReservationStatus.cs" />
<Compile Include="Source\Reservations\HistoryInfo.cs" />
<Compile Include="Source\Reservations\ReservationUtility.cs" />
<Compile Include="Source\Search\CommonSearches.cs" />
<Compile Include="Source\Search\FoundLine.cs" />
<Compile Include="Source\Search\Infrastructure\ComplexLevel.cs" />
<Compile Include="Source\Search\Infrastructure\ISearchTree.cs" />
Expand Down
1 change: 1 addition & 0 deletions Source/Classic/Libs/ManagedIrbis/ManagedIrbis.4.6.csproj
Expand Up @@ -904,6 +904,7 @@
<Compile Include="Source\Reservations\ReservationStatus.cs" />
<Compile Include="Source\Reservations\HistoryInfo.cs" />
<Compile Include="Source\Reservations\ReservationUtility.cs" />
<Compile Include="Source\Search\CommonSearches.cs" />
<Compile Include="Source\Search\FoundLine.cs" />
<Compile Include="Source\Search\Infrastructure\ComplexLevel.cs" />
<Compile Include="Source\Search\Infrastructure\ISearchTree.cs" />
Expand Down
1 change: 1 addition & 0 deletions Source/Classic/Libs/ManagedIrbis/ManagedIrbis.4.7.csproj
Expand Up @@ -904,6 +904,7 @@
<Compile Include="Source\Reservations\ReservationStatus.cs" />
<Compile Include="Source\Reservations\HistoryInfo.cs" />
<Compile Include="Source\Reservations\ReservationUtility.cs" />
<Compile Include="Source\Search\CommonSearches.cs" />
<Compile Include="Source\Search\FoundLine.cs" />
<Compile Include="Source\Search\Infrastructure\ComplexLevel.cs" />
<Compile Include="Source\Search\Infrastructure\ISearchTree.cs" />
Expand Down
1 change: 1 addition & 0 deletions Source/Classic/Libs/ManagedIrbis/ManagedIrbis.csproj
Expand Up @@ -904,6 +904,7 @@
<Compile Include="Source\Reservations\ReservationStatus.cs" />
<Compile Include="Source\Reservations\HistoryInfo.cs" />
<Compile Include="Source\Reservations\ReservationUtility.cs" />
<Compile Include="Source\Search\CommonSearches.cs" />
<Compile Include="Source\Search\FoundLine.cs" />
<Compile Include="Source\Search\Infrastructure\ComplexLevel.cs" />
<Compile Include="Source\Search\Infrastructure\ISearchTree.cs" />
Expand Down
16 changes: 5 additions & 11 deletions Source/Classic/Libs/ManagedIrbis/Source/Client/LocalProvider.cs
@@ -1,7 +1,7 @@
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

/* LocalProvider.cs --
/* LocalProvider.cs --
* Ars Magna project, http://arsmagna.ru
* -------------------------------------------------------
* Status: poor
Expand Down Expand Up @@ -43,7 +43,7 @@
namespace ManagedIrbis.Client
{
/// <summary>
///
///
/// </summary>
[PublicAPI]
[MoonSharpUserData]
Expand Down Expand Up @@ -259,9 +259,9 @@ private string _ExpandPath
return result;
}

[NotNull]
private DirectAccess64 _GetAccessor()
{

if (ReferenceEquals(_accessor, null))
{
string fileName = Path.Combine
Expand Down Expand Up @@ -420,10 +420,7 @@ public override int GetMaxMfn()
try
{
accessor = _GetAccessor();
if (!ReferenceEquals(accessor, null))
{
result = accessor.GetMaxMfn();
}
result = accessor.GetMaxMfn();
}
catch (Exception exception)
{
Expand Down Expand Up @@ -571,10 +568,7 @@ int mfn
try
{
accessor = _GetAccessor();
if (accessor != null)
{
result = accessor.ReadRecord(mfn);
}
result = accessor.ReadRecord(mfn);
}
catch (Exception exception)
{
Expand Down
8 changes: 4 additions & 4 deletions Source/Classic/Libs/ManagedIrbis/Source/Direct/MstRecord64.cs
Expand Up @@ -90,9 +90,9 @@ private string _DumpDictionary ()
{
StringBuilder result = new StringBuilder();

foreach ( MstDictionaryEntry64 entry in Dictionary )
foreach (MstDictionaryEntry64 entry in Dictionary)
{
result.AppendLine ( entry.ToString () );
result.AppendLine (entry.ToString ());
}

return result.ToString ();
Expand All @@ -106,9 +106,9 @@ private string _DumpDictionary ()
/// Decode the field.
/// </summary>
[NotNull]
public RecordField DecodeField
public static RecordField DecodeField
(
MstDictionaryEntry64 entry
[NotNull] MstDictionaryEntry64 entry
)
{
RecordField result = RecordField.Parse
Expand Down
Expand Up @@ -63,13 +63,13 @@ public struct MstRecordLeader64
public int Base { get; set; }

/// <summary>
/// Число полей в записи (т.е. число входов
/// Число полей в записи (т. е. число входов
/// в справочнике).
/// </summary>
public int Nvf { get; set; }

/// <summary>
/// Индикатор записи (логически удаленная и т.п.).
/// Индикатор записи (логически удаленная и т. п.).
/// </summary>
public int Status { get; set; }

Expand Down
Expand Up @@ -54,7 +54,7 @@
namespace ManagedIrbis
{
/// <summary>
///
///
/// </summary>
[PublicAPI]
[MoonSharpUserData]
Expand Down Expand Up @@ -506,7 +506,8 @@ public static DatabaseInfo[] ListDatabases
(
IrbisPath.Data,
listFile
);
)
.ThrowIfNull("menuFile");
string[] lines = menuFile.SplitLines();
DatabaseInfo[] result = DatabaseInfo.ParseMenu(lines);

Expand Down Expand Up @@ -1082,7 +1083,8 @@ public static void RemoveLogging
as LoggingClientSocket;
if (!ReferenceEquals(oldSocket, null))
{
AbstractClientSocket newSocket = oldSocket.InnerSocket;
AbstractClientSocket newSocket = oldSocket.InnerSocket
.ThrowIfNull("oldSocket.InnerSocket");
connection.SetSocket(newSocket);
}

Expand Down Expand Up @@ -1194,7 +1196,7 @@ public static string ReadTextFile

// ========================================================

#if !UAP
#if !UAP

/// <summary>
/// Require minimal client version.
Expand Down
Expand Up @@ -235,7 +235,7 @@ public void CreateCatalog
}

string targetName = Path.GetFileName(directory);
if (string.IsNullOrEmpty(ibisName))
if (string.IsNullOrEmpty(targetName))
{
Log.Error
(
Expand Down
Expand Up @@ -99,7 +99,7 @@ public PftCsEval

#region PftNode members

/// <inheritdoc />
/// <inheritdoc cref="PftNode.Execute" />
public override void Execute
(
PftContext context
Expand All @@ -112,23 +112,20 @@ PftContext context
string expression = context.Evaluate(Children);
if (!string.IsNullOrEmpty(expression))
{
if (!string.IsNullOrEmpty(expression))
if (expression != _text)
{
if (expression != _text)
{
_text = expression;
_method = SharpRunner.CompileSnippet
(
expression,
"PftNode node, PftContext context",
err => context.WriteLine(this, err)
);
}

if (!ReferenceEquals(_method, null))
{
_method.Invoke(null, new object[] {this, context});
}
_text = expression;
_method = SharpRunner.CompileSnippet
(
expression,
"PftNode node, PftContext context",
err => context.WriteLine(this, err)
);
}

if (!ReferenceEquals(_method, null))
{
_method.Invoke(null, new object[] { this, context });
}
}

Expand Down
Expand Up @@ -55,15 +55,8 @@ private static void AddField(PftContext context, PftNode node, PftNode[] argumen

foreach (string body in lines)
{
RecordField field = RecordFieldUtility.Parse
(
tag,
body
);
if (!ReferenceEquals(field, null))
{
context.Record.Fields.Add(field);
}
RecordField field = RecordFieldUtility.Parse(tag, body);
context.Record.Fields.Add(field);
}
}
}
Expand Down
Expand Up @@ -25,7 +25,7 @@ namespace ManagedIrbis.Pft.Infrastructure.Unifors
//
// Форматирование документа из другой БД – &uf('D')
//
// Назначение: Форматирование документа из другой БД
// Назначение: Форматирование документа из другой БД
// (REF на другую БД – отношение «от одного к одному»).
//
// Формат (передаваемая строка):
Expand Down Expand Up @@ -169,15 +169,12 @@ public static void FormatDocumentDB
{
nestedContext.Provider.Database = database;
nestedContext.Output = context.Output;
if (found.Length != 0)
int mfn = found[0];
MarcRecord record = nestedContext.Provider.ReadRecord(mfn);
if (!ReferenceEquals(record, null))
{
int mfn = found[0];
MarcRecord record = nestedContext.Provider.ReadRecord(mfn);
if (!ReferenceEquals(record, null))
{
nestedContext.Record = record;
program.Execute(nestedContext);
}
nestedContext.Record = record;
program.Execute(nestedContext);
}
}
finally
Expand Down
Expand Up @@ -37,6 +37,7 @@ static class UniforPlus1

// ================================================================

[NotNull]
private static string _GetGlobal
(
[NotNull] PftContext context,
Expand Down Expand Up @@ -79,8 +80,7 @@ int count
{
if (context.Globals.HaveVariable(index))
{
string item = _GetGlobal(context, index)
?? string.Empty;
string item = _GetGlobal(context, index);
string[] lines = item.SplitLines();
result.AddRange(lines);
}
Expand Down Expand Up @@ -545,8 +545,7 @@ CaseInsensitiveDictionary<object> dictionary
{
if (context.Globals.HaveVariable(index))
{
string item = _GetGlobal(context, index)
?? string.Empty;
string item = _GetGlobal(context, index);
if (!dictionary.ContainsKey(item))
{
list.Add(item);
Expand Down
Expand Up @@ -236,7 +236,7 @@ public static void FieldsToText
// Неописанная функция
// &unifor('+3H')
// Кривая реализация htmlspecialchars
// заменяет
// заменяет
// & на &quot; (здесь ошибка -- надо на &amp;)
// " на &quot;
// < на &lt;
Expand Down Expand Up @@ -442,15 +442,12 @@ public static void SearchFormat
return;
}

PftProgram program = new PftProgram();
PftProgram program;
try
{
// TODO some caching

if (count != 0)
{
program = PftUtility.CompileProgram(format);
}
program = PftUtility.CompileProgram(format);
}
catch (Exception exception)
{
Expand Down Expand Up @@ -596,9 +593,9 @@ public static void GetExternalDbTermRecordCount
// Определённым образом укороченное значение подполя ^B
// - в том случае, если термин превышает указанное количество символов.
// Вторая часть правила позволяет уменьшить необходимость
// перебора терминов словаря при поиске записей по ссылке на
// перебора терминов словаря при поиске записей по ссылке на
// конкретную страницу текста в случае длинных путей и имён
// файлов (таких, что длина термина превышает 250 символов).
// файлов (таких, что длина термина превышает 250 символов).
// Укорочение происходит таким образом, чтобы в поисковом
// термине фигурировал номер страницы.
//
Expand Down
Expand Up @@ -2237,8 +2237,9 @@ public static RecordField FromJson
// ==========================================================

/// <summary>
/// Парсинг текстового представления поля
/// Парсинг текстового представления поля.
/// </summary>
[NotNull]
public static RecordField Parse
(
string tag,
Expand Down

0 comments on commit 72a7d50

Please sign in to comment.