Класс внутреннего механизма (движка - Engine) Профилировщика (Coverage Engine) является Подклассом от базового класса Visual FoxPro FormSet. Хотя данный факт не обеспечивает никаких дополнительных визуальных  компонентов, но создает Сессию Данных типа FormSet и обеспечивает обратную совместимость для файлов Протоколов, созданных при использовании команд и функций:  WAIT, командаMESSAGEBOX( ), функция, и к тому же дополнительное субклассирование для MSComDlg.CommonDialog.

NoteОбратите Внимание

Данный объект типа formset не является порожденным подклассом  от класса _formset, поэтому Профилировщик Coverage Profiler запускается  начиная с версии Visual FoxPro 5.0, и для более поздних.

Класс

cov_engine

Библиотека Классов

coverage.vcx

Базовый Класс

formset

Порождающий Класс

scov_formset

Дополнительную информацию смотрите в разделе: Подсистема Анализа Приложения "Coverage Profiler".

Expand imageКомментарии

Рассматриваемый контейнер Форм содержит одну форму, одну инструментальную Линейку (toolbar), которые могут быть скрытыми, если установлены соответствующие параметры Настройки, например пользовательский класс CusRegistry или Dialog. Объект Cov_standard, как подкласс от класса cov_engine, обеспечивает простейший пользовательский Интерфейс, подробнее смотрите в разделе: Подсистема Анализа Приложения "Coverage Profiler". Вы можете субклассировать свои собственные Классы на основе материнских классов: cov_engine или cov_standard.

Свойства, События, Методы Краткое Описание

*.cStackXSLT, Свойство

Есть имя файла, содержащего (по-умолчанию) Таблицу стилей для преобразования типа XSL, которая используется при анализе Документа XML вызовом метода TransformStackXML.

aAddIns array, Свойство

Является одномерным массивом, содержащим список зарегистрированных Расширений (Add-Ins).

По-Умолчанию: .F. (для 1-го элемента массива)

aFileTypes array, Свойство

Является двумерным массивом, содержащим список Типов файлов (расширений) обработчиков подсистемы Coverage Profiler. Первый столбец содержит именно расширение файла (.fxp / .vct), из списка Протокола. Второй столбец содержит расширение файла Исходного текста программного модуля (.prg или .vcx), которые подсистема  Coverage Profiler использует при обработке Протокола анализа программного Кода. Данный массив заполняется при выполнении соответствующего метода: FillFileTypeArray( ).

По-Умолчанию: .F. (начальная размерность массива [1, 2])

cAddIn, Свойство

Содержит имя последнего выполненного Модуля Расширения. При запуске подсистемы анализа это свойство может быть заполнено при указании требуемого модуля в стартовых параметрах, или при указании его в событии Init. Иначе, если имя файла Расширения уже зарегистрировано, то оно загружается из соответствующего массива aAddIns.

По-Умолчанию: ""

cBaseFontName, Свойство

Определяет имя базового Шрифта для основных Контролов Приложения. По-Умолчанию, аттрибуты данного шрифта определяются Константами, определяемыми операторами #DEFINE, а именно COV_DEFAULT_BASE_FONTNAME в файле: COV_TUNE.H.

По-Умолчанию: = MS Sans Serif

cBaseMonoFontName, Свойство

Определяет имя базового Шрифта для основных Контролов Приложения, которые требуют моноширинного Шрифта.

По-умолчанию, данный параметр не сохраняется в Реестре, для задания начального значения используется  соответствующее значение из ресурсного файла Visual FoxPro, которое определено для компоненты: MODIFY COMMAND, команда (или для Окна Редактирования). В противном случае, просматривается зарегистрированный Шрифт для системного Окна Visual FoxPro Trace (окно Трассировки). Если перечисленные параметры Отключены, то используется Константа, заданная оператором #DEFINE COV_DEFAULT_MONO_FONTNAME из файла COV_TUNE.H.

По-Умолчанию: Courier New

cCovFilesAlias, Свойство

Содержит имя Курсора профилировщика, содержащего имена файлов, для которых невозможно определить исходные программные Коды. Профилировщик заполняет данный курсор при выполнении  Методов:  CreateCoverageFileNameCursor( ) или FillCoverageFileNameCursor( ). Для добавления имен файлов в рассматриваемый Курсор вы можете использовать метод AdjustCoverageFileNameCursor( ).

По-Умолчанию: IgnoredFiles

cDefaultWritePath, Свойство

Определяет полное имя каталога для сохранения cSourceFile. Обычно используется каталог по-умолчанию для данного Профилировщика "Coverage Profiler".

По-Умолчанию: ""

cMarkExecuted, Свойство

Определяет символ-Маркер, которым отмечаются выполненные Строки программного Кода, проанализированные в текущем файле Протокола. Хотя для данного Свойства, по-умолчанию, установлена пустая строка, профилировщик использует метод SetMarks( ) для выравнивания длин символов-маркеров cMarkExecuted и cMarkNotExecuted, чтобы текст в Протоколе имел корректную ширину, или отступы. Поэтому, начальное значение для данного свойства cMarkExecuted = SPACE(4), что соответствует ширине Маркера cMarkNotExecuted, его длина также =4.

По-Умолчанию: "____"

cMarkNotExecuted, Свойство

Определяет символы-маркеры для строк программного кода, которые Не выполнялись при проведении последнего Тестирования (анализа).

По-Умолчанию: |+SPACE(3)

cSavedSkipFiles, Свойство

Определяет имя файла Таблицы (.dbf), содержащей список файлов - программных компонент, которые пропущены в процессе выполнения Анализа программного Кода.

По-Умолчанию: ""

cSavedStackXML, Свойство

Содержит имя файла, в котором сохраняется протокол Анализа в формате XML, в дальнейшем данный временный файл может быть сохранен на Диске. Данное свойство Очищается  ("") при создании, или загрузке нового Протокола.

cSavedTargetDBF, Свойство

Определяет имя файла Таблицы (.dbf), в которую конвертируется Текстовый Протокол Анализа.

По-Умолчанию: ""

cSkippedAlias, Свойство

Определяет имя Курсора, который содержит список программных файлов, которые не были определены подсистемой "Coverage Profiler". Профилировщик заполняет указанный Курсор при помощи метода CreateSkippedCursor( ), и  сохраняет данную информацию на Диске с помощью метода SaveSkippedCursor( ).

