doxygen_manual-1.8.1 (1035109), страница 42

Файл №1035109 doxygen_manual-1.8.1 (Методичка, задание и документация на ЛР №7) 42 страницаdoxygen_manual-1.8.1 (1035109) страница 422017-12-22СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 42)

All translators that previously derived from theTranslator class now derive from this adapter class.The TranslatorAdapter_x_y_z class implements the new, required methods. If the new method replacessome similar but obsolete method(s) (e.g. if the number of arguments changed and/or the functionality of the oldermethod was changed or enriched), the TranslatorAdapter_x_y_z class may use the obsolete method toGenerated by Doxygen176Internationalizationget the result which is as close as possible to the older result in the target language. If it is not possible, the result(the default translation) is obtained using the English translator, which is (by definition) always up-to-date.For example, when the new trFile() method with parameters (to determine the capitalization of the first letterand the singular/plural form) was introduced to replace the older method trFiles() without arguments, thefollowing code appeared in one of the translator adapter classes:/*! This is the default implementation of the obsolete method* used in the documentation of a group before the list of* links to documented files.

This is possibly localized.*/virtual QCString trFiles(){ return "Files"; }/*! This is the localized implementation of newer equivalent* using the obsolete method trFiles().*/virtual QCString trFile(bool first_capital, bool singular){if (first_capital && !singular)return trFiles(); // possibly localized, obsolete methodelsereturn english.trFile(first_capital, singular);}The trFiles() is not present in the TranslatorEnglish class, because it was removed as obsolete.

However, it was used until now and its call was replaced bytrFile(true, false)in the doxygen source files. Probably, many language translators implemented the obsolete method, so it perfectlymakes sense to use the same language dependent result in those cases. The TranslatorEnglish does notimplement the old method. It derives from the abstract Translator class. On the other hand, the old translatorfor a different language does not implement the new trFile() method. Because of that it is derived from anotherbase class – TranslatorAdapter_x_y_z. The TranslatorAdapter_x_y_z class have to implementthe new, required trFile() method. However, the translator adapter would not be compiled if the trFiles()method was not implemented. This is the reason for implementing the old method in the translator adapter class(using the same code, that was removed from the TranslatorEnglish).The simplest way would be to pass the arguments to the English translator and to return its result.

Instead, theadapter uses the old trFiles() in one special case – when the new trFile(true, false) is called. Thisis the mostly used case at the time of introducing the new method – see above. While this may look too complicated,the technique allows the developers of the core sources to change the Translator interface, while the users may noteven notice the change. Of course, when the new trFile() is used with different arguments, the English resultis returned and it will be noticed by non English users.

Here the maintainer of the language translator shouldimplement at least that one particular method.What says the base class of a language translator? If the language translator class inherits from any adapterclass the maintenance is needed. In such case, the language translator is not considered up-to-date. On the otherhand, if the language translator derives directly from the abstract class Translator, the language translator isup-to-date.The translator adapter classes are chained so that the older translator adapter class uses the one-step-newertranslator adapter as the base class. The newer adapter does less adapting work than the older one.

The oldestadapter class derives (indirectly) from all of the adapter classes. The name of the adapter class is chosen so thatits suffix is derived from the previous official version of doxygen that did not need the adapter. This way, one cansay approximately, when the language translator class was last updated – see details below.The newest translator adapter derives from the abstract TranslatorAdapterBase class that derives directlyfrom the abstract Translator class. It adds only the private English-translator member for easy implementationof the default translation inside the adapter classes, and it also enforces implementation of one method for noticingthe user that the language translation is not up-to-date (because of that some sentences in the generated files mayappear in English).Generated by Doxygen177Once the oldest adapter class is not used by any of the language translators, it can be removed from the doxygenproject.

The maintainers should try to reach the state with the minimal number of translator adapter classes.To simplify the maintenance of the language translator classes for the supported languages, thetranslator.py Python script was developed (located in doxygen/doc directory). It extracts the important information about obsolete and new methods from the source files for each of the languages.

The informationis stored in the translator report ASCII file (translator_report.txt).Looking at the base class of the language translator, the script guesses also the status of the translator – see thelast column of the table with languages above. The translator.py is called automatically when the doxygendocumentation is generated. You can also run the script manually whenever you feel that it can help you. Of course,you are not forced to use the results of the script. You can find the same information by looking at the adapter classand its base classes.How should I update my language translator? Firstly, you should be the language maintainer, or you shouldlet him/her know about the changes. The following text was written for the language maintainers as the primaryaudience.There are several approaches to be taken when updating your language. If you are not extremely busy, you shouldalways chose the most radical one.

When the update takes much more time than you expected, you can alwaysdecide use some suitable translator adapter to finish the changes later and still make your translator working.The most radical way of updating the language translator is to make your translator class derive directly fromthe abstract class Translator and provide translations for the methods that are required to be implemented – thecompiler will tell you if you forgot to implement some of them.

If you are in doubt, have a look at the TranslatorEnglish class to recognize the purpose of the implemented method. Looking at the previously used adapter classmay help you sometimes, but it can also be misleading because the adapter classes do implement also the obsoletemethods (see the previous trFiles() example).In other words, the up-to-date language translators do not need the TranslatorAdapter_x_y_z classes atall, and you do not need to implement anything else than the methods required by the Translator class (i.e.

the purevirtual methods of the Translator – they end with =0;).If everything compiles fine, try to run translator.py, and have a look at the translator report (ASCII file) at thedoxygen/doc directory. Even if your translator is marked as up-to-date, there still may be some remarks relatedto your source code. Namely, the obsolete methods–that are not used at all–may be listed in the section for yourlanguage. Simply, remove their code (and run the translator.py again).

Also, you will be informed when youforgot to change the base class of your translator class to some newer adapter class or directly to the Translatorclass.If you do not have time to finish all the updates you should still start with the most radical approach as describedabove. You can always change the base class to the translator adapter class that implements all of the not-yetimplemented methods.If you prefer to update your translator gradually, have a look at TranslatorEnglish (the translator_en.h file).

Inside, you will find the comments like new since 1.2.4 that separate always a number of methodsthat were implemented in the stated version. Do implement the group of methods that are placed below the commentthat uses the same version numbers as your translator adapter class. (For example, your translator class have touse the TranslatorAdapter_1_2_4, if it does not implement the methods below the comment new since1.2.4.

When you implement them, your class should use newer translator adapter.Run the translator.py script occasionally and give it your xx identification (from translator_xx.h) tocreate the translator report shorter (also produced faster) – it will contain only the information related to your translator. Once you reach the state when the base class should be changed to some newer adapter, you will see thenote in the translator report.Warning: Don’t forget to compile Doxygen to discover, whether it is compilable. The translator.py does notcheck if everything is correct with respect to the compiler.

Because of that, it may lie sometimes about the necessarybase class.The most obsolete language translators would lead to implementation of too complicated adapters. Because ofthat, doxygen developers may decide to derive such translators from the TranslatorEnglish class, which isby definition always up-to-date.When doing so, all the missing methods will be replaced by the English translation.Generated by DoxygenThis means that not-178Internationalizationimplemented methods will always return the English result.

Характеристики

Список файлов лабораторной работы

Методичка, задание и документация на ЛР №7
docs
Git User Manual.mht
Git в картинках.mht
Генератор документации Doxygen - быстрый старт.mht
Иллюстрированное руководство по Git на Windows.mht
Использование Doxygen для документирования кода.mht
Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее