classdef BuildInfoString < RTW.BuildInfoClass
%RTW.BuildInfoString class
% RTW.BuildInfoString extends RTW.BuildInfoClass.
%

% Copyright 2017-2023 The MathWorks, Inc.

properties (SetObservable)
Value = '';
SharedLibraryMerge = true
SourceFileHandle (1,:) RTW.BuildInfoFile {mustBeScalarOrEmpty} ...
= RTW.BuildInfoFile.empty
end

methods
function h = BuildInfoString(value, group, displayLabel, ...
propagateToSharedLibrary, sourceFileHandle)
arguments
value char = ''
group char = ''
displayLabel char = ''
propagateToSharedLibrary = true
sourceFileHandle (1, :) RTW.BuildInfoFile {mustBeScalarOrEmpty} ...
= RTW.BuildInfoFile.empty
end

h.Value = value;
h.Group = group;
h.DisplayLabel = displayLabel;
h.SharedLibraryMerge = propagateToSharedLibrary;
if matlab.internal.feature("PerSourceFileCompileFlags")
h.SourceFileHandle = sourceFileHandle;
else
assert(isempty(sourceFileHandle), 'Check feature control setting')
end
end
end

methods
function val = getPreferredProperties(h)
%GETPREFERREDPROPERTIES - Returns the preferred properties for the DA Studio
%Explorer
% the base class has properties which should be in the
% preferred properties list. Since there is no way to call a
% base class method from a derived class, call a surrogate
% getPreferredProperties from the base class.
base_props = h.getBaseBuildInfoClassProperties();
additional_props = {'Value'};
val = [base_props additional_props];
end

function val = isHierarchical(~)
%ISHIERARCHICAL - returns true if this class has hierarchical child properties.
val = false;
end
end
end