По-Умолчанию: SkippedFiles

cSourceAlias, Свойство

Определяет имя Алиаса таблицы с исходными данными, записями из текстового Протокола Анализа. Данная Таблица создается в методе CreateSourceCursor( ), и добавляется Полями с помощью метода  AdjustSourceCursor( ), индесными Тэгами, и так далее. Таблица заполняется информацией с помощью метода FillSourceCursor( ) из текущего Протокола Анализа.

По-Умолчанию: FromLog

cSourceFile, Свойство

Specifies the name of the file to be analyzed. You can specify this value as the first parameter of the DO (_COVERAGE) WITH command.

По-Умолчанию: ""

cSuspendedLog, Свойство

Определяет имя файла текущего Протокола (Coverage Log), который задан в команде SET COVERAGE, если Профилировщик останавливает процесс протоколирования Анализа. Это свойство заполняется в методе SuspendCoverage( ).

По-Умолчанию: ""

cTargetAlias, Свойство

Определяет имя Алиаса результитрующей Таблицы, содержащей имена Классов, файлов исходных текстов, маркированных процедур, статистическую информацию Анализа. Профилировщик  создает данный курсор в методе CreateTargetCursor( ),  и обеспечивает выполнение метода AdjustTargetCursor( ) - для добавления Полей, индексных Тэгов, и прочего. Аналитическая статистика  заполняется в методе FillTargetCursor( ).

По-Умолчанию: MarkedCode

iLenDuration, Свойство

Определяет длину числовых значений, включая десятичную часть, которая используется при создании числовых Полей в Исходной Таблице.

По-Умолчанию: =8 (В Visual FoxPro 5.0 / 6.0. По-умолчанию = 11 )

iLenExecuting, Свойство

Определяет длину (размер) Поля, содержащего имена исходных, анализируемых Классов, выполненных к настоящему моменту, когда значение константы #DEFINE COV_TOPSPEED из файла COV_TUNE.H = False (.F.).

Вы можете уменьшить это значение для того, чтобы съэкономить дисковое пространство, при уверенности, что имена ваших модулей достаточно коротки. Смотрите объяснения к заголовочному файлу: COV_TUNE.H. Смотрите раздел: Conserving Disk Space During Coverage Runs .

По-Умолчанию: 115

iLenHostFile, Свойство

По-Умолчанию: 115

iLenObjClass, Свойство

Смотрите аналогичную информацию при описании свойства iLenExecuting и в разделе:  Conserving Disk Space During Coverage Runs.

По-Умолчанию: 115

lBaseFontBold, Свойство

Определяет текущую установку характеристики основного Шрифта (его выделенность, "жирность").

По-Умолчанию: .F.

lBaseFontItalic, Свойство

Определяет текущую установку характеристики основного Шрифта (его курсив, "наклон").

По-Умолчанию: .F.

lBaseMonoFontBold, Свойство

Определяет текущую установку характеристики моноширинного Шрифта (его выделенность, "жирность").

По-Умолчанию: .F.

lBaseMonoFontItalic, Свойство

Определяет текущую установку характеристики моноширинного Шрифта (его курсив, "наклон").

По-Умолчанию: .F.

lError, Свойство

Флаг, устанавливаемый при возникновении Ошибки; который регулируется методом Error в случае исключительной ситуации.

По-Умолчанию: .F.

lInCoverageFrame, Свойство

Определяет, что Профилировщик открывается в главном окне Visual FoxPro. По-умолчанию, Профилировщик запускается в отдельном Фрейме.

По-Умолчанию: .F.

lInProfileMode, Свойство

Определяет, что Профилировщик запускается в Режиме Profiler (детального Анализа). По-умолчанию, Профилировщик запускается в режиме итоговой Статистики, Режим Coverage.

По-Умолчанию: .F.

lMarkAllOnLoad, Свойство

Определяет, что весь исходный программный код Отмечен. По-умолчанию, только отдельные строки Кода отмечаются маркерами, которые определил Пользователь.

По-Умолчанию: .F.

lSaveFormPositions, Свойство

Определяет, что для всех форм из из набора Профилировщика выполняется процедура cov_SavePosition, которая запоминает текущую позицию размещения.

По-Умолчанию: .F.

lSmartPath, Свойство

Определяет, что Движек Профилировщика пытается просмотреть все подкаталоги размещения файлов исходных программных текстов.
По-Умолчанию: .T.

lStackXMLExtendedTree, Свойство

Если = .T., тогда проводится более расширенный Анализ с помощью StackXML, в этом случае более точно выполняется анализ времени пенредачи параметров в выполняемые модули. Значение По-Умолчанию = .F.. Однако,  если COV_LOAD_STACK_FROM_DBF = .T.,то данный расширенный анализ XML выполняется всегда.

lStartInProfileMode, Свойство

Определяет, как свойство lInProfileMode устанавливается для каждого нового Протокола Анализа. Данное свойство рассматривается в том случае, когда lMarkAllOnLoad = True (.T.).

По-Умолчанию: .F.

lTurnedOffTrace, Свойство

Определяет, выполняет ли Профилировщик команду: SET TRBETWEEN OFF во время выполнения.

По-Умолчанию: .F.

lUsingRegistry, Свойство

Определяет, выполняется ли сохранения и восстановления параметров в Реестре Microsoft Windows.

По-Умолчанию: .T.

lUsingStatusBar, Свойство

Определяет, используется ли Строка Статуса (для отображения системных сообщений) или сообщения выводятся командой WAIT WINDOW NOWAIT. Строка статуса используется Профилировщиком в режиме запуска как дочернее окно Visual FoxPro или при независимом Фрейме выполняется команда STATUS BAR ON.

По-Умолчанию: .F.

lVFP5, Свойство

Определяет, как Профилировщик запускается в версии Visual FoxPro 5.0.

По-Умолчанию: (ATC("FoxPro 05",VERSION( )) > 0)

nBasefontsize, Свойство

Определяет размер базового Шрифта.

По-Умолчанию: 11 (для версий 5.0 / 6.0 =8)

oFrame, Свойство

Содержит объектную ссылку на системное окно Профилировщика (Coverage Frame), когда последний загружен в режиме отдельного Фрейма. Профилировщик проверяет наличие всех необходимых Окон при активации дополнительных диалоговых боксов или других внешних Компонент (включая субклассированные общие диалоги, активация SET TALK, и порочие режимы).

По-Умолчанию: .NULL.

*.TransformStackXML( ), Метод

Синтаксис: TransformStackXML(tcXSLT, tcXMLIn, tcXMLOut, tlNoShow)

Возвращаемое значение: Returns .T. if successful.

Параметры: tcXSLT Specifies the name of the XSL file.tcXMLIn Specifies the name of the XML input file.tcXMLOut Specifies the name of the XML output file.tlNoShow Specifies whether to call DisplayStackXML.

Примечание: Applies tcXSLT (default to .cStackXSLT) to tcXMLIn (default .cSavedStackXML, GetStackXML( ) called if empty). Saves result to tcXMLOut (defaults to tcXMLIn-based generated name w/ HTM ext). If ! tlNoShow, calls DisplayStackXML( ).

AddFormPositionSaver( ), Метод

Adds an instance of cov_SavePosition to a form to save and restore form size and position.

Синтаксис: AddFormPositionSaver(toForm)

Возвращаемое Значение: Нет

Параметры: toForm Specifies that the cov_SavePosition object is saved to a form.

AddPath( ), Метод

Extracts directory information to concatenate to SET(PATH).

Синтаксис: AddPath(tcFileName)

Возвращаемое Значение: Нет

Параметры: tcFileName Specifies a file name.

Примечание: Extracts the directory information from the passed file name, tcFileName, to concatenate into the current SET(PATH).

AddRegisteredAddin( ), Метод

Adds file name to the aAddIns array.

Синтаксис: AddRegisteredAddin(tcFileToAdd)

Возвращаемое Значение: Нет

Параметры: tcFileToAdd Specifies the file to add to the aAddIns array.

Примечание: Adds a file name, TcFileToAdd, to the aAddIns array when called by the RunAddIn( ) method after an add-in runs successfully.

AdjustCoverageFilenameCursor( ), Метод

Enables adding files to cursor list of unanalyzed files.

Синтаксис: AdjustCoverageFilenameCursor(tcTarget)

Возвращаемое Значение: NOT THIS.lReturn

Параметры: tcTarget Specifies the name of the cursor you want to modify.

Примечание: Makes it possible for you to add files that you do not want analyzed to the cursor's file list when called by the CreateCoverageFilenameCursor( ) method. See the cCovFilesAlias property.

AdjustSourceCursor( ), Метод

Abstract method that makes it possible for you to add index tags and custom fields to the source cursor when called by the CreateSourceCursor( ) method.

Синтаксис: AdjustSourceCursor(tcSource)

Возвращаемое Значение: NOT THIS.lReturn

Параметры: tcSource Specifies the name of the cursor containing the source records.

AdjustTargetCursor( ), Метод

Abstract method called by the CreateTargetCursor( ) method makes it possible for you to add index tags and custom fields to the target cursor.

Синтаксис: AdjustTargetCursor(tcTarget)

Возвращаемое Значение: NOT THIS.lReturn

Параметры: tcTarget Specifies the name of the table being modified.

ClearStatus( ), Метод

Removes a message from the status bar or performs a CLEAR WAIT WINDOW command. See lUsingStatusBar property.

Синтаксис: ClearStatus( )

Возвращаемое Значение: Нет

Параметры: Нет

CreateCoverageFilenameCursor( ), Метод

Creates a cursor to hold the names of source files that the Coverage Profiler should not locate and analyze. See the cCovFilesAlias property.

Синтаксис: CreateCoverageFileNameCursor( )

Возвращаемое Значение: lReturn AND NOT THIS.lError

Параметры: Нет

CreateForms( ), Метод

At startup, displays the Coverage Profiler window after workfiles have been set up if the coverage engine is not in Unattended mode. In the coverage engine base class, this method creates only the Coverage frame (if the engine is not running in the Visual FoxPro window). Subclasses can augment this method to add their own dialogs.

Синтаксис: CreateForms( )

Возвращаемое Значение: Нет

Параметры: Нет

CreateSkippedCursor( ), Метод

The engine creates this cursor by looking for deleted records in the Source table, because skipped records are deleted when the engine encounters file names that cannot be located or that are in the Ignored Files list during its load of the log file. See the CSkippedAlias property.

Синтаксис: CreateSkippedCursor(tcSource, tcSkipped)

Возвращаемое Значение: NOT THIS.lError

Параметры:tcSource Specifies the name of the table containing the source records.TcSkipped Specifies the alias of the cursor containing the skipped records.

CreateSourceCursor( ), Метод

Creates a source cursor in the following format:

  CopyCode imageКопировать Код
CREATE CURSOR(cSource) ;
(Duration n(COV_LEN_DURATION,N_COVLOG_PRECISION), ;ObjClass c(COV_LEN_OBJCLASS), ;Executing c(COV_LEN_EXECUTING), ;Procline i, ;Hostfile c(COV_LEN_HOSTFILE), ;Stacklevel I, ;FileType c(4) )

The Stacklevel field is excluded when the value of the lVFP5 property is true (.T.). See COV_TUNE.H for #DEFINE field lengths.

Синтаксис: CreateSourceCursor(tcSource)

Возвращаемое Значение: lReturn AND NOT THIS.lError

Параметры: tcSource Specifies the name of the cursor containing the source records.

CreateTargetCursor( ), Метод

Creates a target cursor in the following format:

  CopyCode imageКопировать Код
CREATE CURSOR (cTarget) ;
(Hostfile c(COV_LEN_HOSTFILE), ;ObjClass c(COV_LEN_OBJCLASS), ;FileType c(4), ;Marked m, ;Profiled m, ;SourceCode m, ;Coverable i, ;Covered i, ;ObjTotal i, ;ObjHits i)

See COV_TUNE.H for #DEFINE field lengths.

Синтаксис: CreateTargetCursor(tcSource, tcTarget)

Возвращаемое Значение: NOT THIS.lError

Параметры: tcSource Specifies the name of the file to analyze.TcTarget Specifies the name of the file you want to modify.

