using System;
namespace Newtonsoft.Json.Linq
{
///
/// Specifies the settings used when loading JSON.
///
internal class JsonLoadSettings
{
private CommentHandling _commentHandling;
private LineInfoHandling _lineInfoHandling;
///
/// Initializes a new instance of the class.
///
public JsonLoadSettings()
{
_lineInfoHandling = LineInfoHandling.Load;
_commentHandling = CommentHandling.Ignore;
}
///
/// Gets or sets how JSON comments are handled when loading JSON.
///
/// The JSON comment handling.
public CommentHandling CommentHandling
{
get => _commentHandling;
set
{
if (value < CommentHandling.Ignore || value > CommentHandling.Load)
{
throw new ArgumentOutOfRangeException(nameof(value));
}
_commentHandling = value;
}
}
///
/// Gets or sets how JSON line info is handled when loading JSON.
///
/// The JSON line info handling.
public LineInfoHandling LineInfoHandling
{
get => _lineInfoHandling;
set
{
if (value < LineInfoHandling.Ignore || value > LineInfoHandling.Load)
{
throw new ArgumentOutOfRangeException(nameof(value));
}
_lineInfoHandling = value;
}
}
}
}