Results 1 to 3 of 3

Thread: replace header file string

  1. #1
    Join Date
    Aug 2017
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    9

    Post replace header file string

    i have a data in variable "V" (fms_fast is the data in variable 'v'). i have a header file and i have attached it below.
    i have to replace the string @seq_name@ in the header file with the data in the variable (v)..
    please help me with this
    Qt Code:
    1. /** \file msel_@seq_name@.h
    2.  *
    3.  * DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED BY MSEQ CODE GENERATOR !
    4.  *
    5.  * %PCMS_HEADER_SUBSTITUTION_START:%
    6.  * <table border="0" cellspacing="0" cellpadding="0">
    7.  * <tr> <td> Source: </td> <td> %PM: msel_@seq_name@.h %
    8.  * </td></tr>
    9.  * <tr> <td> Revision: </td> <td> %PR: 1.00 % </td></tr>
    10.  * <tr> <td> Status: </td> <td> %PS: UNDER_REVIEW % </td></tr>
    11.  * <tr> <td> Author: </td> <td> Hans-Joerg Boehme </td></tr>
    12.  * <tr> <td> Date: </td> <td> %PUDT: 03-AUG-2017 11:22:48 % </td></tr>
    13.  * </table>
    14.  * %PCMS_HEADER_SUBSTITUTION_END:%
    15.  * \n
    16.  * <table border="0" cellspacing="0" cellpadding="0">
    17.  * <tr> <td> COMPONENT: </td> <td> MSEQ: Measurement Sequences </td></tr>
    18.  * <tr> <td> SCOPE: </td> <td> Public </td></tr>
    19.  * <tr> <td> TARGET: </td> <td> Freescale MPC, Renesas RH850 </td></tr>
    20.  * </table>
    21.  */
    22.  
    23. #ifndef I_MSEL_@SEQ_NAME@_H
    24. #define I_MSEL_@SEQ_NAME@_H
    25.  
    26. /*********************************************************************************************************************/
    27. /* Include common and project definition header */
    28. /*********************************************************************************************************************/
    29. #include "dstdint.h" /* Standard definitions */
    30. #include "dassert.h" /* Standard definitions */
    31. #include "dstdbool.h" /* Standard definitions */
    32. #include "dstring.h" /* Standard definitions */
    33.  
    34. #include "tmp_pdf.h" /* Project definitions */
    35.  
    36. /*********************************************************************************************************************/
    37. /* Include headers of the component library */
    38. /*********************************************************************************************************************/
    39. #include "msel.h" /* MSEQ sequence library interface template */
    40.  
    41. /*********************************************************************************************************************/
    42. /* Include other headers */
    43. /*********************************************************************************************************************/
    44.  
    45. #ifdef __cplusplus
    46. extern "C" {
    47. #endif
    48.  
    49. /*********************************************************************************************************************/
    50. /* Definition of exported symbolic constants */
    51. /*********************************************************************************************************************/
    52.  
    53. /*********************************************************************************************************************/
    54. /* * code generator defined constants */
    55. /*********************************************************************************************************************/
    56. /*********************************************************************************************************************/
    57. /* * sequence type name definition */
    58. /*********************************************************************************************************************/
    59. #define MSEL_@SEQ_NAME@
    60.  
    61. /*********************************************************************************************************************/
    62. /* Definition of exported function like macros */
    63. /*********************************************************************************************************************/
    64.  
    65. /*********************************************************************************************************************/
    66. /* Definition of exported types (typedef, enum, struct, union) */
    67. /*********************************************************************************************************************/
    68.  
    69. /*********************************************************************************************************************/
    70. /* Declaration of exported variables */
    71. /*********************************************************************************************************************/
    72.  
    73. /*********************************************************************************************************************/
    74. /* Declaration of exported constant data */
    75. /*********************************************************************************************************************/
    76. extern const struct MSEL_meas_seq_S MSEL_meas_seq_@seq_name@;
    77.  
    78. /*********************************************************************************************************************/
    79. /* Declaration of exported function prototypes */
    80. /*********************************************************************************************************************/
    81.  
    82. #ifdef __cplusplus
    83. }
    84. #endif
    85.  
    86. #endif /* I_MSEL_ @SEQ_NAME@ _H */
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: replace header file string

    Show us you actually want help.
    What did you try and what were the problems you encountered?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,342
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: replace header file string

    Seems this poster want us to write the code. I'll give the hints that QString::contains(), QString::indexOf(), and QString::replace() might be good methods to investigate as part of a solution.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. The following user says thank you to d_stranz for this useful post:

    deepikha (19th October 2017)

Similar Threads

  1. Replies: 6
    Last Post: 24th August 2015, 07:25
  2. Replies: 8
    Last Post: 2nd January 2014, 15:44
  3. How to replace string in qt
    By lekhrajdeshmukh in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2011, 09:19
  4. [java] string.replace
    By mickey in forum General Programming
    Replies: 3
    Last Post: 7th September 2010, 08:04
  5. replace string in QList<QStringList>
    By estanisgeyer in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2008, 18:40

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.