Примечание: The target file contains one record for each of the following in the coverage log:

  • An ASCII source file.

  • A class contained in an ASCII source file.

  • A class contained in a .vcx or .scx file.

  • A stored procedure list in a .dbc file.

  • A Data Environment class or other Data Environment member class (such as a cursor) in a .frx or .lbx source file.

DeleteRegisteredAddin( ), Метод

Removes a file name from the aAddIns array.

Синтаксис: DeleteRegisteredAddin(tcFileToDelete)

Возвращаемое Значение: Нет

Параметры: tcFileToDelete Specifies the add-in to remove from the registry.

Примечание: Called by the RunAddIn method after an add-in does not run successfully, whether the Registry is currently in use or not.

DisplayProjectStatistics( ), Метод

Enables reporting after project statistics have been gathered in GetProjectStatistics( ).

Синтаксис: DisplayProjectStatistics(tcSource, tcTarget, tcProject)

Возвращаемое Значение: NOT THIS.lError

Параметры:tcSource Specifies the name of the table containing the source records.tcTarget Specifies the name of the table being modified.tcProject Specifies the alias of the project being analyzed.

DisplayStackXML( ), Метод

Displays XML file.

Синтаксис: DisplayStackXML(tcXMLFile)

Возвращаемое значение: Logical. .T. if no error occurs.

Defaults to the current Stack Analysis filename indicated by the cSavedStackXML property.

Примечание: This method is similar to DisplayProjectStatistics, except that, instead of being abstract in the engine, cov_engine.DisplayStackXML performs a ShellExecuteA.

DoMessage( ), Метод

Displays tcMessage.

Синтаксис: DoMessage(tcMessage [, tnMessageBoxOptions [, tcMessageBoxTitle]])

Возвращаемое Значение: liReturn

Параметры:tcMessage Specifies the message that appears in the MESSAGEBOX.TnMessageBoxOptions Specifies the MESSAGEBOX nDialogBoxType setting.TcMessageBoxTitle Specifies the MESSAGEBOX cTitleBarText setting.LiReturn Specifies any return value from MESSAGEBOX( ), or 0 if a WAIT WINDOW executes.

Примечание: If the Coverage Profiler is running in Unattended mode, the message is displayed in a WAIT WINDOW TIMEOUT window so it does not prevent further processing. You can specify the timeout value using COV_TIMEOUT_SECS (a #DEFINE in COV_TUNE.H).

Error( ), Метод

Sets the dialog error flag.

Синтаксис: Error(nError, cMethod, nLine)

Возвращаемое Значение: Нет

Параметры:nError Specifies the Visual FoxPro error number.CMethod Specifies the name of the method that caused the error.NLine Specifies the line number where the error occurred.

Примечание: Depending on the value of COV_DEBUG (a #DEFINE in COV_TUNE.H), this will display an error MESSAGEBOX and release the engine or display a WAIT WINDOW with error information and invoke the native Visual FoxPro error handler to make it possible for you to cancel, suspend, or ignore the current error.

FillCoverageFileNameCursor( ), Метод

Adds files to the list of ignored files.

Синтаксис: FillCoverageFileNameCursor( )

Возвращаемое Значение: NOT THIS.lError

Параметры: Нет

Примечание: CreateCoverageFileNameCursor( ) calls this method to add the names of the coverage engine file set to the group of files that should be ignored during processing. This method is a hard-coded set of INSERTs in the base coverage engine. You can override this set in a subclass designed to read in a set of file names from a text file generated from the Coverage.pjx file list.

FillFileTypeArray( ), Метод

Initializes the aFileTypes array with known file extensions. See the aFileTypes property.

Синтаксис: FillFileTypeArray( )

Возвращаемое Значение: NOT(EMPTY(THIS.aFileTypes[1,1]) OR THIS.lError)

Параметры: Нет

FillOneTargetRecord( ), Метод

Adds unmarked source code to memo field.

Синтаксис: FillOneTargetRecord(tcSource, tcTarget, tlFillingAll)

Возвращаемое Значение: lReturn AND(NOT THIS.lError)

Параметры:tcSource Specifies the name of the table containing the source records.TcTarget Specifies the name of the table being modified.TlFillingAll Specifies whether all records are processed in a loop, which changes the user feedback and displayed character handling.

Примечание: Places the unmarked source code for a target record into the appropriate memo field for later marking using a different strategy to find the right code for each type of source code. When COV_TOPSPEED is not #DEFINEd true (.T.), this method also places certain initial statistics into the Target file.

FillSourceCursor( ), Метод

APPENDs the coverage log contents to the coverage analysis source file.

Синтаксис: FillSourceCursor(tcSource)

Возвращаемое Значение: lReturn

Параметры: tcSource Specifies the name of the source file.

Примечание: This method calls the SourceAvailable( ) method to eliminate records that refer to source files unavailable for analysis. It marks these records deleted in the source cursor.

FillTargetCursor( ), Метод

Calls the FillOneTargetRecord( ) method for all target records in a loop.

Синтаксис: FillTargetCursor(tcTarget)

Возвращаемое Значение: (THIS.iTargetReccount > 0 AND NOT THIS.lError)

Параметры: tcTarget Specifies the target file that receives the processed results.

Примечание: Replicates the ObjHits statistics from the CreateTargetCursor( ) method for additional records referring to the same source files with the target files. See the CreateTargetCursor( ) method.

FilterListByLocation( ), Метод

Provides a placeholder for future enhancements.

Синтаксис: FilterListByLocation( )

Возвращаемое Значение: NOT THIS.lError

Параметры: Нет

Примечание: FilterListByLocation( ) can be called either when a log loads or in response to a user action, with or without the Coverage Profiler application. This method is abstract in the engine.

GetAlias( ), Метод

Returns the current or default alias of a Coverage Profiler workfile type.

Синтаксис: GetAlias(tAlias, tcWhichProp)

Returns: cReturn

Параметры:tAlias Specifies the alias of a file.tcWhichProp Specifies the workfile type (currently, either Source or Target) of the current default.

Примечание: GetAlias( ) returns either a currently used alias or the default alias of one of the Coverage Profiler workfile types. The valid workfile types include the following:

NoteПримечание

"SOURCE","TARGET","SKIPPED","COVFILES", and "PROJECT"

(The list of types is #DEFINEd in COV_SPEC.H as COV_KNOWN_ALIAS_PROPERTIES.) Each workfile type matches one c...Alias property to specify the default alias for this workfile.

The Coverage Profiler usually has a cursor open using each one of the workfile default aliases. However, the Coverage Profiler is capable of handling many sets of workfiles at the same time, within its data session, as long as you specify separate aliases for each one. The GetAlias( ) method and the system of defined work types plus the following properties make it possible for you to have default alias names without the default aliases being hard-coded:

  • cBaseFontName

  • cBaseMonoFontName

  • cCovFileAlias

  • cDefaultWritePath

  • cMarExecuted

  • cMarkNotExecuted

  • cOldPath

  • cSavedSkippedFiles

  • cSavedTargetDBF

  • cSkippedAlias

  • cSourceAlias

  • cSourcefile

  • cSuspendedLog

  • cTargetAlias

The engine methods that process the workfiles use aliases as parameters, so you can specify which source, target, or other file you are interested in at any time. Because you usually are interested only in one set of workfiles, however, these methods all use the GetAlias( ) methods to specify which alias and workfile default type to seek if you do not pass them a specific alias or aliases.

GetFontsFromUser( ), Метод

Creates an instance of a common dialog subclass to ask the user to set font properties. If lUsingOCXs is False (.F.) or there has been an error creating an instance of the common dialog, the method uses the GETFONT( ) method. If the first parameter, tlBaseMonoFont, is True (.T.), the method shows only monospaced fonts and fills the monospaced font attribute properties of the engine. If this parameter is False (.F.), the second set of base font attribute properties is filled from a list of all available screen fonts.

See to the GetResourceLocation( ) method for more information on the lUsingOCXs property.

Синтаксис: GetFontsFromUser(tlBaseMonoFont, toMemberHost )

Возвращаемое Значение: lFontChange AND NOT THIS.lError

Параметры:tlBaseMonoFont Specifies the default monospace font style.ToMemberHost Specifies a reference to the current Coverage object.

GetProjectStatistics( ), Метод

Creates a cursor containing project information.

Синтаксис: GetStatistics(tcSource, tcTarget, tcProject)

Возвращаемое Значение: lReturn

Параметры:tcSource Specifies the name of the alias containing the source records.tcTarget Specifies the name of the alias being modified.tcProject Specifies the project containing the source files.

Примечание: The information contained in the cursor is in the following format.

CREATE CURSOR(cProject) ;

NoteПримечание

(Hostfile c(COV_LEN_HOSTFILE), ;FileType c(4), ;Coverable n(8), ;Covered n(8), ;ObjTotal n(8), ;ObjHits n(8))

GetProjectStatistics( ) creates a header file in this cursor, indicating the project to which this cursor applies and fills this cursor with statistics drawn from the current coverage log that apply to each source file in the project. If necessary, GetProjectStatistics( ) calls MarkOneTargetRecord( ) for any project files that have not yet had their source code marked.

GetRegisteredAddins( ), Метод

Fills the aAddIns array and the cAddIn property.

Синтаксис: GetRegisteredAddins( )

Возвращаемое Значение: Нет

Параметры: Нет

GetRegistryKeyValue( ), Метод

Retrieves registry value of user option

Синтаксис: GetRegistryKeyValue(tcOption, tDefaultValue, tcPath)

Возвращаемое Значение: vReturn

Параметры:tcOption Specifies the file type option.tDefaultValue Specifies the default registry value.tcPath Specifies RegKey.

Примечание: This method, typically used at startup, uses the registry-handling member of the toolbar in the engine formset to get a registry key value for a user option. It converts the registry value to other TYPE( )s as required and compares this TYPE( ) to the passed value, tDefaultValue. It returns the registry value or the default value if the registry value is not found or is of the wrong type.

GetResourceLocation( ), Метод

Specifies whether GETFILE( )/ShowOpen( ) strategy or PUTFILE( )/ShowSave( ) strategy is followed.

Синтаксис: GetResourceLocation(tcHost, tcTitle, tcCDLFilter, tcFileName, tcWhichDialog, [toMemberHost] )

Возвращаемое Значение: lcFileName

Параметры:tcHost Specifies the name of the file the method is starting from, usually seeking the matching file name of the uncompiled version of the code. If it is passed, it provides information for the common file dialog .InitDir property. tcTitle Specifies the title to use in the dialog or, in the GETFILE( )/PUTFILE( ) version, to use as a WAIT WINDOW NOWAIT prompt. If tcHost also is passed and includes a file name, then this information is added to the dialog title or prompt.tcCDLFilter Specifies the file types allowed in the dialog. This parameter is expressed in the format required by the common dialog filter expression. If the GETFILE( )/PUTFILE( ) is called, the method parses the common dialog filter to put it into appropriate format for the two Visual FoxPro functions.tcFileName Specifies the default file name to display.tcWhichDialog Specifies the GETFILE or PUTFILE.toMemberHost Specifies an optional form reference that can be passed to indicate where the dialog is displayed. If toMemberHost is not passed, the file dialog will display relative to the Coverage frame (if the Coverage frame exists) or to the first form in the formset collection (if the Coverage Profiler is in the Visual FoxPro window).

Примечание: Adds a member of the appropriate common dialog subclass (depending on the value of tcWhichDialog) if this is the first call. The dialog subclasses differ in how they set various flags.

NoteПримечание

This method provides for additional dialog subclasses, showing a Help file or print dialog, to be instantiated and used in the future.

If a common dialog subclass or .ocx-related error occur in the Coverage Profiler, this method sets the lUsingOCXs property to false (.F.) and uses GETFILE( )/PUTFILE( ).

You can set the #DEFINE COV_USE_OCXS if you prefer to default to the native Visual FoxPro functions even if there are no OCX errors.

GetStackXML( ), Метод

Generates Stack Analysis XML from tcLog.

Синтаксис: GetStackXML(tclog)

Возвращаемое значение: Logical. .T. if successful.

Параметры: tcLog Specifies the name of the log file.

Примечание: This function defaults to current Coverage source log. The tcLog argument is ignored if DEFINEd COV_LOAD_STACK_FROM_DBF is .T.

GetTableName( ), Метод

Generates file names for unattended operation.

Синтаксис: GetTableName(tcWhichSuffix)

Возвращаемое Значение: cLogfileStem+SUFFIX[+n]+.dbf

Параметры: tcWhichSuffix Specifies which file extension to use.

Примечание: This method allows the coverage engine to generate file names with which to save its work to disk without overwriting existing files. Generally it just supplies file name defaults, but in Unattended mode, this method creates the file names without user intervention. Each method that saves a file to disk calls GetTableName( ) with a specific suffix; for example, in the SaveSkippedCursor:

  CopyCode imageКопировать Код
cDBFName = ; THIS.GetTableName(COV_SKIPFILEDBF_SUFFIX)

GetTableName( ) uses the path and stem of the current log file name (THIS.cSourceFile) and attaches the appropriate suffix to this stem plus a digit, followed by the DBF extension. For example, Testlog.txt would produce TESTLOG_SKIP1.DBF in the previous example.

GetTableName( ) then increments the digit if the generated file name exists, until it finds a name that does not exist.

The default suffixes are #DEFINEs in COV_TUNE.H.

LockScreens( ), Метод

Freezes or releases LockScreen properties and MousePointer properties for all members of _Screen during various long procedures.

Синтаксис: LockScreens(tlOn)

Возвращаемое Значение: Logical. .T.

Параметры: tlOn Specifies whether to lock the Lockscreen and MousePointer properties.

MarkAllTargetRecords( ), Метод

Calls the MarkOneTargetRecord( ) method for all target records in a loop. Can be called because lMarkAllOnLoad is true (.T.) or because the coverage engine is in Unattended mode.

Синтаксис: MarkAllTargetRecords(tcSource, tcTarget)

Возвращаемое Значение: NOT THIS.lError

Параметры:tcSource Specifies the name of the table containing the source records.tcTarget Specifies the name of the table being modified.

MarkCodeLine( ), Метод

Creates a marked-up version of a line of code, plus coverage statistics.

Синтаксис: MarkCodeLine(tcLine, tiExecuted, tnFirst, tnAverage)

Возвращаемое Значение: CMarkedLine

Параметры:tcLine Specifies the line of code.tiExecuted Specifies the number of times tcLine was run.tnAverage Specifies the average length of time to run.

Примечание: In Coverage mode, MarkCodeLine( ) marks code as "Executed" if tiExecuted is a positive number and "not Executed" if tiExecuted is 0. In Profile mode, MarkCodeLine( ) marks coverage statistics appropriately for the line. In either mode, MarkCodeLine( ) marks code as uncoverable (preceded by spaces) if tiExecuted is .NULL.

MarkOneTargetRecord( ), Метод

Determines the marked status of the current line.

Синтаксис: MarkOneTargetRecord(tcSource, tcTarget, tlFillingAll)

Возвращаемое Значение: lReturn AND (NOT THIS.lError)

Параметры:tcSource Specifies the name of the table containing the source records.tcTarget Specifies the record being modified.tlFillingAll Specifies whether other target records are being processed. If all records are processed in a loop, then the user feedback and handling of displayed characters changes.

Примечание: Determines whether the current target record, tcTarget, is already marked in the current coverage mode and, if not, passes the relevant information to the MarkTargetCoverage( ) method for processing.

MarkTargetCoverage( ), Метод

Marks up a copy of the source and REPLACEs a memo field in the target file.

Синтаксис: MarkTargetCoverage(tcSource, tcTarget)

Возвращаемое Значение: NOT (EMPTY(cMemo) OR THIS.lError)

Параметры: tcSource Specifies the name of the table containing the source records.tcTarget Specifies the name of the table being modified.

Примечание: MarkTargetCoverage( ) creates a marked-up version of tcSource and REPLACEs a memo field in the target file, tcTarget, (whether the code is for a class or a full procedure file).

To perform this action, the method starts with the sourcecode memo. The memo field REPLACEd depends on whether Coverage Profiler is marking Profiler or Coverage information, because the Target record retains both sets of marked-up code.

This method parses the source code and evaluates its statistics line by line. By default, this method calls the MarkCodeLine( ) method to mark each line when it has the appropriate statistics. However, the way this method marks the code line is #DEFINEd as COV_MARK_CODE_LINE in COV_TUNE.H, not directly implemented as a call to the MarkCodeLine( ) method. This makes it possible for you to replace the call to the MarkCodeLine( ) method with a different marking system. A second #DEFINE, COV_TOPSPEED, in COV_TUNE.H also makes it possible for you to switch the MarkCodeLine( ) call to a simpler, in-line marking system for fastest response time.

MarkTargetCoverage( ) evaluates each line to find out whether it was executed, how many times it was executed, and its execution timings (first and average) when in Profile mode. However, many lines are considered uncoverable in Coverage Profiler. These lines, such as comments, DEFINE CLASS and ELSE/Otherwise statements, and lines within TEXT ... ENDTEXT, do not appear in coverage logs, because they are not executable.

NoteПримечание

Other uncoverable code lines include #DEFINE statements, empty lines, continuations of executing lines, and parameter lines.

This method sets the number of times these lines run to .NULL. These lines are not considered when Coverage Profiler compiles statistics. In addition, lines broken by continuation symbols (semicolons) are considered as a single line of code and marked only on the last line.

OrderListByTime( ), Метод

Provides a placeholder for future enhancements and subclasses.

Синтаксис: OrderListByTime( )

Возвращаемое Значение: NOT THIS.lError

Параметры: Нет

Примечание: OrderListByTime( ) is abstract in the engine.

PassedProperParams( ), Метод

Синтаксис: PassedProperParams(tcFile, tlUnattended, tcAddIn)

Возвращаемое Значение: lReturn

Параметры: tcFile Specifies the name of the log file.tlUnattended Specifies whether to run in Unattended mode.tcAddIn Specifies the add-in file name(s).

Примечание: Test at startup to determine whether passed parameters are appropriate to the class. If any passed parameters are not appropriate TYPE( ), provides a MESSAGEBOX showing what parameters may be passed and RETURNs false (.F.), preventing any further coverage processing, as well as the creation of an instance of the class.

This method uses a MESSAGEBOX for feedback and stops processing even if the Coverage Profiler is starting up in Unattended mode. If you are setting up the Coverage Profiler for automated testing, be sure your calling program sends correct parameters or the analysis will not proceed.

RestoreCoverage( ), Метод

Resumes coverage logging from suspended operation.

Синтаксис: RestoreCoverage( )

Возвращаемое Значение: Нет

Параметры: Нет

Примечание: If the Coverage Profiler previously suspended coverage logging, this method gives the user a chance to resume coverage logging when the Coverage Profiler releases. The user can choose to overwrite this previous log, append new log entries to it, or not resume coverage logging at that time.

RunAddin( ), Метод

Runs an add-in file.

Синтаксис: RunAddin(tcAddin)

Возвращаемое Значение: lReturn AND NOT THIS.lError

Параметры: tcAddin Specifies the name of the file to run.

Примечание: RunAddin( ) runs a file (.scx, .fxp, .app, .prg, .qpx, .qpr, .mpx, or .mpr) that adds functionality to the Coverage object. If you do not pass a file name, RunAddin( ) runs the file specified by the cAddIn property.

The tcAddin file must accept an object reference, because the file is run by passing a reference to the coverage form, as in the following examples (depending on the file type):

  CopyCode imageКопировать Код
DO (cFileName) WITH THIS
DO FORM (cFileName) WITH THIS

SaveFormsetAttributes( ), Метод

Saves general frame and formset characteristivs to the registry as Profiler ends.

Синтаксис: SaveFormsetAttributes( )

Возвращаемое Значение: Нет

Параметры: Нет

SaveOptionsToRegistry( ), Метод

Saves current user values to the registry.

Синтаксис: SaveOptionsToRegistry( )

Возвращаемое Значение: lSuccess

Параметры: Нет

Примечание: SaveOptionsToRegistry( ) can be called any time the user's current values should be saved to the registry. It saves the following user preferences:

  • Work options group

    lStartInProfileModelSmartPathlMarkAllOnLoadcMarkExecutedcMarkNotExecutedlRegisterAddIn

  • UI options group

    Font name, size, italic, bold for base monospace font

There are a few registry settings not saved by this method, because they have to be done at specific moments during the life of the engine. These are:

Coverage or the main Visual FoxPro frame (must be done when the user makes a choice and will be in effect next session but does not correspond to or affect any of the coverage property values for this session).

Registered add-ins (this array is manipulated over the life of the session, and the full set of file names it contains is saved to the registry at the end of the session).

SaveSkippedCursor( ), Метод

Saves the skipped files cursor to disk.

Синтаксис: SaveSkippedCursor(tcSkipped)

Возвращаемое Значение: RETURN NOT THIS.lError

Параметры: tcSkipped Specifies the cursor containing skipped records.

Примечание: Saves the skipped files cursor to disk if it contains any records and places the name of the table on disk in the cSavedSkipFiles property. See the cSkippedAlias and cSavedSkipFiles properties.

SaveTargetToDisk( ), Метод

Saves output file, including marked-up code and statistics, to disk.

Синтаксис: SaveTargetToDisk(tcTarget)

Возвращаемое Значение: lReturn and NOT THIS.lError

Параметры: tcTarget Specifies the name of the modified table saved to disk.

SetFontValues( ), Метод

Sets up initial font attribute values using registry key values and other defaults.

Синтаксис: SetFontValues( )

Возвращаемое Значение: NOT THIS.lError

Параметры: Нет

Примечание: See cBaseFontName and cBaseMonoFontName for information on how the coverage engine derives these defaults.

SetFormsetAttributes( ), Метод

Reads and restores general frame and formset characteristics.

Синтаксис: SetFormsetAttributes( )

Возвращаемое Значение: Нет

Параметры: Нет

Примечание: Reads and restores general frame and formset characteristics from the registry as Profiler starts.

SetLogFile( ), Метод

Attempts to set up a file for analysis.

Синтаксис: SetLogFile(tcFile)

Возвращаемое Значение: lReturn

Параметры: tcFile Specifies the name of the file to analyze.

Примечание: If you pass no string value, the SET COVERAGE value is used. If there is no current log file, the method prompts for a file name. If a log file can be set successfully, the method returns .T. If the user designates no log file, the method returns. F. If no new log is specified, the Coverage Engine returns to the currently loaded log, if one is loaded, or releases, if no log is loaded.

SetMarks( ), Метод

Synchronizes and returns the values of cMarkExecuted and cMarkNotExecuted.

Синтаксис: SetMarks( )

Возвращаемое Значение: NOT THIS.lError

Параметры: Нет

Примечание: Synchronizes the lengths of cMarkExecuted and cMarkNotExecuted and returns the values of either or both properties to a default if they are not character-type or both properties are empty. If user options are not available from the registry, this method gets defaults from the #DEFINE values, COV_DEFAULT_MARKNOTEXECUTED and COV_DEFAULT_MARKEXECUTED, which you can set in COV_TUNE.H. A third #DEFINE, COV_DEFAULT_MARKSPACING, makes sure there is space between the marks and the line of code.

SetRegisteredAddins( ), Метод

Saves the file names in the aAddIns array to registry values.

Синтаксис: SetRegisteredAddins( )

Возвращаемое Значение: Нет

Параметры: Нет

SetRegistryKeyValue( ), Метод

Sets a registry key value from a user option.

Синтаксис: SetRegistryKeyValue(tcWhichOption, tValue)

Возвращаемое Значение: NOT THIS.lError

Параметры: tcWhichOption Specifies the user option to be accessed.tValue Specifies the value of tcWhichOption.

Примечание: SetRegistryKeyValue( ) uses the registry-handling member of the toolbar in the engine formset to set a registry key value from a user option. It converts all values to string type before sending them to the registry-handler to apply to the registry.

SetUIFonts( ), Метод

Provides font preferences.

Синтаксис: SetUIFonts( )

Возвращаемое значение: NOT THIS.lError

Параметры: Нет

Примечание: Abstract in the engine, called by SetUiOptions, SetUIFonts( ), makes it possible for the user font preferences saved in the various Base and BaseMont font properties to be applied to appropriate displayed characters.

SetUIOptions( ), Метод

Sets UI options and defaults.

Синтаксис: SetUIOptions( )

Возвращаемое значение: lReturn and NOT THIS.lError

Параметры: Нет

Примечание: Sets up initial UI options according to user preferences or defaults after initial setup of workfiles. This group of options includes fonts and the array of registered add-ins. It is required for UI display and user interaction with the workfiles, after they have been processed.

SetUIToShowCode( ), Метод

Enables display of current target record in new log.

Синтаксис: SetUIToShowCode(tcTarget)

Возвращаемое значение: NOT THIS.lError

Параметры: tcTarget Specifies the name of the table being modified.

Примечание: Abstract in the engine, called at the end of SetupWorkFiles( ) to allow UI to show current Target record in the newly loaded log.

SetUIToShowFileStates( ), Метод

Enables reporting of log loading status.

Синтаксис: SetUIToShowFileStates(tcSource, tcTarget)

Возвращаемое значение: NOT THIS.lError

Параметры: tcSource Specifies the name of the table containing the source records.tcTarget Specifies the name of the table being modified.

Примечание: Abstract in the engine, called at the end of SetupWorkFiles( ) to allow UI to indicate success or failure or current attempt to load a log.

SetUpWorkFiles( ), Метод

Sets and validates a coverage log.

Синтаксис: SetupWorkFiles(tcLogFile, tcSource, tcTarget)

Возвращаемое значение: lReturn AND NOT THIS.lError

Параметры: TcLogFile Specifies the name of the text log to analyze.tcSource Specifies the name of the file to use as source.tcTarget Specifies the name of the cursor being modified.

Примечание: SetUpWorkFiles( ) sets and validates a coverage log and then creates and fills the source and target work files for this text log. If the user choice is the same as the log file currently loaded, the method asks the user whether the log should be reloaded and analyzed. It makes sure the log is not open in a text window before loading the log. If the user specifies lMarkAllOnLoad, it marks all records in the current mode (Coverage or Profile) after successfully filling the target file with source code entries. If Coverage Profiler is in Unattended mode, it marks all records in both Coverage and Profile mode after successfully filling the target file. If the load succeeds, this method also sets the cDefaultWritePath to mark the path of the text log and the cSourceFile property to hold the name of this text log.

SetWorkOptions( ), Метод

Sets initial user defined options.

Синтаксис: SetWorkOptions( )

Возвращаемое значение: NOT THIS.lError

Параметры: Нет

Примечание: SetWorkOptions( ) sets up initial options according to user preferences or defaults before initial setup of workfiles. This group of options includes coverage marks and initial coverage mode and is required for processing the workfiles.

ShowProjectStatistics( ), Метод

Runs coverage analysis figures against a Visual FoxPro project.

Синтаксис: ShowStatistics(tcSource, tcTarget, tcProject)

Возвращаемое значение: lReturn AND NOT THIS.lError

Параметры: tcSource Specifies the name of the table containing the source records.tcTarget Specifies the name of the table being modified.tcProject Specifies the project containing tcSource.

Примечание: ShowProjectStatistics( ) calls GetProjectStatistics( ) and DisplayProjectStatistics( ) to run coverage analysis figures against a specific Visual FoxPro project set of files.

ShowStackXML( ), Метод

Синтаксис: ShowStackXML(tclog)

Возвращаемое значение: Logical. .T. if successful.

Параметры: tcLog Specifies the name of the log file.

Примечание: ShowStackXML( ) calls GetStackXML(tcLog) and DisplayStackXML(tcXMLFile) to run coverage analysis figures against a specific Visual Foxpro project set of files. The tcLog argument is ignored if DEFINEd COV_LOAD_STACK_FROM_DBF is .T.

ShowStatistics( ), Метод

Abstract in the base engine.

Синтаксис: ShowStatistics( )

Возвращаемое значение: NOT THIS.lError

Параметры: Нет

ShowStatus( ), Метод

Places a message in the status bar or a WAIT WINDOW. See lUsingStatusBar property.

Синтаксис: ShowStatus(cMessage)

Параметры: cMessage Specifies the message to display in the status bar or WAIT WINDOW.

SourceAvailable( ), Метод

Replaces the current Source log compiled file name with the full path name of the file holding the uncompiled source code.

Синтаксис: SourceAvailable( )

Возвращаемое значение: lReturn

Параметры: Нет

Примечание: SourceAvailable( ) calls GetSourceLoc( ) if necessary to locate uncompiled source code. If the lSmarthPath property is true (.T.), it uses AddPath( ) to adjust SET (PATH) as the user specifies directories in which to find source files. RETURNs false (.F.) if the source file is on the Ignored Files list, if the file is of an unknown type, or if the uncompiled source code cannot be found.

SourceFileIsLog( ), Метод

Checks the file name held in the cSourceFile property for valid coverage log format.

Синтаксис: SourceFileIsLog( )

Возвращаемое значение: lReturn

Параметры: Нет

SuspendCoverage( ), Метод

Sets the cSuspendedLog property to the name of the current log.

Синтаксис: SuspendCoverage( )

Возвращаемое значение: Нет

Параметры: Нет

Примечание: Sets cSuspendedLog to the name of the current log and temporarily stops Visual FoxPro from writing this log, in one of the following cases:

  • The passed file name is the same as the current coverage log.

  • No file name is passed and the engine defaults to analyzing the current coverage log.

ToggleCoverageProfileMode( ), Метод

Переключает (выделяет/снимает выделение) результирующих Записей в новый режим.

Синтаксис: ToggleCoverageProfileMode(tcSource, tcTarget)

Возвращаемое значение: RETURN NOT THIS.lError

Параметры: tcSource  - имя исходной Таблицы, .tcTarget - имя модифицированной Таблицы.

Примечание: Если  lMarkAllOnLoad = true (.T.), то маркируются все Записи в новом Режиме.

ToggleStackXMLExtendedTree( ), Метод

Переключатель  .lStackXMLExtendedTree.

Синтаксис: ToggleStackXMLExtendedTree( )

Возвращаемое значение: NOT THIS.lError

Параметры: Нет

Примечание: Разрабатывался для усиления возможностей Субклассирования в условиях переключения в Пользовательском Интерфейсе, изменяет текущую схему XSLT, и другие характеристики. Данный метод аналогичен методу:  ToggleCoverageProfileMode.

Expand imageСм. также